]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Check for timepps.h also in sys directory
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 1 Sep 2011 15:06:54 +0000 (17:06 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 1 Sep 2011 15:06:54 +0000 (17:06 +0200)
configure
refclock_pps.c

index dd50dfbd72565dd1882451b6705b7cfaec7f079e..4f2c3816a16b867c2d82e195acbc4eb34b43bbbf 100755 (executable)
--- a/configure
+++ b/configure
@@ -376,8 +376,21 @@ then
   fi
 fi
 
-if [ $feat_pps = "1" ] && \
-  test_code 'PPS API' 'string.h timepps.h' '' '' '
+timepps_h=""
+if [ $feat_pps = "1" ]; then
+  if test_code '<sys/timepps.h>' 'sys/timepps.h' '' '' ''; then
+    timepps_h="sys/timepps.h"
+    add_def HAVE_SYS_TIMEPPS_H
+  else
+    if test_code '<timepps.h>' 'timepps.h' '' '' ''; then
+      timepps_h="timepps.h"
+      add_def HAVE_TIMEPPS_H
+    fi
+  fi
+fi
+
+if [ "x$timepps_h" != "x" ] && \
+  test_code 'PPSAPI' "string.h $timepps_h" '' '' '
     pps_handle_t h;
     pps_info_t i;
     struct timespec ts;
index 3a7ae1efc3e92f27dacd2b351adda21668f1daf0..e747740cb498e4b494640fd612e054f82ae4c8a6 100644 (file)
 
 #if HAVE_PPSAPI
 
+#if defined(HAVE_SYS_TIMEPPS_H)
+#include <sys/timepps.h>
+#elif defined(HAVE_TIMEPPS_H)
 #include <timepps.h>
+#endif
 
 #include "logging.h"
 #include "memory.h"