From: Dave Hart Date: Wed, 15 Apr 2009 01:32:33 +0000 (+0000) Subject: use AC_SEARCH_LIBS to avoid problems with sntp X-Git-Tag: NTP_4_2_5P164~21^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fa666433c45e613f40de7679b2cbfedbbf5721d;p=thirdparty%2Fntp.git use AC_SEARCH_LIBS to avoid problems with sntp bk: 49e53931rHX0P4N8HwRcpw0C_8LYUA --- diff --git a/configure.ac b/configure.ac index 975ad35eb..4d7744c28 100644 --- a/configure.ac +++ b/configure.ac @@ -30,11 +30,10 @@ AC_DISABLE_SHARED dnl we need to check for cross compile tools for vxWorks here AC_PROG_CC -AC_PROG_CC_STDC -dnl AC_PROG_CC_C89 -# make sure CC is *some* version of ANSI. # Ralf Wildenhues: With per-target flags we need CC_C_O -AC_PROG_CC_C_O +# AM_PROG_CC_C_O supersets AC_PROG_CC_C_O +AM_PROG_CC_C_O +AC_PROG_CC_STDC AC_PROG_CPP # HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS @@ -340,13 +339,12 @@ case "$host" in ;; esac -AC_CHECK_FUNC(gethostent, , - AC_CHECK_LIB(nsl, gethostent, , , $libxnet -lsocket)) -AC_CHECK_FUNC(openlog, , - AC_CHECK_LIB(gen, openlog, , - AC_CHECK_LIB(syslog, openlog, , , $libxnet -lsocket))) -AC_CHECK_LIB(md5, MD5Init, , - AC_CHECK_LIB(md, MD5Init)) +AC_CHECK_FUNC([gethostent], , + AC_SEARCH_LIBS([gethostent], [nsl], , , [$libxnet -lsocket])) +AC_CHECK_FUNC([openlog], , + AC_SEARCH_LIBS([openlog], [gen], , + AC_SEARCH_LIBS([openlog], [syslog], , , [$libxnet -lsocket]))) +AC_SEARCH_LIBS([MD5Init], [md5 md]) AC_CHECK_FUNCS(MD5Init) # following block becomes on 4.2.5: NTP_LINEEDITLIBS @@ -384,7 +382,7 @@ dnl does Strange Things with extra processes using the Posix-compatibility dnl real-time library, so we don't want to use it. case "$host" in - *-*-linux*) ;; + *-*-*linux*) ;; *) AC_CHECK_LIB(rt, sched_setscheduler, , AC_CHECK_LIB(posix4, sched_setscheduler)) @@ -392,8 +390,7 @@ case "$host" in esac AC_CHECK_FUNC(setsockopt, , - [AC_CHECK_LIB(socket, setsockopt) - AC_CHECK_LIB(xnet, setsockopt)]) + [AC_SEARCH_LIBS([setsockopt], [socket xnet])]) AC_HEADER_STDC AC_CHECK_HEADERS(bstring.h) @@ -4456,11 +4453,6 @@ AC_CONFIG_FILES(scripts/plot_summary, [chmod +x scripts/plot_summary]) AC_CONFIG_FILES(scripts/summary, [chmod +x scripts/summary]) AC_CONFIG_FILES(util/Makefile) -dnl it is not safe to share configuration -dnl cache with sntp as it uses different -dnl headers in a different order and -dnl tests for different libraries. -dnl -dnl AC_CONFIG_SUBDIRS(sntp) +AC_CONFIG_SUBDIRS(sntp) AC_OUTPUT diff --git a/sntp/configure.ac b/sntp/configure.ac index aa4a48404..be6943ff9 100644 --- a/sntp/configure.ac +++ b/sntp/configure.ac @@ -110,14 +110,14 @@ case "$ac_cv_have_ss_family_in_struct_ss$ac_cv_have___ss_family_in_struct_ss" in esac # Checks for library functions. -AC_FUNC_MEMCMP +#AC_FUNC_MEMCMP dnl HMS: we don't have a memcmp.c to use here, so why bother? AC_FUNC_SETVBUF_REVERSED AC_TYPE_SIGNAL AC_CHECK_FUNCS([alarm]) -AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent, , , -lsocket)) +AC_CHECK_FUNC([gethostent], , AC_SEARCH_LIBS([gethostent], [nsl], , , [-lsocket])) AC_CHECK_FUNCS([gettimeofday inet_ntoa memset]) -AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket)) -AC_CHECK_FUNCS(sqrt, , AC_CHECK_LIB(m, sqrt)) +AC_CHECK_FUNCS([socket], , AC_SEARCH_LIBS([socket], [socket])) +AC_CHECK_FUNCS([sqrt], , AC_SEARCH_LIBS([sqrt], [m])) AC_CHECK_FUNCS([strrchr]) case "$host" in