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"