From: Todd C. Miller Date: Sat, 5 Feb 2005 14:57:44 +0000 (+0000) Subject: Move _FOO_SOURCE to CPPFLAGS so it takes effect as early as possible. X-Git-Tag: SUDO_1_7_0~730 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e166c1b11dee09a2e34396bae82742b7f75ea114;p=sudo Move _FOO_SOURCE to CPPFLAGS so it takes effect as early as possible. Silences a warning about isblank() on linux. --- diff --git a/config.h.in b/config.h.in index 2e0ef5c97..5127192e5 100644 --- a/config.h.in +++ b/config.h.in @@ -537,21 +537,6 @@ /* Define to avoid using the passwd/shadow file for authentication. */ #undef WITHOUT_PASSWD -/* Enable non-POSIX extensions on AIX. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - -/* Enable non-POSIX extensions on ConvexOS. */ -#ifndef _CONVEX_SOURCE -# undef _CONVEX_SOURCE -#endif - -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# define _GNU_SOURCE 1 -#endif - /* Define to empty if `const' does not conform to ANSI C. */ #undef const diff --git a/configure b/configure index b15329644..3abc50b2b 100755 --- a/configure +++ b/configure @@ -20469,11 +20469,7 @@ done ;; *-*-aix*) # To get all prototypes (so we pass -Wall) - CPPFLAGS="${CPPFLAGS} -D_XOPEN_EXTENDED_SOURCE" - cat >>confdefs.h <<\EOF -#define _ALL_SOURCE 1 -EOF - + CPPFLAGS="${CPPFLAGS} -D_XOPEN_EXTENDED_SOURCE -D_ALL_SOURCE" SUDO_LDFLAGS="${SUDO_LDFLAGS} -Wl,-bI:\$(srcdir)/aixcrypt.exp" if test X"$with_blibpath" != X"no"; then echo "$as_me:$LINENO: checking if linker accepts -Wl,-blibpath" >&5 @@ -21913,6 +21909,7 @@ fi : ${mansectform='4'} ;; *-*-linux*) + CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" # Some Linux versions need to link with -lshadow if test "$CHECKSHADOW" = "true"; then @@ -22094,10 +22091,7 @@ done : ${with_pam='maybe'} ;; *-convex-bsd*) - cat >>confdefs.h <<\EOF -#define _CONVEX_SOURCE 1 -EOF - + CPPFLAGS="${CPPFLAGS} -D_CONVEX_SOURCE" if test -z "$GCC"; then CFLAGS="${CFLAGS} -D__STDC__" fi @@ -22855,6 +22849,9 @@ done : ${mansectsu='1m'} : ${mansectform='4'} ;; + *-gnu*) + CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" + ;; esac : ${mansectsu='8'} @@ -33824,15 +33821,6 @@ fi - - - - - - - - - diff --git a/configure.in b/configure.in index bb856460e..5a80e8fa3 100644 --- a/configure.in +++ b/configure.in @@ -1262,8 +1262,7 @@ case "$host" in ;; *-*-aix*) # To get all prototypes (so we pass -Wall) - CPPFLAGS="${CPPFLAGS} -D_XOPEN_EXTENDED_SOURCE" - SUDO_DEFINE(_ALL_SOURCE) + CPPFLAGS="${CPPFLAGS} -D_XOPEN_EXTENDED_SOURCE -D_ALL_SOURCE" SUDO_LDFLAGS="${SUDO_LDFLAGS} -Wl,-bI:\$(srcdir)/aixcrypt.exp" if test X"$with_blibpath" != X"no"; then AC_MSG_CHECKING([if linker accepts -Wl,-blibpath]) @@ -1428,6 +1427,7 @@ case "$host" in : ${mansectform='4'} ;; *-*-linux*) + CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" # Some Linux versions need to link with -lshadow if test "$CHECKSHADOW" = "true"; then AC_CHECK_FUNCS(getspnam, , [AC_CHECK_LIB(shadow, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lshadow"; LIBS="${LIBS} -lshadow"])]) @@ -1436,7 +1436,7 @@ case "$host" in : ${with_pam='maybe'} ;; *-convex-bsd*) - SUDO_DEFINE(_CONVEX_SOURCE) + CPPFLAGS="${CPPFLAGS} -D_CONVEX_SOURCE" if test -z "$GCC"; then CFLAGS="${CFLAGS} -D__STDC__" fi @@ -1603,6 +1603,9 @@ case "$host" in : ${mansectsu='1m'} : ${mansectform='4'} ;; + *-gnu*) + CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" + ;; esac dnl @@ -2399,24 +2402,6 @@ AH_TEMPLATE(sig_atomic_t, [Define to `int' if does not define.]) dnl dnl Bits to copy verbatim into config.h.in dnl -AH_VERBATIM([_GNU_SOURCE], -[/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# define _GNU_SOURCE 1 -#endif]) - -AH_VERBATIM([_ALL_SOURCE], -[/* Enable non-POSIX extensions on AIX. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif]) - -AH_VERBATIM([_CONVEX_SOURCE], -[/* Enable non-POSIX extensions on ConvexOS. */ -#ifndef _CONVEX_SOURCE -# undef _CONVEX_SOURCE -#endif]) - AH_TOP([#ifndef _SUDO_CONFIG_H #define _SUDO_CONFIG_H])