dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+dnl In addition, as a special exception, the Free Software Foundation
+dnl gives permission to link the code of its release of Wget with the
+dnl OpenSSL project's "OpenSSL" library (or with modified versions of it
+dnl that use the same license as the "OpenSSL" library), and distribute
+dnl the linked executables. You must obey the GNU General Public License
+dnl in all respects for all of the code used other than "OpenSSL". If you
+dnl modify this file, you may extend this exception to your version of the
+dnl file, but you are not obligated to do so. If you do not wish to do
+dnl so, delete this exception statement from your version.
+
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT(src/version.c)
-AC_PREREQ(2.12)
+AC_PREREQ(2.50)
AC_CONFIG_HEADER(src/config.h)
dnl
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)
[AC_DEFINE(HAVE_SOCKS)])
AC_ARG_WITH(ssl,
-[ --with-ssl[=SSL-ROOT] link with SSL support [default=auto]
- --without-ssl disable SSL autodetection])
+[[ --with-ssl[=SSL-ROOT] link with SSL support [default=auto]
+ --without-ssl disable SSL autodetection]])
AC_ARG_ENABLE(opie,
[ --disable-opie disable support for opie or s/key FTP login],
AC_ARG_ENABLE(debug,
[ --disable-debug disable support for debugging output],
-DEBUG=$enableval, DEBUG=yes)
-test x"${DEBUG}" = xyes && AC_DEFINE(DEBUG)
+ENABLE_DEBUG=$enableval, ENABLE_DEBUG=yes)
+test x"${ENABLE_DEBUG}" = xyes && AC_DEFINE(ENABLE_DEBUG)
wget_need_md5=no
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
-dnl #### This generates a warning. What do I do to shut it up?
+AC_C_VOLATILE
AC_C_BIGENDIAN
-# Check size of long.
+dnl
+dnl Checks for headers
+dnl
+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(inttypes.h signal.h setjmp.h pwd.h)
+AC_HEADER_TIME
+
+dnl
+dnl Check integral type sizes.
+dnl
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
dnl
-dnl Checks for headers
+dnl Checks for system-specific types.
dnl
-AC_CHECK_HEADERS(string.h stdarg.h unistd.h sys/time.h utime.h sys/utime.h pwd.h)
-AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/select.h sys/utsname.h signal.h)
-AC_HEADER_TIME
+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 Check for struct utimbuf
-WGET_STRUCT_UTIMBUF
-
dnl
dnl Checks for library functions.
dnl
AC_FUNC_ALLOCA
AC_FUNC_MMAP
AC_CHECK_FUNCS(strdup strstr strcasecmp strncasecmp strpbrk memmove)
-AC_CHECK_FUNCS(gettimeofday mktime strptime)
-AC_CHECK_FUNCS(strerror snprintf vsnprintf select signal symlink access isatty)
-AC_CHECK_FUNCS(uname gethostname usleep)
+AC_CHECK_FUNCS(gettimeofday mktime strptime strerror snprintf vsnprintf)
+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
LDFLAGS="-L$ssl_root/lib -R$ssl_root/lib $wget_save_LDFLAGS"
fi
- AC_MSG_RESULT(["Looking for SSL libraries in $ssl_root"])
+ AC_MSG_RESULT([Looking for SSL libraries in $ssl_root])
dnl Check whether the compiler can find the include files. On
dnl some systems Gcc finds libraries in /usr/local/lib, but fails
ssl_found_includes=no
CPPFLAGS="$SSL_INCLUDES $wget_save_CPPFLAGS"
- AC_MSG_CHECKING(["for includes"])
+ AC_MSG_CHECKING([for includes])
AC_TRY_CPP([#include <openssl/ssl.h>
#include <openssl/rsa.h>
],
- AC_MSG_RESULT("found"); ssl_found_includes=yes,
- AC_MSG_RESULT("not found")
+ AC_MSG_RESULT(found); ssl_found_includes=yes,
+ AC_MSG_RESULT([not found])
)
if test x"$ssl_found_includes" = xno; then
ssl_run_failure=no
- AC_MSG_CHECKING("whether SSL libs are resolved at runtime")
+ AC_MSG_CHECKING([whether SSL libs are resolved at runtime])
AC_TRY_RUN([
int RSA_new();
int SSL_new();
main(){return 0;}
],
- AC_MSG_RESULT("yes"),
- AC_MSG_RESULT("no"); ssl_run_failure=yes,
- AC_MSG_RESULT("cross")
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no); ssl_run_failure=yes,
+ AC_MSG_RESULT(cross)
)
if test x"$ssl_run_failure" = xno; then
if test x"$ssl_success" = xyes; then
dnl AC_MSG_RESULT doesn't look right here, but I'm not sure what
dnl to use instead.
- AC_MSG_RESULT("Compiling in support for SSL in $ssl_root")
+ AC_MSG_RESULT([Compiling in support for SSL in $ssl_root])
AC_DEFINE(HAVE_SSL)
AC_SUBST(SSL_INCLUDES)
SSL_OBJ='gen_sslfunc$o'
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)
AC_SUBST(MD5_OBJ)
+dnl **********************************************************************
+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,
+ AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
+ [case "${enable_ipv6}" in
+ no)
+ AC_MSG_NOTICE([Disabling IPv6 at user request])
+ ipv6=no
+ ;;
+ *)
+ ipv6=yes
+ ;;
+ esac],
+ 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
+ AC_CHECK_FUNCS(getaddrinfo,[
+ GETADDRINFO_AI_ADDRCONFIG(
+ AC_DEFINE(
+ [HAVE_GETADDRINFO_AI_ADDRCONFIG], 1,
+ [Define if the system headers support the AI_ADDRCONFIG flag.]
+ )
+ )
+ GETADDRINFO_AI_V4MAPPED(
+ AC_DEFINE(
+ [HAVE_GETADDRINFO_AI_V4MAPPED], 1,
+ [Define if the system headers support the AI_V4MAPPED flag.]
+ )
+ )
+ GETADDRINFO_AI_ALL(
+ AC_DEFINE(
+ [HAVE_GETADDRINFO_AI_ALL], 1,
+ [Define if the system headers support the AI_ALL flag.]
+ )
+ )
+ ],[
+ AC_MSG_NOTICE([Disabling IPv6 support: your system does not support getaddrinfo(3)])
+ 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])
+ ipv6=no
+ ])
+fi
+
+if test "X$ipv6" = "Xyes" || test "X$check_for_ipv6" = "Xyes"; then
+ TYPE_STRUCT_SOCKADDR_IN6([
+ ipv6=yes
+ ],[
+ AC_MSG_NOTICE([Disabling IPv6 support: your system does not support 'struct sockaddr_in6'])
+ ipv6=no
+ ])
+ if test "X$ipv6" = "Xyes"; then
+ MEMBER_SIN6_SCOPE_ID
+ fi
+fi
+
+if test "X$ipv6" = "Xyes"; then
+ AC_DEFINE([ENABLE_IPV6], 1, [Define if IPv6 support is enabled.])
+fi
+
+
dnl
dnl Set of available languages.
dnl
-ALL_LINGUAS=`(cd ${srcdir}/po && ls *.po | sed -e 's/\.po$//')`
+ALL_LINGUAS=`(cd ${srcdir}/po && ls *.po | sed -e 's/\.po$//' | tr '\012' ' ')`
dnl Originally this used to be static, looking like this:
dnl ALL_LINGUAS="cs de hr it ..."