~ubuntu-branches/ubuntu/precise/wget/precise-proposed

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-10-19 00:00:09 UTC
  • mfrom: (2.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20111019000009-8p33w3wz4b1rdri0
Tags: 1.13-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
  - Depend on libssl-dev 0.9.8k-7ubuntu4 (LP: #503339)
* Dropped changes, superseded in Debian:
  - Keep build dependencies in main:
    + debian/control: remove info2man build-dep
    + debian/patches/series: disable wget-infopod_generated_manpage
  - Mark wget Multi-Arch: foreign, so packages that aren't of the same arch
    can depend on it.
* Pass --with-ssl=openssl; we don't want to use gnutls, there's no udeb for
  it.
* Add a second build pass for the udeb, so we can build without libidn.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl Template file for GNU Autoconf
2
 
dnl Copyright (C) 1995, 1996, 1997, 2001, 2007, 2008, 2009 Free Software
3
 
dnl Foundation, Inc.
 
2
dnl Copyright (C) 1995, 1996, 1997, 2001, 2007, 2008, 2009, 2010, 2011
 
3
dnl Free Software Foundation, Inc.
4
4
 
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
31
31
dnl
32
32
 
33
33
AC_INIT([wget],
34
 
        [1.12],
 
34
  [m4_esyscmd([build-aux/bzr-version-gen])],
35
35
        [bug-wget@gnu.org])
36
36
AC_PREREQ(2.61)
37
37
 
43
43
AC_CONFIG_MACRO_DIR([m4])
44
44
AC_CONFIG_AUX_DIR([build-aux])
45
45
 
 
46
AC_CONFIG_SRCDIR([src/wget.h])
 
47
 
46
48
dnl
47
49
dnl Automake setup
48
50
dnl
49
 
AM_INIT_AUTOMAKE(dist-bzip2 dist-lzma 1.9)
 
51
AM_INIT_AUTOMAKE([1.9])
50
52
 
51
53
dnl
52
54
dnl Get cannonical host
84
86
test x"${ENABLE_DEBUG}" = xyes && AC_DEFINE([ENABLE_DEBUG], 1,
85
87
   [Define if you want the debug output support compiled in.])
86
88
 
87
 
wget_need_md5=no
88
 
 
89
 
case "${ENABLE_OPIE}${ENABLE_DIGEST}" in
90
 
*yes*)
91
 
        wget_need_md5=yes
92
 
esac
93
 
 
94
89
dnl
95
90
dnl Find the compiler
96
91
dnl
104
99
AC_AIX
105
100
 
106
101
gl_EARLY
107
 
md5_EARLY
108
102
 
109
103
dnl
110
104
dnl Gettext
171
165
dnl integral types on older systems that fail to provide intN_t and
172
166
dnl uintN_t typedefs.
173
167
dnl
174
 
AC_CHECK_SIZEOF(short)
175
 
AC_CHECK_SIZEOF(int)
176
 
AC_CHECK_SIZEOF(long)
177
 
AC_CHECK_SIZEOF(long long)
178
 
AC_CHECK_SIZEOF(void *)
 
168
AC_CHECK_SIZEOF([short])
 
169
AC_CHECK_SIZEOF([int])
 
170
AC_CHECK_SIZEOF([long])
 
171
AC_CHECK_SIZEOF([long long])
 
172
AC_CHECK_SIZEOF([void *])
179
173
 
180
174
dnl
181
175
dnl Checks for non-universal or system-specific types.
200
194
dnl
201
195
AC_FUNC_MMAP
202
196
AC_FUNC_FSEEKO
203
 
AC_CHECK_FUNCS(strptime timegm snprintf vsnprintf vasprintf drand48)
 
197
AC_CHECK_FUNCS(strptime timegm vsnprintf vasprintf drand48)
204
198
AC_CHECK_FUNCS(strtoll usleep ftello sigblock sigsetjmp memrchr wcwidth mbtowc)
 
199
AC_CHECK_FUNCS(sleep symlink)
205
200
 
206
201
if test x"$ENABLE_OPIE" = xyes; then
207
202
  AC_LIBOBJ([ftp-opie])
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.])
219
213
 
220
214
dnl
221
215
dnl Call Wget-specific macros defined in aclocal.
222
216
dnl
223
217
WGET_STRUCT_UTIMBUF
224
 
WGET_SOCKLEN_T
225
218
WGET_FNMATCH
226
219
WGET_NANOSLEEP
227
220
WGET_POSIX_CLOCK
228
221
WGET_NSL_SOCKET
229
222
 
 
223
dnl Deal with specific hosts
 
224
case $host_os in
 
225
  *mingw32* )
 
226
    LIBS+=' -lws2_32'
 
227
    AC_LIBOBJ([mswindows])
 
228
    ;;
 
229
esac
 
230
 
 
231
 
230
232
dnl
231
233
dnl Checks for libraries.
232
234
dnl
233
235
 
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
240
 
  then
241
 
    AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
242
 
    AC_LIBOBJ([gnutls])
243
 
  else
244
 
    AC_MSG_ERROR([--with-ssl=gnutls was given, but GNUTLS is not available.])
245
 
  fi
246
 
], [
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)
 
239
 
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)
255
246
    ])
256
247
 
 
248
    case $host_os in
 
249
      *mingw32* )
 
250
        dnl prefer link to openssl dlls if possible. if not then fallback on static libs. if not then error
 
251
        
 
252
        AC_CHECK_LIB(eay32, EVP_MD_CTX_init)
 
