aboutsummaryrefslogtreecommitdiff
path: root/sntp/m4/ntp_libntp.m4
diff options
context:
space:
mode:
Diffstat (limited to 'sntp/m4/ntp_libntp.m4')
-rw-r--r--sntp/m4/ntp_libntp.m489
1 files changed, 19 insertions, 70 deletions
diff --git a/sntp/m4/ntp_libntp.m4 b/sntp/m4/ntp_libntp.m4
index 21d0cff82c07..e0cc2169aa59 100644
--- a/sntp/m4/ntp_libntp.m4
+++ b/sntp/m4/ntp_libntp.m4
@@ -8,12 +8,13 @@ dnl subpackage while retaining access to such test results.
dnl
AC_DEFUN([NTP_LIBNTP], [
+AC_REQUIRE([AC_PROG_SED])
AC_REQUIRE([NTP_CROSSCOMPILE])
# HMS: Save $LIBS and empty it.
# any LIBS we add here should go in to LDADD_LIBNTP
AC_SUBST([LDADD_LIBNTP])
-__LIBS=$LIBS
+SAVED_LIBS=$LIBS
LIBS=
dnl The contents of NTP_PROG_CC used to be here...
@@ -267,7 +268,7 @@ case "$ac_cv_c_inline" in
AC_SUBST([HAVE_INLINE])
esac
-AC_HEADER_TIME
+
AC_CHECK_SIZEOF([time_t])
AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
AC_CHECK_SIZEOF([signed char])
@@ -490,7 +491,10 @@ AC_DEFUN([NTP_BEFORE_HW_FUNC_VSNPRINTF], [
AC_BEFORE([$0], [HW_FUNC_SNPRINTF])dnl
AC_ARG_ENABLE(
[c99-snprintf],
- [AS_HELP_STRING([--enable-c99-snprintf], [s force replacement])],
+ [AS_HELP_STRING(
+ [--enable-c99-snprintf],
+ [s use replacement printf family]
+ )],
[force_c99_snprintf=$enableval],
[force_c99_snprintf=no]
)
@@ -501,15 +505,8 @@ AC_DEFUN([NTP_BEFORE_HW_FUNC_VSNPRINTF], [
esac
AH_VERBATIM(
[snprinte],dnl sorted in config.h just before #define snprintf
- [
- #if !defined(_KERNEL) && !defined(PARSESTREAM)
- /*
- * stdio.h must be included after _GNU_SOURCE is defined
- * but before #define snprintf rpl_snprintf
- */
- # include <stdio.h>
- #endif
- ])
+ [#include "c99_snprintf.h"]
+ )
AH_BOTTOM([
#if !defined(_KERNEL) && !defined(PARSESTREAM)
# if defined(HW_WANT_RPL_VSNPRINTF)
@@ -752,62 +749,6 @@ typedef unsigned int uintptr_t;
#define HAVE_UINTPTR_T 1
#endif])
-case "$ac_cv_type_int32::$ac_cv_header_resolv_h" in
- no::yes)
- AC_CACHE_CHECK(
- [for int32 with DNS headers included],
- [ntp_cv_type_int32_with_dns],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
- #ifdef HAVE_ARPA_NAMESER_H
- # include <arpa/nameser.h>
- #endif
- #include <resolv.h>
- ]],
- [[
- size_t cb = sizeof(int32);
- ]]
- )],
- [ntp_cv_type_int32_with_dns=yes],
- [ntp_cv_type_int32_with_dns=no]
- )]
- )
- case "$ntp_cv_type_int32_with_dns" in
- yes)
- AC_DEFINE([HAVE_INT32_ONLY_WITH_DNS], [1],
- [int32 type in DNS headers, not others.])
- esac
-esac
-
-case "$ac_cv_type_u_int32::$ac_cv_header_resolv_h" in
- no::yes)
- AC_CACHE_CHECK(
- [for u_int32 with DNS headers included],
- [ntp_cv_type_u_int32_with_dns],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
- #ifdef HAVE_ARPA_NAMESER_H
- # include <arpa/nameser.h>
- #endif
- #include <resolv.h>
- ]],
- [[
- size_t cb = sizeof(u_int32);
- ]]
- )],
- [ntp_cv_type_u_int32_with_dns=yes],
- [ntp_cv_type_u_int32_with_dns=no]
- )]
- )
- case "$ntp_cv_type_u_int32_with_dns" in
- yes)
- AC_DEFINE([HAVE_U_INT32_ONLY_WITH_DNS], [1],
- [u_int32 type in DNS headers, not others.])
- esac
-esac
-
AC_CHECK_HEADERS(
[sys/timepps.h],
[],
@@ -1176,11 +1117,19 @@ case "$ntp_warning" in
;;
esac
+dnl Do not ensure libntp.a is up to date when building client directories
+dnl if --disable-dependency-tracking is used to save build time for one-off
+dnl build from tarball. It's only useful when modifying libntp source code
+dnl and rebuilding in a client subdir rather than the whole package.
+AM_CONDITIONAL([LIBNTP_SUBMAKES], [test x"$enable_dependency_tracking" = x"yes"])
+
+NTP_OPENSSL
+NTP_CRYPTO_RAND
dnl add to LDADD_LIBNTP set by ntp_compiler.m4
LDADD_LIBNTP="$LDADD_LIBNTP $LIBS"
-LIBS=$__LIBS
-AS_UNSET([__LIBS])
+LIBS=$SAVED_LIBS
+AS_UNSET([SAVED_LIBS])
])dnl
dnl ======================================================================