[chrony-dev] PPS on FreeBSD

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


While chrony + PPS works great on FreeBSD, it doesn't currently get
enabled because sys/timepps.h on FreeBSD uses C99 integer types, and
the configure script doesn't enable those for the checks.

I'm not sure if this is the correct fix, but this crude hack makes it work:

--- configure 2018-04-04 02:18:44.000000000 -0500
+++ configure 2018-08-02 22:22:16.114103000 -0500
@@ -593,16 +593,19 @@ else
     echo "error: could not compile/link a program which uses sqrt(),
log(), pow()"
     exit 1
   fi
 fi

+int_types=""
 if test_code '<stdint.h>' 'stdint.h' '' '' ''; then
   add_def HAVE_STDINT_H
+  int_types="$int_types stdint.h"
 fi

 if test_code '<inttypes.h>' 'inttypes.h' '' '' ''; then
   add_def HAVE_INTTYPES_H
+  int_types="$int_types inttypes.h"
 fi

 if test_code 'struct in_pktinfo' 'sys/socket.h netinet/in.h' '' '' '
   struct in_pktinfo ipi;
   return sizeof (ipi.ipi_spec_dst.s_addr) + IP_PKTINFO;'
@@ -713,11 +716,11 @@ then
   fi
 fi

 timepps_h=""
 if [ $feat_refclock = "1" ] && [ $feat_pps = "1" ]; then
-  if test_code '<sys/timepps.h>' 'sys/timepps.h' '' '' ''; then
+  if test_code '<sys/timepps.h>' "$int_types 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"
@@ -725,11 +728,11 @@ if [ $feat_refclock = "1" ] && [ $feat_pps = "1" ]; th
     fi
   fi
 fi

 if [ "x$timepps_h" != "x" ] && \
-  test_code 'PPSAPI' "string.h $timepps_h" '' '' '
+  test_code 'PPSAPI' "string.h $int_types $timepps_h" '' '' '
     pps_handle_t h = 0;
     pps_info_t i;
     struct timespec ts;
     return time_pps_fetch(h, PPS_TSFMT_TSPEC, &i, &ts);'
 then


-JailBird

-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/