]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2170] Use AC_PREPROC_IFELSE instead of AC_EGREP_CPP
authorHarlan Stenn <stenn@ntp.org>
Mon, 3 Mar 2014 09:53:09 +0000 (09:53 +0000)
committerHarlan Stenn <stenn@ntp.org>
Mon, 3 Mar 2014 09:53:09 +0000 (09:53 +0000)
bk: 53145105CJcfxFY-1b9amEjMtJVWdw

ChangeLog
configure.ac
sntp/m4/ntp_libntp.m4

index 6ccdf0bc87ba6e2c5e86b740b7787eb470e14bc5..879a23e2f86c527d7a8d3d61b128d855af18817b 100644 (file)
--- 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.
index 38947617975ded068db3a6ff106f0f90f0ed3af2..91c0318bf60997668720bdff71451984d18ac77d 100644 (file)
@@ -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 <sys/syscall.h>
-                   
-                   #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 <sys/timex.h>
-
-           #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 <termios.h>
-
-           #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 <termios.h>
-
-           #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 <sys/ppsclock.h>
-
-           #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 <sys/time.h>
            typedef int u_int;
            #include <sys/ppsclock.h>
            #include <linux/serial.h>
 
-           #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 <sys/param.h>
            #include <sys/sysctl.h>
            #include <sys/socket.h>
-           #ifdef NET_RT_IFLIST  
-               found_rt_iflist
+           #ifndef NET_RT_IFLIST
+           # error
            #endif
        ],
        [ntp_cv_iflist_sysctl=yes],
index 542d0120d2edc703808e430b8a716ff37f7ba8fe..13a621d1ceb77e6fda29f38a93b4706c6ebe45bb 100644 (file)
@@ -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 <signal.h>
 
-           #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 <signal.h>
            
-           #ifdef SIGPOLL
-               yes
+           #ifndef SIGPOLL
+           # error
            #endif
        ],
        [ntp_cv_hdr_def_sigpoll=yes],