253
        if test x"$ac_cv_lib_eay32_EVP_MD_CTX_init" != xno
 
254
        then
 
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)])
 
258
          
 
259
        else
 
260
          LIBS+=' -lgdi32'
 
261
          dnl fallback and test static libs
 
262
          
 
263
          AC_CHECK_LIB(crypto, EVP_MD_CTX_init,,,)
 
264
          if test x"$ac_cv_lib_crypto_EVP_MD_CTX_init" != xno
 
265
          then
 
266
            AC_CHECK_LIB(ssl, SSL_connect,, AC_MSG_ERROR([openssl not found]))
 
267
            AC_MSG_NOTICE([Enabling support for SSL via OpenSSL])
 
268
          else
 
269
            AC_MSG_ERROR([openssl not found: shared (eay32/ssl32) or static (crypto/ssl) libs needed])
 
270
          fi
 
271
          
 
272
        fi
 
273
        dnl add zdll lib as dep for above tests?
 
274
      ;;
 
275
      *)
 
276
 
 
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)])
 
281
      ;;
 
282
    esac
 
283
    AC_LIBOBJ([openssl])
 
284
], [
 
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
268
 
    then
269
 
      AC_MSG_NOTICE([compiling in support for SSL via OpenSSL])
270
 
      AC_LIBOBJ([openssl])
271
 
    elif test x"$with_ssl" != x
272
 
    then
273
 
      AC_MSG_ERROR([--with-ssl was given, but SSL is not available.])
 
288
 
 
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)
 
293
 
 
294
    if test x"$ac_cv_lib_gnutls_main" != xno
 
295
    then
 
296
      AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
 
297
      AC_LIBOBJ([gnutls])
 
298
    else
 
299
      AC_MSG_ERROR([--with-ssl was given, but GNUTLS is not available.])
274
300
    fi
275
301
  ]) # endif: --with-ssl == no?
276
 
]) # endif: --with-ssl == gnutls?
 
302
]) # endif: --with-ssl == openssl?
277
303
 
278
304
 
279
305
dnl Enable NTLM if requested and if SSL is available.
294
320
  fi
295
321
fi
296
322
 
297
 
dnl
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.
300
 
dnl
301
 
 
302
 
if test x"$wget_need_md5" = xyes
303
 
then
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.
306
 
 
307
 
  AC_LIBOBJ([gen-md5])
308
 
  found_md5=no
309
 
 
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>
321
 
                        ], [
322
 
        AC_MSG_RESULT(yes)
323
 
        AC_DEFINE([HAVE_SOLARIS_MD5], 1, [Define when using Solaris MD5.])
324
 
        LIBS="-lmd5 $LIBS"
325
 
        found_md5=yes
326
 
        AC_MSG_NOTICE([using the Solaris MD5 implementation])
327
 
      ], [AC_MSG_RESULT(no)])
328
 
    ])
329
 
  fi
330
 
 
331
 
  dnl Then see if we're linking OpenSSL anyway; if yes, use its md5
332
 
  dnl implementation.
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.])
336
 
      found_md5=yes
337
 
      AC_MSG_NOTICE([using the OpenSSL MD5 implementation])
338
 
    fi
339
 
  fi
340
 
 
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.])
344
 
    found_md5=yes
345
 
    AC_MSG_NOTICE([using the built-in (GNU) MD5 implementation])
346
 
    AC_C_BIGENDIAN
347
 
 
348
 
    AC_SUBST(MD5_CPPFLAGS, '-I $(top_srcdir)/md5')
349
 
    AC_SUBST(MD5_LDADD, '../md5/libmd5.a')
350
 
    AC_SUBST(MD5_SUBDIR, md5)
351
 
    md5_INIT
352
 
  fi
353
 
  AC_DEFINE([HAVE_MD5], 1, [Define if we're compiling support for MD5.])
354
 
fi
355
 
 
356
323
dnl **********************************************************************
357
324
dnl Checks for IPv6
358
325
dnl **********************************************************************
359
326
 
360
327
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.
365
332
dnl
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
397
364
)
398
365
 
399
366
if test "X$ipv6" = "Xyes"; then
400
 
  AC_CHECK_FUNCS(getaddrinfo, [], [
401
 
    AC_MSG_NOTICE([Disabling IPv6 support: your system does not support getaddrinfo(3)])
402
 
    ipv6=no
403
 
  ])
404
 
fi
405
 
 
406
 
if test "X$ipv6" = "Xyes"; then
407
367
  PROTO_INET6([], [
408
368
    AC_MSG_NOTICE([Disabling IPv6 support: your system does not support the PF_INET6 protocol family])
409
369
    ipv6=no
428
388
  AC_MSG_ERROR([IPv6 support requested but not found; aborting])
429
389
fi
430
390
 
431
 
 
432
 
dnl
433
 
dnl Set of available languages.
434
 
dnl
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.
439
 
dnl
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' ' ')"
441
 
 
442
391
dnl
443
392
dnl Find makeinfo.  We used to provide support for Emacs processing
444
393
dnl Texinfo using `emacs -batch -eval ...' where makeinfo is
554
503
dnl
555
504
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile util/Makefile
556
505
                 po/Makefile.in tests/Makefile tests/WgetTest.pm
557
 
                 lib/Makefile md5/Makefile windows/Makefile])
 
506
                 lib/Makefile])
558
507
AC_CONFIG_HEADERS([src/config.h])
559
508
AC_OUTPUT