dnl What version of Wget are we building?
dnl
VERSION=`sed -e 's/^.*"\(.*\)";$/\1/' ${srcdir}/src/version.c`
-echo "configuring for GNU Wget $VERSION"
+AC_MSG_NOTICE([configuring for GNU Wget $VERSION])
AC_SUBST(VERSION)
PACKAGE=wget
AC_SUBST(PACKAGE)
AM_C_PROTOTYPES
dnl
-dnl Checks for typedefs, structures, and compiler characteristics.
+dnl Checks for basic compiler characteristics.
dnl
AC_C_CONST
AC_C_INLINE
-AC_TYPE_SIZE_T
-AC_TYPE_PID_T
+AC_C_VOLATILE
AC_C_BIGENDIAN
-# Check size of long.
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-
dnl
dnl Checks for headers
dnl
-AC_CHECK_HEADERS(string.h stdarg.h unistd.h sys/time.h utime.h sys/utime.h pwd.h)
+AC_CHECK_HEADERS(string.h stdarg.h unistd.h sys/time.h utime.h sys/utime.h)
AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/select.h sys/utsname.h)
-AC_CHECK_HEADERS(signal.h setjmp.h)
+AC_CHECK_HEADERS(inttypes.h signal.h setjmp.h pwd.h)
AC_HEADER_TIME
dnl
-dnl Return type of signal-handlers
+dnl Check integral type sizes.
dnl
-AC_TYPE_SIGNAL
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
dnl
-dnl Check for struct utimbuf
-WGET_STRUCT_UTIMBUF
+dnl Checks for system-specific types.
+dnl
+AC_TYPE_SIZE_T
+AC_TYPE_PID_T
+AC_CHECK_TYPES(uint32_t)
+AC_CHECK_TYPES(sig_atomic_t, [], [], [
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+])
+
+dnl
+dnl Return type of signal-handlers
+dnl
+AC_TYPE_SIGNAL
dnl
dnl Checks for library functions.
AC_FUNC_MMAP
AC_CHECK_FUNCS(strdup strstr strcasecmp strncasecmp strpbrk memmove)
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)
+AC_CHECK_FUNCS(usleep select sigblock sigsetjmp signal symlink access isatty)
+
+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 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 #### This appears to be deficient with later versions of SOCKS.
if test "x${with_socks}" = xyes
then
dnl If linking with SSL was forced rather than auto-detected, then
dnl bail out if SSL failed.
if test x"$wget_force_ssl" = x"yes"; then
- exec >&2
- echo "ERROR: Failed to find OpenSSL libraries."
- exit 2
+ AC_MSG_ERROR([failed to find OpenSSL libraries], 2)
fi
fi
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
dnl specific to the Solaris MD5 library.
if test x"$found_md5" = xno; then
AC_CHECK_LIB(md5, md5_calc, [
- AC_DEFINE(HAVE_SOLARIS_MD5)
- LIBS="-lmd5 $LIBS"
- found_md5=yes
+ dnl Some installations have bogus <md5.h> in the compiler's
+ dnl include path, making the system md5 library useless.
+ AC_MSG_CHECKING([whether md5.h can be included])
+ AC_COMPILE_IFELSE([#include <md5.h>
+ ], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SOLARIS_MD5)
+ LIBS="-lmd5 $LIBS"
+ found_md5=yes
+ AC_MSG_NOTICE([using the Solaris MD5 implementation])
+ ], [AC_MSG_RESULT(no)])
])
fi
if test x"$ssl_success" = xyes; then
AC_DEFINE(HAVE_OPENSSL_MD5)
found_md5=yes
+ AC_MSG_NOTICE([using the OpenSSL MD5 implementation])
fi
fi
dnl If none of the above worked, use the one we ship with Wget.
if test x"$found_md5" = xno; then
AC_DEFINE(HAVE_BUILTIN_MD5)
- found_md5=yes
MD5_OBJ="$MD5_OBJ gnu-md5\$o"
+ found_md5=yes
+ AC_MSG_NOTICE([using the GNU MD5 implementation])
fi
fi
AC_DEFINE(HAVE_MD5)
dnl Checks for IPv6
dnl **********************************************************************
+dnl
+dnl If --enable-ipv6 is specified, we try to use IPv6 (as long as
+dnl getaddrinfo is also present). If --disable-ipv6 is specified, we
+dnl don't use IPv6 or getaddrinfo.
+dnl
+
ipv6=
check_for_ipv6=no
AC_ARG_ENABLE(ipv6,
ipv6=yes
;;
esac],
- [check_for_ipv6=no]
+ dnl If unspecified, check for IPv6 and use it where available.
+ [check_for_ipv6=yes]
)
if test "X$ipv6" = "Xyes" || test "X$check_for_ipv6" = "Xyes"; then
ipv6=no
])
fi
-
+
if test "X$ipv6" = "Xyes" || test "X$check_for_ipv6" = "Xyes"; then
PROTO_INET6(,[
AC_MSG_NOTICE([Disabling IPv6 support: your system does not support the PF_INET6 protocol family])