From: Dave Hart Date: Wed, 15 Apr 2009 11:21:07 +0000 (+0000) Subject: configure.ac: X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a9830b23f464e606b0fe9a49ae2e69e1bf3fd09;p=thirdparty%2Fntp.git configure.ac: choosing compilers: use C99 if available, warn if C89 is not bk: 49e5c3238CjuBxBMlgg1rhBXuUI-QQ --- diff --git a/configure.ac b/configure.ac index d90e4ab59e..13ac76831c 100644 --- a/configure.ac +++ b/configure.ac @@ -30,16 +30,26 @@ AC_DISABLE_SHARED dnl we need to check for cross compile tools for vxWorks here AC_PROG_CC -AC_PROG_CC_STDC -dnl AC_PROG_CC_C89 -# We should make sure CC is *some* version of ANSI. # Ralf Wildenhues: With per-target flags we need CC_C_O # AM_PROG_CC_C_O supersets AC_PROG_CC_C_O AM_PROG_CC_C_O -AC_PROG_CC_STDC AC_PROG_CPP AC_PROG_YACC +# AC_PROG_CC_STDC has two functions. It attempts to find a compiler +# capable of C99, or failing that, for C89. CC is set afterward with +# the selected invocation, such as "gcc --std=gnu99". Also, the +# ac_cv_prog_cc_stdc variable is no if the compiler selected for CC +# does not accept C89. + +AC_PROG_CC_STDC + +case "$ac_cv_prog_cc_stdc" in + no) + AC_MSG_WARN([ANSI C89/ISO C90 is the minimum to compile NTP ] + [version 4.2.5 and higher.]) +esac + # HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS case "$host" in *-*-amigaos) @@ -260,7 +270,7 @@ case "$GCC" in CFLAGS="$CFLAGS -Winit-self" case "$ac_cv_gcc_Wstrict_overflow" in yes) - #not yet: CFLAGS="$CFLAGS -Wstrict-overflow" + #not yet: CFLAGS="$CFLAGS -Wstrict-overflow" esac ;; esac @@ -4195,8 +4205,8 @@ AC_MSG_CHECKING([if we want support for Samba's signing daemon]) AC_ARG_ENABLE( [ntp-signd], AC_HELP_STRING( - [--enable-ntp-signd], - [- Provide support for Samba's signing daemon, =/var/run/ntp_signd] + [--enable-ntp-signd], + [- Provide support for Samba's signing daemon, =/var/run/ntp_signd] ), [ans=$enableval], [ans=no] @@ -4235,8 +4245,8 @@ unset wintime_default AC_ARG_ENABLE( [wintime], AC_HELP_STRING( - [--enable-wintime], - [- Provide the windows symmetric client hack] + [--enable-wintime], + [- Serve broken old w32time clients abusing symmetric mode] ), [ans=$enableval], ) diff --git a/gsoc_sntp/configure.ac b/gsoc_sntp/configure.ac index e080ec1d75..302441e037 100644 --- a/gsoc_sntp/configure.ac +++ b/gsoc_sntp/configure.ac @@ -14,6 +14,20 @@ AC_PREREQ([2.53]) # Checks for programs. AC_PROG_CC +# AC_PROG_CC_STDC has two functions. It attempts to find a compiler +# capable of C99, or failing that, for C89. CC is set afterward with +# the selected invocation, such as "gcc --std=gnu99". Also, the +# ac_cv_prog_cc_stdc variable is no if the compiler selected for CC +# does not accept C89. + +AC_PROG_CC_STDC + +case "$ac_cv_prog_cc_stdc" in + no) + AC_MSG_WARN([ANSI C89/ISO C90 is the minimum to compile SNTP ] + [version 4.2.5 and higher.]) +esac + case "$GCC" in yes) SAVED_CFLAGS_AC="$CFLAGS" @@ -31,10 +45,7 @@ case "$GCC" in ) CFLAGS="$SAVED_CFLAGS_AC" SAVED_CFLAGS_AC= -esac -case "$GCC" in - yes) CFLAGS="$CFLAGS -Wall" # CFLAGS="$CFLAGS -Wcast-align" CFLAGS="$CFLAGS -Wcast-qual" @@ -50,7 +61,7 @@ case "$GCC" in # CFLAGS="$CFLAGS -Wwrite-strings" case "$ac_cv_gcc_Wstrict_overflow" in yes) - #not yet#CFLAGS="$CFLAGS -Wstrict-overflow" + #not yet#CFLAGS="$CFLAGS -Wstrict-overflow" esac esac