[minicoredumper] [PATCH 4/8] buildsystem: let the autotools detect extensions like _GNU_SOURCE

Juergen Borleis jbe at pengutronix.de
Mon Mar 11 11:23:14 CET 2019


>From the autoconf doc:

"If possible, enable extensions to C or Posix on hosts that normally
disable the extensions, [...]"

Note: requires the use of config.h in each source file in order to make it
work.

Signed-off-by: Juergen Borleis <jbe at pengutronix.de>
---
 configure.ac | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index d79fbec..f23724b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,8 @@ AC_CANONICAL_HOST
 AC_CANONICAL_BUILD
 AC_LANG([C])
 
+AC_USE_SYSTEM_EXTENSIONS
+
 AC_PROG_CC_C99
 AM_PROG_CC_C_O
 AC_PROG_INSTALL
@@ -33,7 +35,6 @@ AC_SYS_LARGEFILE
 
 LT_INIT
 
-AC_DEFINE([_GNU_SOURCE], [], [GNU SOURCE])
 
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
@@ -149,7 +150,7 @@ AC_ARG_VAR([MCD_REGD_USER_GROUP],
 AS_IF([test "x$MCD_REGD_USER_GROUP" = x],
       [MCD_REGD_USER_GROUP="root:root"], [])
 
-MCD_CPPFLAGS="-Wall -D_GNU_SOURCE $MCD_WERROR"
+MCD_CPPFLAGS="-Wall $MCD_WERROR"
 AC_SUBST([MCD_CPPFLAGS])
 
 init_ddir="${sysconfdir}/init.d"
-- 
2.11.0




More information about the minicoredumper mailing list