From: Harlan Stenn Date: Tue, 10 Oct 2006 06:27:12 +0000 (-0400) Subject: Use NO_OPTION_NAME_WARNINGS if cc does not support #warning X-Git-Tag: NTP_4_2_3P54~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=852a702069e043b107e7fa3dbc51a9d462b1b625;p=thirdparty%2Fntp.git Use NO_OPTION_NAME_WARNINGS if cc does not support #warning bk: 452b3d40Tz2bzh9_F0_pVXspKV_Ywg --- diff --git a/configure.ac b/configure.ac index 6a6496a88..7f11a8510 100644 --- a/configure.ac +++ b/configure.ac @@ -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}]), diff --git a/sntp/configure.ac b/sntp/configure.ac index 619cdf7c6..718fbef19 100644 --- a/sntp/configure.ac +++ b/sntp/configure.ac @@ -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.