]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Use NO_OPTION_NAME_WARNINGS if cc does not support #warning
authorHarlan Stenn <stenn@ntp.org>
Tue, 10 Oct 2006 06:27:12 +0000 (02:27 -0400)
committerHarlan Stenn <stenn@ntp.org>
Tue, 10 Oct 2006 06:27:12 +0000 (02:27 -0400)
bk: 452b3d40Tz2bzh9_F0_pVXspKV_Ywg

configure.ac
sntp/configure.ac

index 6a6496a8840e8a1ac02b1c05c188cf088b6060d0..7f11a85103299d1c864f0348ce474e367e19350d 100644 (file)
@@ -69,6 +69,17 @@ AMU_OS_CFLAGS
 
 LIBOPTS_CHECK(libopts)
 
+AC_MSG_CHECKING([[if $CC can handle #warning]])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#warning foo]])],[ac_cv_cpp_warning=yes],[ac_cv_cpp_warning=no])
+AC_MSG_RESULT([$ac_cv_cpp_warning])
+
+case "$ac_cv_cpp_warning" in
+ no)
+    AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1], [Should we avoid #warning on option name collisions?])
+    AC_MSG_RESULT([[Enabling NO_OPTION_NAME_WARNINGS as #warning does not work]])
+    ;;
+esac
+
 AC_MSG_CHECKING(for bin subdirectory)
 AC_ARG_WITH(binsubdir,
        AC_HELP_STRING([--with-binsubdir], [bin ={bin,sbin}]),
index 619cdf7c63f68df045c7e81844069c07d8b928eb..718fbef19862b1eae5f2fd1e21505749d1f5d1e4 100644 (file)
@@ -11,6 +11,17 @@ AC_PROG_LIBTOOL
 
 LIBOPTS_CHECK
 
+AC_MSG_CHECKING([[if $CC can handle #warning]])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#warning foo]])],[ac_cv_cpp_warning=yes],[ac_cv_cpp_warning=no])
+AC_MSG_RESULT([$ac_cv_cpp_warning])
+
+case "$ac_cv_cpp_warning" in
+ no)
+    AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1], [Should we avoid #warning on option name collisions?])
+    AC_MSG_RESULT([[Enabling NO_OPTION_NAME_WARNINGS as #warning does not work]])
+    ;;
+esac
+
 # Checks for libraries.
 
 # Checks for header files.