1
1
dnl Template file for GNU Autoconf
2
dnl Copyright (C) 1995, 1996, 1997, 2001, 2007, 2008, 2009 Free Software
2
dnl Copyright (C) 1995, 1996, 1997, 2001, 2007, 2008, 2009, 2010, 2011
3
dnl Free Software Foundation, Inc.
5
5
dnl This program is free software; you can redistribute it and/or modify
6
6
dnl it under the terms of the GNU General Public License as published by
215
210
AC_DEFINE([HAVE_STRNCASECMP], 1, [Define to 1 if you have the `strncasecmp' function.])
216
211
AC_DEFINE([HAVE_STRDUP], 1, [Define to 1 if you have the `strdup' function.])
217
212
AC_DEFINE([HAVE_ISATTY], 1, [Define to 1 if you have the `isatty' function.])
218
AC_DEFINE([HAVE_SYMLINK], 1, [Define to 1 if you have the `symlink' function.])
221
215
dnl Call Wget-specific macros defined in aclocal.
223
217
WGET_STRUCT_UTIMBUF
223
dnl Deal with specific hosts
227
AC_LIBOBJ([mswindows])
231
233
dnl Checks for libraries.
234
AS_IF([test x"$with_ssl" = xgnutls], [
235
dnl Now actually check for -lssl
236
AC_LIB_HAVE_LINKFLAGS([gnutls], [], [
237
#include <gnutls/gnutls.h>
238
], [gnutls_global_init()])
239
if test x"$LIBGNUTLS" != x
241
AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
244
AC_MSG_ERROR([--with-ssl=gnutls was given, but GNUTLS is not available.])
247
# --with-ssl is not gnutls: check if it's no
248
AS_IF([test x"$with_ssl" != xno], [
236
AS_IF([test x"$with_ssl" = xopenssl], [
237
dnl some versions of openssl use zlib compression
238
AC_CHECK_LIB(z, compress)
249
240
dnl As of this writing (OpenSSL 0.9.6), the libcrypto shared library
250
241
dnl doesn't record its dependency on libdl, so we need to make sure
251
242
dnl -ldl ends up in LIBS on systems that have it. Most OSes use
254
245
AC_CHECK_LIB(dl, shl_load)
250
dnl prefer link to openssl dlls if possible. if not then fallback on static libs. if not then error
252
AC_CHECK_LIB(eay32, EVP_MD_CTX_init)
253
if test x"$ac_cv_lib_eay32_EVP_MD_CTX_init" != xno
255
AC_CHECK_LIB(ssl32, SSL_connect,,
256
AC_MSG_ERROR([openssl not found: shared lib eay32 found but ssl32 not found]))
257
AC_MSG_NOTICE([Enabling support for SSL via OpenSSL (shared)])
261
dnl fallback and test static libs
263
AC_CHECK_LIB(crypto, EVP_MD_CTX_init,,,)
264
if test x"$ac_cv_lib_crypto_EVP_MD_CTX_init" != xno
266
AC_CHECK_LIB(ssl, SSL_connect,, AC_MSG_ERROR([openssl not found]))
267
AC_MSG_NOTICE([Enabling support for SSL via OpenSSL])
269
AC_MSG_ERROR([openssl not found: shared (eay32/ssl32) or static (crypto/ssl) libs needed])
273
dnl add zdll lib as dep for above tests?
277
AC_CHECK_LIB(crypto, EVP_MD_CTX_init)
278
AC_CHECK_LIB(ssl, ERR_func_error_string,,
279
AC_MSG_ERROR([openssl development libraries not found]))
280
AC_MSG_NOTICE([Enabling support for SSL via OpenSSL (static)])
285
# --with-ssl is not gnutls: check if it's no
286
AS_IF([test x"$with_ssl" != xno], [
257
287
dnl Now actually check for -lssl
258
AC_LIB_HAVE_LINKFLAGS([ssl], [crypto], [
259
#include <openssl/ssl.h>
260
#include <openssl/x509.h>
261
#include <openssl/err.h>
262
#include <openssl/rand.h>
263
#include <openssl/des.h>
264
#include <openssl/md4.h>
265
#include <openssl/md5.h>
266
], [SSL_library_init ()])
267
if test x"$LIBSSL" != x
269
AC_MSG_NOTICE([compiling in support for SSL via OpenSSL])
271
elif test x"$with_ssl" != x
273
AC_MSG_ERROR([--with-ssl was given, but SSL is not available.])
289
AC_CHECK_LIB(z, compress)
290
AC_CHECK_LIB(gpg-error, gpg_err_init)
291
AC_CHECK_LIB(gcrypt, gcry_control)
292
AC_CHECK_LIB(gnutls, main)
294
if test x"$ac_cv_lib_gnutls_main" != xno
296
AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
299
AC_MSG_ERROR([--with-ssl was given, but GNUTLS is not available.])
275
301
]) # endif: --with-ssl == no?
276
]) # endif: --with-ssl == gnutls?
302
]) # endif: --with-ssl == openssl?
279
305
dnl Enable NTLM if requested and if SSL is available.
298
dnl Find an MD5 implementation. Since Wget rarely needs MD5, we try
299
dnl to use an existing library implementation to save on code size.
302
if test x"$wget_need_md5" = xyes
304
dnl This should be moved to an AC_DEFUN, but I'm not sure how to
305
dnl manipulate MD5_OBJ from the defun.
310
dnl Check for the system MD5 library on Solaris. We don't check for
311
dnl something simple like "MD5Update" because there are a number of
312
dnl MD5 implementations that use that name, but have an otherwise
313
dnl incompatible interface. md5_calc is, hopefully, specific to the
314
dnl Solaris MD5 library.
315
if test x"$found_md5" = xno; then
316
AC_CHECK_LIB(md5, md5_calc, [
317
dnl Some installations have bogus <md5.h> in the compiler's
318
dnl include path, making the system md5 library useless.
319
AC_MSG_CHECKING([for working md5.h])
320
AC_COMPILE_IFELSE([#include <md5.h>
323
AC_DEFINE([HAVE_SOLARIS_MD5], 1, [Define when using Solaris MD5.])
326
AC_MSG_NOTICE([using the Solaris MD5 implementation])
327
], [AC_MSG_RESULT(no)])
331
dnl Then see if we're linking OpenSSL anyway; if yes, use its md5
333
if test x"$found_md5" = xno; then
334
if test x"$LIBSSL" != x; then
335
AC_DEFINE([HAVE_OPENSSL_MD5], 1, [Define when using OpenSSL MD5.])
337
AC_MSG_NOTICE([using the OpenSSL MD5 implementation])
341
dnl If none of the above worked, use the one we ship with Wget.
342
if test x"$found_md5" = xno; then
343
AC_DEFINE([HAVE_BUILTIN_MD5], 1, [Define when using built-in MD5.])
345
AC_MSG_NOTICE([using the built-in (GNU) MD5 implementation])
348
AC_SUBST(MD5_CPPFLAGS, '-I $(top_srcdir)/md5')
349
AC_SUBST(MD5_LDADD, '../md5/libmd5.a')
350
AC_SUBST(MD5_SUBDIR, md5)
353
AC_DEFINE([HAVE_MD5], 1, [Define if we're compiling support for MD5.])
356
323
dnl **********************************************************************
357
324
dnl Checks for IPv6
358
325
dnl **********************************************************************
361
328
dnl We test for IPv6 by checking, in turn, for availability of
362
dnl getaddrinfo, presence of the INET6 address/protocol family, and
363
dnl the existence of struct sockaddr_in6. If any of them is missing,
364
dnl IPv6 is disabled, and the code reverts to old-style gethostbyname.
329
dnl presence of the INET6 address/protocol family and the existence of
330
dnl struct sockaddr_in6. If any of them is missing, IPv6 is disabled,
331
dnl and the code reverts to old-style gethostbyname.
366
333
dnl If --enable-ipv6 is explicitly specified on the configure command
367
334
dnl line, we check for IPv6 and abort if not found. If --disable-ipv6
428
388
AC_MSG_ERROR([IPv6 support requested but not found; aborting])
433
dnl Set of available languages.
435
dnl Originally this used to be static, looking like this:
436
dnl ALL_LINGUAS="cs de hr it ..."
437
dnl The downside was that configure needed to be rebuilt whenever a
438
dnl new language was added.
440
ALL_LINGUAS="en@quot en@boldquot en_US $(cd ${srcdir}/po && ls *.po | grep -v 'en@.*quot' | grep -v 'en_US\.po' | sed -e 's/\.po$//' | tr '\012' ' ')"
443
392
dnl Find makeinfo. We used to provide support for Emacs processing
444
393
dnl Texinfo using `emacs -batch -eval ...' where makeinfo is