summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-12-16 16:21:50 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-12-18 10:19:21 +0800
commit66bf929fa97fabb70198455f9eec2e9ccf0661fa (patch)
treedf9944b43cb30900f4947c7b1ea7e777d16b0d19
parentdf46fcfe4867fd16729bb10dfb82dcd43595c6c2 (diff)
downloadtalos-petitboot-66bf929fa97fabb70198455f9eec2e9ccf0661fa.zip
talos-petitboot-66bf929fa97fabb70198455f9eec2e9ccf0661fa.tar.gz
configure: Use AC_GNU_SOURCE
Rather than #defining _GNU_SOURCE in our .c files, we can define this from config.h instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--configure.ac.in1
-rw-r--r--discover/boot.c4
-rw-r--r--discover/event.c1
-rw-r--r--discover/kboot-parser.c4
-rw-r--r--discover/parser-conf.c4
-rw-r--r--discover/paths.c4
-rw-r--r--discover/pxe-parser.c4
-rw-r--r--discover/resource.c4
-rw-r--r--discover/udev.c4
-rw-r--r--discover/user-event.c1
-rw-r--r--discover/yaboot-parser.c4
-rw-r--r--lib/url/url.c1
-rw-r--r--test/lib/list-test.c2
-rw-r--r--ui/common/joystick.c1
-rw-r--r--ui/common/ps3.c4
-rw-r--r--ui/common/timer.c1
-rw-r--r--ui/common/ui-system.c4
-rw-r--r--ui/ncurses/generic-main.c4
-rw-r--r--ui/ncurses/nc-boot-editor.c4
-rw-r--r--ui/ncurses/nc-config.c5
-rw-r--r--ui/ncurses/nc-cui.c4
-rw-r--r--ui/ncurses/nc-menu.c4
-rw-r--r--ui/ncurses/nc-scr.c4
-rw-r--r--ui/ncurses/nc-sysinfo.c6
-rw-r--r--ui/ncurses/nc-widgets.c5
-rw-r--r--ui/ncurses/ps3-main.c4
-rw-r--r--ui/twin/main-generic.c1
-rw-r--r--ui/twin/main-ps3.c1
-rw-r--r--ui/twin/pbt-client.c1
-rw-r--r--ui/twin/pbt-main.c1
-rw-r--r--ui/twin/pbt-menu.c1
-rw-r--r--ui/twin/pbt-scr.c4
-rw-r--r--utils/pb-event.c1
33 files changed, 54 insertions, 44 deletions
diff --git a/configure.ac.in b/configure.ac.in
index 3374a9a..332c718 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -28,6 +28,7 @@ AC_PROG_YACC
AC_PROG_INSTALL
AM_INIT_AUTOMAKE
+AC_GNU_SOURCE
LT_INIT
AX_WITH_CURSES
diff --git a/discover/boot.c b/discover/boot.c
index 0d61f0e..e5803a7 100644
--- a/discover/boot.c
+++ b/discover/boot.c
@@ -1,5 +1,7 @@
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <stdbool.h>
#include <stdlib.h>
diff --git a/discover/event.c b/discover/event.c
index d4bb2c5..6434b40 100644
--- a/discover/event.c
+++ b/discover/event.c
@@ -2,7 +2,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <log/log.h>
diff --git a/discover/kboot-parser.c b/discover/kboot-parser.c
index 8572674..cebe787 100644
--- a/discover/kboot-parser.c
+++ b/discover/kboot-parser.c
@@ -1,4 +1,6 @@
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <assert.h>
#include <stdlib.h>
diff --git a/discover/parser-conf.c b/discover/parser-conf.c
index 79193ed..5f2b978 100644
--- a/discover/parser-conf.c
+++ b/discover/parser-conf.c
@@ -16,7 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <assert.h>
#include <ctype.h>
diff --git a/discover/paths.c b/discover/paths.c
index 64b218e..0c8cc8b 100644
--- a/discover/paths.c
+++ b/discover/paths.c
@@ -1,4 +1,6 @@
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <assert.h>
#include <string.h>
diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c
index 811679d..2fc261b 100644
--- a/discover/pxe-parser.c
+++ b/discover/pxe-parser.c
@@ -1,5 +1,7 @@
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <string.h>
#include <talloc/talloc.h>
diff --git a/discover/resource.c b/discover/resource.c
index f9019d1..04e14cb 100644
--- a/discover/resource.c
+++ b/discover/resource.c
@@ -1,5 +1,7 @@
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <assert.h>
#include <stdbool.h>
diff --git a/discover/udev.c b/discover/udev.c
index 305df95..09c24fd 100644
--- a/discover/udev.c
+++ b/discover/udev.c
@@ -1,5 +1,7 @@
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <assert.h>
#include <errno.h>
diff --git a/discover/user-event.c b/discover/user-event.c
index d7e0d19..69e6f7d 100644
--- a/discover/user-event.c
+++ b/discover/user-event.c
@@ -20,7 +20,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <errno.h>
#include <string.h>
diff --git a/discover/yaboot-parser.c b/discover/yaboot-parser.c
index f16ac72..41f43eb 100644
--- a/discover/yaboot-parser.c
+++ b/discover/yaboot-parser.c
@@ -1,4 +1,6 @@
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <assert.h>
#include <stdlib.h>
diff --git a/lib/url/url.c b/lib/url/url.c
index 700f87c..7202f49 100644
--- a/lib/url/url.c
+++ b/lib/url/url.c
@@ -20,7 +20,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <string.h>
diff --git a/test/lib/list-test.c b/test/lib/list-test.c
index 3f7952a..144613d 100644
--- a/test/lib/list-test.c
+++ b/test/lib/list-test.c
@@ -19,8 +19,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
-
#include <stdio.h>
#include <stdlib.h>
diff --git a/ui/common/joystick.c b/ui/common/joystick.c
index 4faf8b6..455ff19 100644
--- a/ui/common/joystick.c
+++ b/ui/common/joystick.c
@@ -20,7 +20,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/ui/common/ps3.c b/ui/common/ps3.c
index d3ca6d6..c9b97b5 100644
--- a/ui/common/ps3.c
+++ b/ui/common/ps3.c
@@ -16,7 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <assert.h>
#include <errno.h>
diff --git a/ui/common/timer.c b/ui/common/timer.c
index 3c1e833..3d80898 100644
--- a/ui/common/timer.c
+++ b/ui/common/timer.c
@@ -20,7 +20,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <limits.h>
#include <unistd.h>
diff --git a/ui/common/ui-system.c b/ui/common/ui-system.c
index 9ab8dec..7e04801 100644
--- a/ui/common/ui-system.c
+++ b/ui/common/ui-system.c
@@ -16,7 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <assert.h>
#include <errno.h>
diff --git a/ui/ncurses/generic-main.c b/ui/ncurses/generic-main.c
index feff506..aa5c2a5 100644
--- a/ui/ncurses/generic-main.c
+++ b/ui/ncurses/generic-main.c
@@ -18,9 +18,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#if defined(HAVE_CONFIG_H)
#include "config.h"
-
-#define _GNU_SOURCE
+#endif
#include <assert.h>
#include <errno.h>
diff --git a/ui/ncurses/nc-boot-editor.c b/ui/ncurses/nc-boot-editor.c
index 57cc0dc..90bd003 100644
--- a/ui/ncurses/nc-boot-editor.c
+++ b/ui/ncurses/nc-boot-editor.c
@@ -16,9 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#if defined(HAVE_CONFIG_H)
#include "config.h"
-
-#define _GNU_SOURCE
+#endif
#include <assert.h>
#include <string.h>
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c
index 6c25260..0b42e4c 100644
--- a/ui/ncurses/nc-config.c
+++ b/ui/ncurses/nc-config.c
@@ -15,7 +15,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <errno.h>
#include <stdlib.h>
@@ -26,7 +28,6 @@
#include <types/types.h>
#include <log/log.h>
-#include "config.h"
#include "nc-cui.h"
#include "nc-config.h"
#include "nc-widgets.h"
diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c
index 9427e4a..e342273 100644
--- a/ui/ncurses/nc-cui.c
+++ b/ui/ncurses/nc-cui.c
@@ -16,9 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#if defined(HAVE_CONFIG_H)
#include "config.h"
-
-#define _GNU_SOURCE
+#endif
#include <assert.h>
#include <errno.h>
diff --git a/ui/ncurses/nc-menu.c b/ui/ncurses/nc-menu.c
index eb7cfdf..d2048e1 100644
--- a/ui/ncurses/nc-menu.c
+++ b/ui/ncurses/nc-menu.c
@@ -16,9 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#if defined(HAVE_CONFIG_H)
#include "config.h"
-
-#define _GNU_SOURCE
+#endif
#include <assert.h>
#include <errno.h>
diff --git a/ui/ncurses/nc-scr.c b/ui/ncurses/nc-scr.c
index 9ad356f..41e35de 100644
--- a/ui/ncurses/nc-scr.c
+++ b/ui/ncurses/nc-scr.c
@@ -16,9 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#if defined(HAVE_CONFIG_H)
#include "config.h"
-
-#define _GNU_SOURCE
+#endif
#include <assert.h>
#include <stdarg.h>
diff --git a/ui/ncurses/nc-sysinfo.c b/ui/ncurses/nc-sysinfo.c
index fb1954f..1a3d3f5 100644
--- a/ui/ncurses/nc-sysinfo.c
+++ b/ui/ncurses/nc-sysinfo.c
@@ -15,8 +15,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define _GNU_SOURCE
-
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <string.h>
@@ -25,7 +26,6 @@
#include <log/log.h>
#include <util/util.h>
-#include "config.h"
#include "nc-cui.h"
#include "nc-sysinfo.h"
diff --git a/ui/ncurses/nc-widgets.c b/ui/ncurses/nc-widgets.c
index a6773cd..60f9100 100644
--- a/ui/ncurses/nc-widgets.c
+++ b/ui/ncurses/nc-widgets.c
@@ -15,9 +15,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define _GNU_SOURCE
-
+#if defined(HAVE_CONFIG_H)
#include "config.h"
+#endif
#include <linux/input.h> /* This must be included before ncurses.h */
#if defined HAVE_NCURSESW_CURSES_H
@@ -52,7 +52,6 @@
#include <log/log.h>
#include <util/util.h>
-#include "config.h"
#include "nc-cui.h"
#include "nc-widgets.h"
diff --git a/ui/ncurses/ps3-main.c b/ui/ncurses/ps3-main.c
index 1269549..7bded78 100644
--- a/ui/ncurses/ps3-main.c
+++ b/ui/ncurses/ps3-main.c
@@ -24,9 +24,9 @@
* ncurses mouse support
*/
+#if defined(HAVE_CONFIG_H)
#include "config.h"
-
-#define _GNU_SOURCE
+#endif
#include <assert.h>
#include <errno.h>
diff --git a/ui/twin/main-generic.c b/ui/twin/main-generic.c
index 2301e31..8ddec9e 100644
--- a/ui/twin/main-generic.c
+++ b/ui/twin/main-generic.c
@@ -21,7 +21,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <errno.h>
#include <getopt.h>
diff --git a/ui/twin/main-ps3.c b/ui/twin/main-ps3.c
index 138cd28..ba4b1d7 100644
--- a/ui/twin/main-ps3.c
+++ b/ui/twin/main-ps3.c
@@ -21,7 +21,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <errno.h>
#include <getopt.h>
diff --git a/ui/twin/pbt-client.c b/ui/twin/pbt-client.c
index 21ed524..a4ad0e9 100644
--- a/ui/twin/pbt-client.c
+++ b/ui/twin/pbt-client.c
@@ -19,7 +19,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <string.h>
diff --git a/ui/twin/pbt-main.c b/ui/twin/pbt-main.c
index 542f949..cf54662 100644
--- a/ui/twin/pbt-main.c
+++ b/ui/twin/pbt-main.c
@@ -19,7 +19,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <getopt.h>
diff --git a/ui/twin/pbt-menu.c b/ui/twin/pbt-menu.c
index 844b1e1..65651ca 100644
--- a/ui/twin/pbt-menu.c
+++ b/ui/twin/pbt-menu.c
@@ -19,7 +19,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <string.h>
#include <linux/input.h>
diff --git a/ui/twin/pbt-scr.c b/ui/twin/pbt-scr.c
index 79f6792..b774f19 100644
--- a/ui/twin/pbt-scr.c
+++ b/ui/twin/pbt-scr.c
@@ -15,8 +15,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#if defined(HAVE_CONFIG_H)
#include "config.h"
-#define _GNU_SOURCE
+#endif
+
#include <assert.h>
#include <string.h>
diff --git a/utils/pb-event.c b/utils/pb-event.c
index 4a16719..a1affe5 100644
--- a/utils/pb-event.c
+++ b/utils/pb-event.c
@@ -20,7 +20,6 @@
#include "config.h"
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <err.h>
#include <errno.h>
OpenPOWER on IntegriCloud