diff --git a/SConstruct b/SConstruct index beac803..404fea1 100644 --- a/SConstruct +++ b/SConstruct @@ -624,6 +624,11 @@ else: announce("You do not have kernel CANbus available.") env["nmea2000"] = False + if config.CheckHeader("termios.h"): + confdefs.append("#define HAVE_TERMIOS_H 1\n") + else: + confdefs.append("/* #undef HAVE_TERMIOS_H */\n") + # endian.h is required for rtcm104v2 unless the compiler defines # __ORDER_BIG_ENDIAN__, __ORDER_LITTLE_ENDIAN__ and __BYTE_ORDER__ if config.CheckCompilerDefines("__ORDER_BIG_ENDIAN__") \ diff --git a/gps2udp.c b/gps2udp.c index c39004d..dcadc65 100644 --- a/gps2udp.c +++ b/gps2udp.c @@ -11,6 +11,9 @@ * BSD terms apply: see the file COPYING in the distribution root for details. * */ + +#include "gpsd_config.h" + #include #include #include @@ -18,7 +21,9 @@ #include #include #include +#ifdef HAVE_TERMIOS_H #include +#endif /* HAVE_TERMIOS_H */ #include #include #include diff --git a/gpsd.h-tail b/gpsd.h-tail index 2fa81e3..0aa1c16 100644 --- a/gpsd.h-tail +++ b/gpsd.h-tail @@ -5,7 +5,9 @@ */ #endif /* GPSD_CONFIG_H */ +#ifdef HAVE_TERMIOS_H #include +#endif /* HAVE_TERMIOS_H */ #include #include #include "gps.h" diff --git a/gpspipe.c b/gpspipe.c index 7e6a37b..64cc39e 100644 --- a/gpspipe.c +++ b/gpspipe.c @@ -23,6 +23,8 @@ * */ +#include "gpsd_config.h" + #include #include #include @@ -30,7 +32,9 @@ #include #include #include +#ifdef HAVE_TERMIOS_H #include +#endif /* HAVE_TERMIOS_H */ #include #include #include