dnl Process this file with autoconf to produce a configure script.
dnl
-AC_INIT(src/version.c)
-AC_PREREQ(2.50)
-AC_CONFIG_HEADER(src/config.h)
+AC_INIT([src/version.c])
+AC_PREREQ(2.57)
dnl
dnl What version of Wget are we building?
dnl
dnl Process features.
dnl
-AC_ARG_WITH(socks,
- [ --with-socks use the socks library],
- [AC_DEFINE([HAVE_SOCKS], [],
- [Define if you wish to compile with socks support.])]
-)
AC_ARG_WITH(ssl,
[[ --with-ssl[=SSL-ROOT] link with SSL support [default=auto]
AC_ARG_ENABLE(opie,
[ --disable-opie disable support for opie or s/key FTP login],
USE_OPIE=$enableval, USE_OPIE=yes)
-test x"${USE_OPIE}" = xyes && AC_DEFINE([USE_OPIE], [],
+test x"${USE_OPIE}" = xyes && AC_DEFINE([USE_OPIE], 1,
[Define if you want the Opie support for FTP compiled in.])
AC_ARG_ENABLE(digest,
[ --disable-digest disable support for HTTP digest authorization],
USE_DIGEST=$enableval, USE_DIGEST=yes)
-test x"${USE_DIGEST}" = xyes && AC_DEFINE([USE_DIGEST], [],
+test x"${USE_DIGEST}" = xyes && AC_DEFINE([USE_DIGEST], 1,
[Define if you want the HTTP Digest Authorization compiled in.])
AC_ARG_ENABLE(debug,
[ --disable-debug disable support for debugging output],
ENABLE_DEBUG=$enableval, ENABLE_DEBUG=yes)
-test x"${ENABLE_DEBUG}" = xyes && AC_DEFINE([ENABLE_DEBUG], [],
+test x"${ENABLE_DEBUG}" = xyes && AC_DEFINE([ENABLE_DEBUG], 1,
[Define if you want the debug output support compiled in.])
wget_need_md5=no
test -z "$CC" && cc_specified=yes
AC_PROG_CC
+AC_AIX
+AM_PROG_CC_STDC
+dnl Turn on optimization by default. Specifically:
dnl
dnl if the user hasn't specified CFLAGS, then
-dnl if compiler is gcc, then use -O2 and some warning flags
-dnl else use os-specific flags or -O
-dnl
+dnl if compiler is gcc, then
+dnl use -O2 and some warning flags
+dnl else
+dnl use os-specific flags or -O
if test -n "$auto_cflags"; then
if test -n "$GCC"; then
CFLAGS="$CFLAGS -O2 -Wall -Wno-implicit"
fi
fi
-dnl
-dnl Handle AIX
-dnl
-AC_AIX
-
dnl
dnl Configure our included libtool and make sure it's regenerated when needed
dnl
esac
AC_SUBST(exeext)
-dnl
-dnl Check if we can handle prototypes.
-dnl
-AM_C_PROTOTYPES
-
dnl
dnl Checks for basic compiler characteristics.
dnl
AC_C_INLINE
AC_C_VOLATILE
AC_C_BIGENDIAN
+AC_C_PROTOTYPES
+
+if test x"$am_cv_prog_cc_stdc" != xno; then
+ true
+ AC_SUBST(U, [])
+ AC_SUBST(ANSI2KNR, [])
+else
+ AC_SUBST(U, [_])
+ AC_SUBST(ANSI2KNR, [./ansi2knr])
+fi
dnl
-dnl Checks for headers
+dnl Checks for header files that might be missing.
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)
+
+dnl Check for basic headers, even those we assume the presence of.
+dnl This is because Autoconf default includes check for STDC_HEADERS,
+dnl HAVE_SYS_TYPES_H, etc. before including them.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(sys/types.h sys/stat.h)
+dnl Now check for the others.
+AC_CHECK_HEADERS(string.h strings.h stdarg.h unistd.h sys/time.h)
+AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/select.h utime.h sys/utime.h)
+AC_CHECK_HEADERS(stdint.h inttypes.h signal.h setjmp.h pwd.h)
AC_HEADER_TIME
dnl
dnl Checks for libraries.
dnl
-dnl #### This appears to be deficient with later versions of SOCKS.
-if test "x${with_socks}" = xyes
-then
- AC_CHECK_LIB(resolv, main)
- AC_CHECK_LIB(socks, Rconnect)
-fi
-
dnl $with_ssl can be one of:
dnl - empty string or "auto", meaning autodetect SSL and use it if found.
dnl - "yes", meaning link with SSL or bail out.
if test x"$ssl_success" = xyes; then
AC_MSG_NOTICE([compiling in support for SSL in $ssl_root])
- AC_DEFINE([HAVE_SSL], [],
+ AC_DEFINE([HAVE_SSL], 1,
[Define if SSL support should be compiled in.])
AC_SUBST(SSL_INCLUDES)
SSL_OBJ='gen_sslfunc$o'
AC_COMPILE_IFELSE([#include <md5.h>
], [
AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE_SOLARIS_MD5], [], [Define to use Solaris MD5.])
+ AC_DEFINE([HAVE_SOLARIS_MD5], 1, [Define to use Solaris MD5.])
LIBS="-lmd5 $LIBS"
found_md5=yes
AC_MSG_NOTICE([using the Solaris MD5 implementation])
dnl implementation.
if test x"$found_md5" = xno; then
if test x"$ssl_success" = xyes; then
- AC_DEFINE([HAVE_OPENSSL_MD5], [], [Define to use OpenSSL MD5.])
+ AC_DEFINE([HAVE_OPENSSL_MD5], 1, [Define to use OpenSSL MD5.])
found_md5=yes
AC_MSG_NOTICE([using the OpenSSL MD5 implementation])
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], [], [Define to use built-in MD5.])
+ AC_DEFINE([HAVE_BUILTIN_MD5], 1, [Define to use built-in MD5.])
MD5_OBJ="$MD5_OBJ gnu-md5\$o"
found_md5=yes
AC_MSG_NOTICE([using the GNU MD5 implementation])
fi
fi
-AC_DEFINE([HAVE_MD5], [], [Define if we're compiling support for MD5.])
+AC_DEFINE([HAVE_MD5], 1, [Define if we're compiling support for MD5.])
AC_SUBST(MD5_OBJ)
dnl **********************************************************************
dnl
dnl Create output
dnl
-AC_OUTPUT([Makefile src/Makefile doc/Makefile util/Makefile po/Makefile.in
- windows/Makefile],
-[WGET_PROCESS_PO
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
+AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile util/Makefile
+ po/Makefile.in windows/Makefile])
+AC_CONFIG_HEADERS([src/config.h])
+AH_BOTTOM([
+#include "config-post.h"
+])
+AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
+AC_CONFIG_COMMANDS([default], [WGET_PROCESS_PO])
+AC_OUTPUT