From: Alan T. DeKok Date: Fri, 6 May 2011 14:49:32 +0000 (+0200) Subject: Define _GNU_SOURCE before checking for structures X-Git-Tag: release_2_1_11~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=655f0786d60fe02440763df69b1aaf5110706690;p=thirdparty%2Ffreeradius-server.git Define _GNU_SOURCE before checking for structures On Linux, useful features that are industry standard are "protected" by requiring -D_GNU_SOURCE. Why would you want your users to *use* the features of libc? --- diff --git a/configure b/configure index 73e8732fdd2..1d316893ca7 100755 --- a/configure +++ b/configure @@ -3824,6 +3824,10 @@ else fi +if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE" +fi + # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then enableval=$enable_largefile; @@ -25114,10 +25118,6 @@ else fi -if test "x$GCC" = "xyes"; then - CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE" -fi - { echo "$as_me:$LINENO: checking for developer gcc flags" >&5 echo $ECHO_N "checking for developer gcc flags... $ECHO_C" >&6; } if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then diff --git a/configure.in b/configure.in index a12eb9fb518..d1d8e30bde9 100644 --- a/configure.in +++ b/configure.in @@ -52,6 +52,13 @@ AC_PROG_GCC_TRADITIONAL AC_PROG_CC_SUNPRO AC_PROG_RANLIB +dnl # +dnl # Set Default CFLAGS +dnl # +if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE" +fi + dnl Compile in large (2G+) file support. AC_SYS_LARGEFILE @@ -919,13 +926,6 @@ else fi AC_SUBST(LIBPREFIX) -dnl # -dnl # Set Default CFLAGS -dnl # -if test "x$GCC" = "xyes"; then - CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE" -fi - AC_MSG_CHECKING(for developer gcc flags) if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef"