]> sjero.net Git - wget/commitdiff
[svn] Move some checks to aclocal.m4.
authorhniksic <devnull@localhost>
Tue, 4 Nov 2003 01:05:06 +0000 (17:05 -0800)
committerhniksic <devnull@localhost>
Tue, 4 Nov 2003 01:05:06 +0000 (17:05 -0800)
ChangeLog
aclocal.m4
configure.in

index 3869a14b5c1b2582aab25287d0515874461adc85..74fe675670aa32b31ff9519effb4023dc6bb78e1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
 
index 7b594463494fd0471ff308ba05391353bd550d57..a4535c245173ffbe24e5f27e341b9add308cd4d1 100644 (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
index 63f7fe44b6563f42b4ef9181f849ad8679012845..be2f9ffe95424a6ec8892a799e91f565f507a72e 100644 (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