1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Move some checks to aclocal.m4.

This commit is contained in:
hniksic 2003-11-03 17:05:06 -08:00
parent 3a83436c75
commit 4f74ab0f44
3 changed files with 72 additions and 40 deletions

View File

@ -1,5 +1,7 @@
2003-11-04 Hrvoje Niksic <hniksic@xemacs.org>
* configure.in: Move some checks into aclocal.m4.
* configure.in: Also check whether #include <md5.h> works before
deciding to use Solaris libmd5.

58
aclocal.m4 vendored
View File

@ -44,6 +44,64 @@ int accept (int, struct sockaddr *, size_t *);
])
])
dnl Check whether fnmatch.h can be included. This doesn't use
dnl AC_FUNC_FNMATCH because Wget is already careful to only use
dnl fnmatch on certain OS'es. However, fnmatch.h is sometimes broken
dnl even on those because Apache installs its own fnmatch.h to
dnl /usr/local/include (!), which GCC uses before /usr/include.
AC_DEFUN([WGET_FNMATCH], [
AC_MSG_CHECKING([whether fnmatch.h can be included])
AC_COMPILE_IFELSE([#include <fnmatch.h>
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_FNMATCH_H)
], [
AC_MSG_RESULT(no)
])
])
dnl Check for nanosleep. For nanosleep to work on Solaris, we must
dnl link with -lt (recently) or with -lposix (older releases).
AC_DEFUN([WGET_NANOSLEEP], [
AC_CHECK_FUNCS(nanosleep, [], [
AC_CHECK_LIB(rt, nanosleep, [
AC_DEFINE(HAVE_NANOSLEEP)
LIBS="-lrt $LIBS"
], [
AC_CHECK_LIB(posix4, nanosleep, [
AC_DEFINE(HAVE_NANOSLEEP)
LIBS="-lposix4 $LIBS"
])
])
])
])
dnl Check whether we need to link with -lnsl and -lsocket, as is the
dnl case on e.g. Solaris.
AC_DEFUN([WGET_NSL_SOCKET], [
dnl On Solaris, -lnsl is needed to use gethostbyname. But checking
dnl for gethostbyname is not enough because on "NCR MP-RAS 3.0"
dnl gethostbyname is in libc, but -lnsl is still needed to use
dnl -lsocket, as well as for functions such as inet_ntoa. We look
dnl for such known offenders and if one of them is not found, we
dnl check if -lnsl is needed.
wget_check_in_nsl=NONE
AC_CHECK_FUNCS(gethostbyname, [], [
wget_check_in_nsl=gethostbyname
])
AC_CHECK_FUNCS(inet_ntoa, [], [
wget_check_in_nsl=inet_ntoa
])
if test $wget_check_in_nsl != NONE; then
AC_CHECK_LIB(nsl, $wget_check_in_nsl)
fi
AC_CHECK_LIB(socket, socket)
])
dnl
dnl ansi2knr support: check whether C prototypes are available.
dnl

View File

@ -180,12 +180,6 @@ dnl Return type of signal-handlers
dnl
AC_TYPE_SIGNAL
dnl
dnl Call several of Wget's macros.
dnl
WGET_STRUCT_UTIMBUF
WGET_SOCKLEN_T
dnl
dnl Checks for library functions.
dnl
@ -196,6 +190,15 @@ AC_CHECK_FUNCS(gettimeofday mktime strptime strerror snprintf vsnprintf)
AC_CHECK_FUNCS(select sigblock sigsetjmp signal symlink access isatty)
AC_CHECK_FUNCS(uname gethostname usleep)
dnl
dnl Call Wget's local macros defined in aclocal.
dnl
WGET_STRUCT_UTIMBUF
WGET_SOCKLEN_T
WGET_FNMATCH
WGET_NANOSLEEP
WGET_NSL_SOCKET
dnl
dnl Check if we need to compile in getopt.c.
dnl
@ -208,39 +211,6 @@ dnl
dnl Checks for libraries.
dnl
dnl On Solaris, -lnsl is needed to use gethostbyname. On "NCR MP-RAS
dnl 3.0", however, gethostbyname is in libc, but -lnsl is still needed
dnl to use -lsocket, as well as for functions such as inet_ntoa. We
dnl look for such known offenders and if one of them is not found, we
dnl check if -lnsl is needed.
wget_check_in_nsl=NONE
AC_CHECK_FUNCS(gethostbyname, [], [
wget_check_in_nsl=gethostbyname
])
AC_CHECK_FUNCS(inet_ntoa, [], [
wget_check_in_nsl=inet_ntoa
])
if test $wget_check_in_nsl != NONE; then
AC_CHECK_LIB(nsl, $wget_check_in_nsl)
fi
AC_CHECK_LIB(socket, socket)
dnl nanosleep on Solaris requires -lrt (more recently) or -lposix4
dnl (older versions).
AC_CHECK_FUNCS(nanosleep, [], [
AC_CHECK_LIB(rt, nanosleep, [
AC_DEFINE(HAVE_NANOSLEEP)
LIBS="-lrt $LIBS"
], [
AC_CHECK_LIB(posix4, nanosleep, [
AC_DEFINE(HAVE_NANOSLEEP)
LIBS="-lposix4 $LIBS"
])
])])
dnl #### This appears to be deficient with later versions of SOCKS.
if test "x${with_socks}" = xyes
then
@ -426,8 +396,10 @@ dnl
if test x"$wget_need_md5" = xyes
then
MD5_OBJ='gen-md5$o'
dnl This should be moved to an AC_DEFUN, but I'm not sure how to
dnl manipulate MD5_OBJ from the defun.
MD5_OBJ='gen-md5$o'
found_md5=no
dnl Check for the system MD5 library on Solaris. We don't check for