From: Harlan Stenn Date: Mon, 3 Mar 2014 09:53:09 +0000 (+0000) Subject: [Bug 2170] Use AC_PREPROC_IFELSE instead of AC_EGREP_CPP X-Git-Tag: NTP_4_2_7P429~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa4703763d3faf86132c7b0ea6007956ac8c7d0c;p=thirdparty%2Fntp.git [Bug 2170] Use AC_PREPROC_IFELSE instead of AC_EGREP_CPP bk: 53145105CJcfxFY-1b9amEjMtJVWdw --- diff --git a/ChangeLog b/ChangeLog index 6ccdf0bc8..879a23e2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ * CID 1165098: Remove logically dead code from refclock_true.c. * CID 1189401: Use INSIST() instead of a belt-and-suspenders pointer check. * In ntp_dir_sep.m4, we care about $host_os, not $target_os. +* [Bug 2170] Use AC_PREPROC_IFELSE instead of AC_EGREP_CPP. * [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups. * [Bug 2570] refuse to load leapsec file with bad/missing SHA1 hash -- change reading the hash line code: NIST omits leading zeros. diff --git a/configure.ac b/configure.ac index 389476179..91c0318bf 100644 --- a/configure.ac +++ b/configure.ac @@ -264,7 +264,7 @@ case "$host" in ;; esac ;; - *) + *) AC_CHECK_HEADERS([utmp.h utmpx.h]) ;; esac @@ -299,7 +299,7 @@ AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h sys/file.h]) case "$host" in *-*-sunos4*) ;; - *) + *) AC_CHECK_HEADERS([sys/ioctl.h]) ;; esac @@ -309,7 +309,7 @@ AC_CHECK_HEADERS([sys/modem.h sys/ppsclock.h sys/ppstime.h sched.h]) case "$ac_cv_header_sched_h" in yes) ;; - *) + *) AC_CHECK_HEADERS([sys/sched.h]) ;; esac @@ -319,7 +319,7 @@ AC_CHECK_HEADERS([sys/select.h sys/signal.h sys/sockio.h]) case "$host" in *-*-netbsd*) ;; - *) + *) AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h]) ;; esac @@ -1060,7 +1060,7 @@ AC_CACHE_CHECK( )] ) case "$ntp_cv_decl_h_errno" in - yes) + yes) AC_DEFINE([DECL_H_ERRNO], [1], [Declare h_errno?]) esac @@ -1284,7 +1284,7 @@ AC_CACHE_CHECK( *-*-darwin*) ans=yes ;; - *) + *) ans=no ;; esac @@ -1304,7 +1304,7 @@ AC_CACHE_CHECK( *-*-netbsd*) ans=yes ;; - *) + *) ans=no ;; esac @@ -1428,7 +1428,7 @@ AC_MSG_CHECKING([if ntpd will retry permanent DNS failures]) AC_ARG_ENABLE( [ignore-dns-errors], [AS_HELP_STRING( - [--enable-ignore-dns-errors], + [--enable-ignore-dns-errors], [- retry DNS queries on any error] )], [ans=$enableval], @@ -1453,14 +1453,12 @@ AC_CACHE_CHECK( *yes) ntp_cv_var_ntp_syscalls=inline ;; - *) - AC_EGREP_CPP( - [yes], + *) + AC_PREPROC_IFELSE( [ #include - - #if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime) - yes + #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime) + # error #endif ], [ntp_cv_var_ntp_syscalls=kernel] @@ -1483,13 +1481,11 @@ esac AC_CACHE_CHECK( [if sys/timex.h has STA_FLL], [ntp_cv_var_sta_fll], - [AC_EGREP_CPP( - [yes], + [AC_PREPROC_IFELSE( [ #include - - #ifdef STA_FLL - yes + #ifndef STA_FLL + # error #endif ], [ntp_cv_var_sta_fll=yes], @@ -1545,13 +1541,11 @@ esac AC_MSG_CHECKING([for TTY PPS ioctl TIOCGPPSEV]) case "$ac_cv_header_termios_h" in yes) - AC_EGREP_CPP( - [yes], + AC_PREPROC_IFELSE( [ #include - - #ifdef TIOCGPPSEV - yes + #ifndef TIOCGPPSEV + # error #endif ], [ntp_ok=yes], @@ -1573,13 +1567,11 @@ AC_MSG_RESULT([$ntp_ok]) AC_MSG_CHECKING([for TTY PPS ioctl TIOCSPPS]) case "$ac_cv_header_termios_h" in yes) - AC_EGREP_CPP( - [yes], + AC_PREPROC_IFELSE( [ #include - - #ifdef TIOCSPPS - yes + #ifndef TIOCSPPS + # error #endif ], [ntp_ok=yes], @@ -1601,13 +1593,11 @@ AC_MSG_RESULT([$ntp_ok]) AC_MSG_CHECKING([for TTY PPS ioctl CIOGETEV]) case "$ac_cv_header_sys_ppsclock_h" in yes) - AC_EGREP_CPP( - [yes], + AC_PREPROC_IFELSE( [ #include - - #ifdef CIOGETEV - yes + #ifndef CIOGETEV + # error #endif ], [ntp_ok=yes], @@ -1654,24 +1644,27 @@ AC_CHECK_HEADER([linux/serial.h]) case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in yesyes) AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG]) - AC_EGREP_CPP( - [yes], + AC_PREPROC_IFELSE( [ #include typedef int u_int; #include #include - #ifdef TIOCGSERIAL - #ifdef TIOCSSERIAL - #ifdef ASYNC_PPS_CD_POS - #ifdef ASYNC_PPS_CD_NEG - #ifdef CIOGETEV - yes + #ifndef TIOCGSERIAL + # error #endif + #ifndef TIOCSSERIAL + # error #endif + #ifndef ASYNC_PPS_CD_POS + # error #endif + #ifndef ASYNC_PPS_CD_NEG + # error #endif + #ifndef CIOGETEV + # error #endif ], [ntp_ok=yes], @@ -1713,7 +1706,7 @@ AC_MSG_CHECKING([Datum/Bancomm bc635/VME interface]) AC_ARG_ENABLE( [BANCOMM], [AS_HELP_STRING( - [--enable-BANCOMM], + [--enable-BANCOMM], [- Datum/Bancomm bc635/VME interface] )], [ntp_ok=$enableval], @@ -1827,7 +1820,7 @@ AC_CACHE_CHECK( ]], [[ int dtr = TIOCM_DTR; - + ioctl(1, TIOCMBIS, (char *)&dtr); ]] )], @@ -1885,7 +1878,7 @@ AC_MSG_CHECKING([Arcron MSF receiver]) AC_ARG_ENABLE( [ARCRON_MSF], [AS_HELP_STRING( - [--enable-ARCRON-MSF], + [--enable-ARCRON-MSF], [+ Arcron MSF receiver] )], [ntp_ok=$enableval], @@ -3167,7 +3160,7 @@ case "$ans" in yes) can_kmem=yes ;; - *) + *) can_kmem=no AC_DEFINE([NOKMEM], [1], [Should we NOT read /dev/kmem?]) esac @@ -3215,7 +3208,7 @@ esac AC_ARG_ENABLE( [accurate-adjtime], [AS_HELP_STRING( - [--enable-accurate-adjtime], + [--enable-accurate-adjtime], [s the adjtime() call is accurate] )], [ans=$enableval] @@ -3224,7 +3217,7 @@ AC_ARG_ENABLE( AC_MSG_RESULT([$ans]) case "$ans" in - yes) + yes) AC_DEFINE([ADJTIME_IS_ACCURATE], [1], [Is adjtime() accurate?]) adjtime_is_accurate=yes ;; @@ -3274,7 +3267,7 @@ AC_CACHE_CHECK( case "$ntp_cv_nlist_tick" in ''|no) ;; # HMS: I think we can only get 'no' here... - *) + *) AC_DEFINE_UNQUOTED([K_TICK_NAME], ["$ntp_cv_nlist_tick"], [What is the name of TICK in the kernel?]) esac @@ -3346,7 +3339,7 @@ AC_CACHE_CHECK( case "$ntp_cv_nlist_tickadj" in ''|no) ;; # HMS: I think we can only get 'no' here... - *) + *) AC_DEFINE_UNQUOTED([K_TICKADJ_NAME], ["$ntp_cv_nlist_tickadj"], [What is the name of TICKADJ in the kernel?]) esac @@ -3474,7 +3467,7 @@ esac dnl The tick/tickadj sections were written by Skippy, who never learned dnl that it's impolite (horridly gross) to show your guts in public. -dnl tick tickadj +dnl tick tickadj dnl 10000 80 Unixware dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE dnl 10000 150 sgi IRIX @@ -3776,7 +3769,7 @@ AC_ARG_ENABLE( [--enable-simulator], [- build/install the NTPD simulator?] )], - [ans=$enableval], + [ans=$enableval], [ans=no] ) AC_MSG_RESULT([$ans]) @@ -4053,7 +4046,7 @@ case "$host" in ans=yes fi ;; - *) + *) ans=yes ;; esac @@ -4133,7 +4126,7 @@ case "$host" in esac AC_ARG_ENABLE( - [irig-sawtooth], + [irig-sawtooth], [AS_HELP_STRING( [--enable-irig-sawtooth], [s if we should enable the IRIG sawtooth filter] @@ -4152,7 +4145,7 @@ esac AC_MSG_CHECKING([if we should enable NIST lockclock scheme]) AC_ARG_ENABLE( - [nist], + [nist], [AS_HELP_STRING( [--enable-nist], [- if we should enable the NIST lockclock scheme] @@ -4222,14 +4215,13 @@ NTP_IPV6 AC_CACHE_CHECK( [for interface list sysctl], [ntp_cv_iflist_sysctl], - [AC_EGREP_CPP( - [found_rt_iflist], + [AC_PREPROC_IFELSE( [ #include #include #include - #ifdef NET_RT_IFLIST - found_rt_iflist + #ifndef NET_RT_IFLIST + # error #endif ], [ntp_cv_iflist_sysctl=yes], diff --git a/sntp/m4/ntp_libntp.m4 b/sntp/m4/ntp_libntp.m4 index 542d0120d..13a621d1c 100644 --- a/sntp/m4/ntp_libntp.m4 +++ b/sntp/m4/ntp_libntp.m4 @@ -871,13 +871,12 @@ AC_CHECK_FUNCS([MD5Init sysconf getdtablesize sigaction sigset sigvec]) AC_CACHE_CHECK( [for SIGIO], [ntp_cv_hdr_def_sigio], - [AC_EGREP_CPP( - [yes], + [AC_PREPROC_IFELSE( [ #include - #ifdef SIGIO - yes + #ifndef SIGIO + # error #endif ], [ntp_cv_hdr_def_sigio=yes], @@ -941,13 +940,12 @@ AC_MSG_RESULT([$ans]) AC_CACHE_CHECK( [for SIGPOLL], [ntp_cv_hdr_def_sigpoll], - [AC_EGREP_CPP( - [yes], + [AC_PREPROC_IFELSE( [ #include - #ifdef SIGPOLL - yes + #ifndef SIGPOLL + # error #endif ], [ntp_cv_hdr_def_sigpoll=yes],