]> sjero.net Git - wget/blobdiff - configure.in
[svn] Rewrite parsing and handling of URLs.
[wget] / configure.in
index dea539929fdd5641314ad303dc90f89a1d37234d..be7d112177541775b244c7ac7013497b34eadf0b 100644 (file)
@@ -63,14 +63,15 @@ AC_ARG_ENABLE(debug,
 DEBUG=$enableval, DEBUG=yes)
 test x"${DEBUG}" = xyes && AC_DEFINE(DEBUG)
 
+wget_need_md5=no
+
 case "${USE_OPIE}${USE_DIGEST}" in
 *yes*)
-       MD5_OBJ='md5$o'
+       wget_need_md5=yes
 esac
 if test x"$USE_OPIE" = xyes; then
   OPIE_OBJ='ftp-opie$o'
 fi
-AC_SUBST(MD5_OBJ)
 AC_SUBST(OPIE_OBJ)
 
 dnl
@@ -83,12 +84,6 @@ dnl Find a good install
 dnl
 AC_PROG_INSTALL
 
-dnl
-dnl Configure our included libtool and make sure it's regenerated when needed
-dnl
-AM_PROG_LIBTOOL
-AC_SUBST(LIBTOOL_DEPS)
-
 dnl
 dnl Find the compiler
 dnl
@@ -121,6 +116,12 @@ dnl Handle AIX
 dnl
 AC_AIX
 
+dnl
+dnl Configure our included libtool and make sure it's regenerated when needed
+dnl
+AC_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+
 dnl
 dnl In case of {cyg,gnu}win32.  Should be a _target_ test.
 dnl Might also be erelevant for DJGPP.
@@ -171,19 +172,57 @@ dnl Checks for library functions.
 dnl
 AC_FUNC_ALLOCA
 AC_FUNC_MMAP
-AC_CHECK_FUNCS(strdup strstr strcasecmp strncasecmp)
+AC_CHECK_FUNCS(strdup strstr strcasecmp strncasecmp strpbrk)
 AC_CHECK_FUNCS(gettimeofday mktime strptime)
 AC_CHECK_FUNCS(strerror snprintf vsnprintf select signal symlink access isatty)
 AC_CHECK_FUNCS(uname gethostname)
 
-AC_CHECK_FUNCS(gethostbyname, [], [
-  AC_CHECK_LIB(nsl, gethostbyname)
+dnl
+dnl Check if we need to compile in getopt.c.
+dnl
+AC_CHECK_FUNC(getopt_long, [], [
+  GETOPT_OBJ='getopt$o'
 ])
+AC_SUBST(GETOPT_OBJ)
 
 dnl
 dnl Checks for libraries.
 dnl
 
+dnl
+dnl Use the md5 lib if available (Solaris).
+dnl
+
+if test x$wget_need_md5 = xyes
+then
+  AC_DEFINE(HAVE_MD5)
+  AC_CHECK_LIB(md5, MD5Update, [
+    AC_DEFINE(HAVE_SOLARIS_MD5)
+    LIBS="-lmd5 $LIBS"
+    ], [
+    MD5_OBJ='gnu-md5$o'
+    AC_DEFINE(HAVE_BUILTIN_MD5)
+  ])
+fi
+AC_SUBST(MD5_OBJ)
+
+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 #### This appears to be deficient with later versions of SOCKS.