]> git.ozlabs.org Git - petitboot/commitdiff
configure: Use AC_GNU_SOURCE
authorJeremy Kerr <jk@ozlabs.org>
Mon, 16 Dec 2013 08:21:50 +0000 (16:21 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Wed, 18 Dec 2013 02:19:21 +0000 (10:19 +0800)
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>
33 files changed:
configure.ac.in
discover/boot.c
discover/event.c
discover/kboot-parser.c
discover/parser-conf.c
discover/paths.c
discover/pxe-parser.c
discover/resource.c
discover/udev.c
discover/user-event.c
discover/yaboot-parser.c
lib/url/url.c
test/lib/list-test.c
ui/common/joystick.c
ui/common/ps3.c
ui/common/timer.c
ui/common/ui-system.c
ui/ncurses/generic-main.c
ui/ncurses/nc-boot-editor.c
ui/ncurses/nc-config.c
ui/ncurses/nc-cui.c
ui/ncurses/nc-menu.c
ui/ncurses/nc-scr.c
ui/ncurses/nc-sysinfo.c
ui/ncurses/nc-widgets.c
ui/ncurses/ps3-main.c
ui/twin/main-generic.c
ui/twin/main-ps3.c
ui/twin/pbt-client.c
ui/twin/pbt-main.c
ui/twin/pbt-menu.c
ui/twin/pbt-scr.c
utils/pb-event.c

index 3374a9a945989bb503c0a8a9eedbb850d64d952c..332c7189d070577421a3eed94a0dd3fd8f418045 100644 (file)
@@ -28,6 +28,7 @@ AC_PROG_YACC
 AC_PROG_INSTALL
 
 AM_INIT_AUTOMAKE
+AC_GNU_SOURCE
 LT_INIT
 
 AX_WITH_CURSES
index 0d61f0efc785295852c659914461bd656e4865fe..e5803a76dcf0fbc228f2c426b19c415c28d382ef 100644 (file)
@@ -1,5 +1,7 @@
 
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
 
 #include <stdbool.h>
 #include <stdlib.h>
index d4bb2c5dbcaeb9de78ee5caf50b0bc61bd80a0e1..6434b40d39cd944c90cd93ab8681617b3b721ba6 100644 (file)
@@ -2,7 +2,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <string.h>
 
 #include <log/log.h>
index 8572674b982a94f1b49395cb3d504cf67f3f3879..cebe787fddb44d5c480461f4f91c38e207e992a5 100644 (file)
@@ -1,4 +1,6 @@
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
 
 #include <assert.h>
 #include <stdlib.h>
index 79193ed76622397e2517e59683b6aa11a1ac82fd..5f2b9787303d3102033662f08cf2477c23a78b60 100644 (file)
@@ -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>
index 64b218e820d2f06ec508584a7b4a2fddea0fc5b6..0c8cc8b0d4c1a84596c66ab1f27073cff5446435 100644 (file)
@@ -1,4 +1,6 @@
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
 
 #include <assert.h>
 #include <string.h>
index 811679dd2a95f7c9478e0f560b72ef25c61dbc08..2fc261ba9a9089bf3a7841bf10077842829d2acc 100644 (file)
@@ -1,5 +1,7 @@
 
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
 #include <string.h>
 
 #include <talloc/talloc.h>
index f9019d1408eed5556b100140bd9c86437858e7b4..04e14cb42c634567a5d99f3cbab226d5055139d0 100644 (file)
@@ -1,5 +1,7 @@
 
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
 
 #include <assert.h>
 #include <stdbool.h>
index 305df95f4f4dd71f0783eb0755a76cc298a212f9..09c24fdf5912791e67fc093878a2918abc32e27b 100644 (file)
@@ -1,5 +1,7 @@
 
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
 
 #include <assert.h>
 #include <errno.h>
index d7e0d195035efa43202137de78d57bfb78fd3da8..69e6f7df1eb442aef7f9fb92216d1161744b272e 100644 (file)
@@ -20,7 +20,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <errno.h>
 #include <string.h>
index f16ac723ff4b7a7f672616d9bd7c96efd9eadb1a..41f43eb614186926ad38dd8bebe1f3b2f6f958d8 100644 (file)
@@ -1,4 +1,6 @@
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
 
 #include <assert.h>
 #include <stdlib.h>
index 700f87cd936ed0d184cb75312f6cacac0c1739bf..7202f4965414be300cd9e1c5cb0ee8ea68c3c29b 100644 (file)
@@ -20,7 +20,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <string.h>
 
index 3f7952ab888d10178256b3529a35cc01352b6f2b..144613da7d06a1da673091bba1c9ae27cebe649b 100644 (file)
@@ -19,8 +19,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
-
 #include <stdio.h>
 #include <stdlib.h>
 
index 4faf8b6248ab09ee1d1bac901d4efa7cb068de2e..455ff19b9d759c2f536b0d8c73ff873f3622e19d 100644 (file)
@@ -20,7 +20,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
index d3ca6d606872e9f60f167897428aad1886223543..c9b97b5d2ca9da734b8b934c5113cc7c5ae59e18 100644 (file)
@@ -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>
index 3c1e8331233b45e8016dd9faa2b8d8a0aaa976f1..3d808987e3cc76d6f170406f50153089840f76a2 100644 (file)
@@ -20,7 +20,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <limits.h>
 #include <unistd.h>
index 9ab8dec0dfa36c264cea94dcd0fae36b4fb4a1c8..7e04801edf9a96a8e146ad050074e32256779707 100644 (file)
@@ -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>
index feff506cd67e8d8e1c36e45a03c10b60a213bca9..aa5c2a59093bf669290e47b447bcd24135057883 100644 (file)
@@ -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>
index 57cc0dc1cfac4eb6bfd3761123f4962f3f8a5238..90bd0037fca9f65c662c1d91e6f6afec983e000f 100644 (file)
@@ -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>
index 6c252602a1a58ce16c493de5c624b378719f8615..0b42e4c971d09576afd101899d22d07a46537590 100644 (file)
@@ -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"
index 9427e4a40dad1d97b06dc8c9a52ac8e6b65e07f6..e3422734ebd06d83ec30415b8012c89beb54435a 100644 (file)
@@ -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>
index eb7cfdff0d942562333a664dfe145b4555e03e6b..d2048e1c3561591bd615a82fcb57ef58b36e27b0 100644 (file)
@@ -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>
index 9ad356fa179e17ae60300540210831eca55c3a3f..41e35de849381a568cfb6b4f04ecfd862f23d8a4 100644 (file)
@@ -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>
index fb1954f44f0fc7d2ce498764a665e419089c9cf7..1a3d3f5227b0c704ec8e140b70573c616ba4afd0 100644 (file)
@@ -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"
 
index a6773cd39d34496b620c0e43953482b672b62cf9..60f91007ce94f280be21d01f59503cdfb3868d09 100644 (file)
@@ -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"
 
index 1269549b7f8ac13a5dbff83b581d2d64a74f8ef2..7bded787c4428b643e54e17bccd1aea957be97b9 100644 (file)
@@ -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>
index 2301e31c3cbaa6dfe4201ca33d932858563f0480..8ddec9ef2cd790044754196508114d08bf919e4b 100644 (file)
@@ -21,7 +21,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <errno.h>
 #include <getopt.h>
index 138cd28f74f6eb2aaccfbb20f591f57f5a5447a0..ba4b1d7b851afdfa79b08df0d04137769bd06511 100644 (file)
@@ -21,7 +21,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <errno.h>
 #include <getopt.h>
index 21ed52441bfddf6dc368d7779d89332e9c6d3931..a4ad0e926f35155f4e2557a62a6f3138d9a304ed 100644 (file)
@@ -19,7 +19,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <string.h>
 
index 542f9497a8c07f45e4d1c8b283200c3b5d276bfc..cf546625090f8305e43fd777c42cbec2cfe45fe8 100644 (file)
@@ -19,7 +19,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <getopt.h>
 
index 844b1e14753c6d61292066a102748c4048942f30..65651ca827cef5b5c8b2377cb57646d1aeab0d35 100644 (file)
@@ -19,7 +19,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <string.h>
 #include <linux/input.h>
index 79f6792e346d33d1ff6c786fffd11a400aa9cd0e..b774f194693932572f7d1e23db9ebc7cb306f05e 100644 (file)
  *  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>
index 4a167192c7a99c34a172b7a9240e8b1dfbd9d37e..a1affe5243cc4bf270bef92b87fb7595fb97b3d5 100644 (file)
@@ -20,7 +20,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <err.h>
 #include <errno.h>