From f570eb76b3214c5d1507cb9a823972a95ee4262d Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 1 Sep 2011 17:06:54 +0200 Subject: [PATCH] Check for timepps.h also in sys directory --- configure | 17 +++++++++++++++-- refclock_pps.c | 4 ++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/configure b/configure index dd50dfb..4f2c381 100755 --- 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' '' '' ''; then + timepps_h="sys/timepps.h" + add_def HAVE_SYS_TIMEPPS_H + else + if test_code '' '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; diff --git a/refclock_pps.c b/refclock_pps.c index 3a7ae1e..e747740 100644 --- a/refclock_pps.c +++ b/refclock_pps.c @@ -31,7 +31,11 @@ #if HAVE_PPSAPI +#if defined(HAVE_SYS_TIMEPPS_H) +#include +#elif defined(HAVE_TIMEPPS_H) #include +#endif #include "logging.h" #include "memory.h"