cross-compiling (keyword-gen and ntpd --saveconfigquit).
sntp/main.c: Remove duplicate global adr_buf[] (also defined in
networking.c) which Piotr Grudzinski identified breaking his build.
Correct in6addr_any test in configure.ac to attempt link too.
bk: 4addf798UXIM0k9Q-l__E_uEbhGvwg
* [Bug 1343] ntpd/ntp_io.c close_fd() does not compile on Solaris 7.
+* Do not attempt to execute built binaries from ntpd/Makefile when
+ cross-compiling (keyword-gen and ntpd --saveconfigquit).
+* sntp/main.c: Remove duplicate global adr_buf[] (also defined in
+ networking.c) which Piotr Grudzinski identified breaking his build.
+* Correct in6addr_any test in configure.ac to attempt link too.
(4.2.5p235-RC) 2009/10/18 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
(4.2.5p234-RC) 2009/10/16 Released by Harlan Stenn <stenn@ntp.org>
NTP_CACHEVERSION([main], [$ntp_configure_cache_version])
AM_INIT_AUTOMAKE
+AC_CANONICAL_BUILD
AC_CANONICAL_HOST
dnl the 'build' machine is where we run configure and compile
dnl the 'host' machine is where the resulting stuff runs.
#
esac
-
+# Expose a cross-compilation indicator to makefiles
+AM_CONDITIONAL(NTP_CROSSCOMPILE, test $build != $host)
AC_MSG_CHECKING([for bin subdirectory])
AC_ARG_WITH(binsubdir,
AC_CACHE_CHECK(
[for in6addr_any],
- ac_cv_have_in6addr_any,
+ isc_cv_have_in6addr_any,
[
- AC_COMPILE_IFELSE(
+ AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[
]
)
],
- [ac_cv_have_in6addr_any=yes],
- [ac_cv_have_in6addr_any=no]
+ [isc_cv_have_in6addr_any=yes],
+ [isc_cv_have_in6addr_any=no]
)
]
)
-case "$ac_cv_have_in6addr_any" in
+case "$isc_cv_have_in6addr_any" in
no)
AC_DEFINE(ISC_PLATFORM_NEEDIN6ADDRANY, , [missing in6addr_any?])
esac
AM_YFLAGS= -d -t -r all
if SAVECONFIG_ENABLED
-CHECK_SAVECONFIG= check-saveconfig
+if NTP_CROSSCOMPILE
+CHECK_SAVECONFIG=
else
+CHECK_SAVECONFIG= check-saveconfig
+endif
+else !SAVECONFIG_ENABLED
CHECK_SAVECONFIG=
endif
+if NTP_CROSSCOMPILE
+NTP_KEYWORD_OUT=ntp_keyword.dummy
+else
+NTP_KEYWORD_OUT=ntp_keyword.out
+endif
+
#
# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as
# BSD make) to work around issues specific to compiling
ntpdsim_CFLAGS = $(CFLAGS) -DSIM
check_y2k_LDADD = $(LDADD) ../libntp/libntp.a
DISTCLEANFILES = keyword-gen .version version.c
-CLEANFILES = check-saveconfig compsave.conf ntp_keyword.out
+CLEANFILES = check-saveconfig compsave.conf ntp_keyword.out \
+ ntp_keyword.dummy
EXTRA_DIST = \
complete.conf \
ntpd-opts.def \
grep -v diff_ignore_line < $@ > cmp2
cmp cmp1 cmp2 > /dev/null || cp $@ $(srcdir)/ntp_keyword.h
rm cmp1 cmp2
+
+ntp_keyword.dummy:
+ echo stamp > $@
-$(srcdir)/ntp_keyword.h: ntp_keyword.out
+$(srcdir)/ntp_keyword.h: $(NTP_KEYWORD_OUT)
echo $(srcdir)/ntp_keyword.h is unchanged > /dev/null
$(srcdir)/ntpd-opts.h: $(srcdir)/ntpd-opts.c
NTP_CACHEVERSION([sntp], [$sntp_configure_cache_version])
AM_INIT_AUTOMAKE
+AC_CANONICAL_BUILD
AC_CANONICAL_HOST
dnl the 'build' machine is where we run configure and compile
dnl the 'host' machine is where the resulting stuff runs.
AC_CACHE_CHECK(
[for in6addr_any],
- ac_cv_have_in6addr_any,
+ isc_cv_have_in6addr_any,
[
- AC_COMPILE_IFELSE(
+ AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[
]
)
],
- [ac_cv_have_in6addr_any=yes],
- [ac_cv_have_in6addr_any=no]
+ [isc_cv_have_in6addr_any=yes],
+ [isc_cv_have_in6addr_any=no]
)
]
)
-case "$ac_cv_have_in6addr_any" in
+case "$isc_cv_have_in6addr_any" in
no)
AC_DEFINE(ISC_PLATFORM_NEEDIN6ADDRANY, , [missing in6addr_any?])
esac
int ai_fam_pref;
volatile int debug;
-char adr_buf[INET6_ADDRSTRLEN];
struct key *keys = NULL;
struct addrinfo *host
)
{
+ char addr_buf[INET6_ADDRSTRLEN];
register int try;
SOCKET sock;
struct pkt x_pkt;
NTOHL_FP(&r_pkt.rec, &p_rec);
NTOHL_FP(&r_pkt.xmt, &p_xmt);
- if(ENABLED_OPT(NORMALVERBOSE)) {
- getnameinfo(host->ai_addr, host->ai_addrlen, adr_buf,
- sizeof(adr_buf), NULL, 0, NI_NUMERICHOST);
+ if (ENABLED_OPT(NORMALVERBOSE)) {
+ getnameinfo(host->ai_addr, host->ai_addrlen, addr_buf,
+ sizeof(addr_buf), NULL, 0, NI_NUMERICHOST);
- printf("sntp on_wire: Received %i bytes from %s\n", rpktl, adr_buf);
+ printf("sntp on_wire: Received %i bytes from %s\n", rpktl, addr_buf);
}
#ifdef DEBUG
}
char logmsg[32 + INET6_ADDRSTRLEN];
- getnameinfo(host->ai_addr, host->ai_addrlen, adr_buf, sizeof(adr_buf), NULL, 0, NI_NUMERICHOST);
+ getnameinfo(host->ai_addr, host->ai_addrlen, addr_buf, sizeof(addr_buf), NULL, 0, NI_NUMERICHOST);
- snprintf(logmsg, sizeof(logmsg), "Received no useable packet from %s!", adr_buf);
+ snprintf(logmsg, sizeof(logmsg), "Received no useable packet from %s!", addr_buf);
- if(ENABLED_OPT(NORMALVERBOSE))
- printf("sntp on_wire: Received no useable packet from %s!\n", adr_buf);
+ if (ENABLED_OPT(NORMALVERBOSE))
+ printf("sntp on_wire: Received no useable packet from %s!\n", addr_buf);
log_msg(logmsg, 1);