]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
configure.ac:
authorDave Hart <hart@ntp.org>
Wed, 15 Apr 2009 11:21:07 +0000 (11:21 +0000)
committerDave Hart <hart@ntp.org>
Wed, 15 Apr 2009 11:21:07 +0000 (11:21 +0000)
  choosing compilers: use C99 if available, warn if C89 is not

bk: 49e5c3238CjuBxBMlgg1rhBXuUI-QQ

configure.ac
gsoc_sntp/configure.ac

index d90e4ab59eceeb8aabf01c508ccb1777ed509905..13ac76831cd33ae68cc6b8c860527b1937609636 100644 (file)
@@ -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],
 )
index e080ec1d754b9f895029f75819dfdc2338786b7b..302441e03764b9fc9dd27ce4b73b28781878845c 100644 (file)
@@ -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