~ubuntu-branches/ubuntu/hardy/wget/hardy-security

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Noèl Köthe
  • Date: 2004-02-13 20:26:44 UTC
  • Revision ID: james.westby@ubuntu.com-20040213202644-skxj93qs15sskqfy
Tags: upstream-1.9.1
Import upstream version 1.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl
 
2
dnl Check for `struct utimbuf'.
 
3
dnl
 
4
 
 
5
AC_DEFUN([WGET_STRUCT_UTIMBUF],
 
6
[AC_MSG_CHECKING([for struct utimbuf])
 
7
if test x"$ac_cv_header_utime_h" = xyes; then
 
8
  AC_EGREP_CPP([struct[         ]+utimbuf],
 
9
    [#include <utime.h>],
 
10
    [AC_DEFINE(HAVE_STRUCT_UTIMBUF)
 
11
      AC_MSG_RESULT(yes)],
 
12
    AC_MSG_RESULT(no))
 
13
else
 
14
  AC_MSG_RESULT(no)
 
15
fi])
 
16
 
 
17
 
 
18
dnl Check for socklen_t.  The third argument of accept, getsockname,
 
19
dnl etc. is int * on some systems, but size_t * on others.  POSIX
 
20
dnl finally standardized on socklen_t, but older systems don't have
 
21
dnl it.  If socklen_t exists, we use it, else if accept() accepts
 
22
dnl size_t *, we use that, else we use int.
 
23
 
 
24
AC_DEFUN([WGET_SOCKLEN_T], [
 
25
  AC_MSG_CHECKING(for socklen_t)
 
26
  AC_TRY_COMPILE([
 
27
#include <sys/types.h>
 
28
#include <sys/socket.h>
 
29
socklen_t x;
 
30
],
 
31
    [], [AC_MSG_RESULT(yes)], [
 
32
      AC_TRY_COMPILE([
 
33
#include <sys/types.h>
 
34
#include <sys/socket.h>
 
35
int accept (int, struct sockaddr *, size_t *);
 
36
],
 
37
      [], [
 
38
      AC_MSG_RESULT(size_t)
 
39
      AC_DEFINE(socklen_t, size_t)
 
40
    ], [
 
41
      AC_MSG_RESULT(int)
 
42
      AC_DEFINE(socklen_t, int)
 
43
    ])
 
44
  ])
 
45
])
 
46
 
 
47
dnl Check whether fnmatch.h can be included.  This doesn't use
 
48
dnl AC_FUNC_FNMATCH because Wget is already careful to only use
 
49
dnl fnmatch on certain OS'es.  However, fnmatch.h is sometimes broken
 
50
dnl even on those because Apache installs its own fnmatch.h to
 
51
dnl /usr/local/include (!), which GCC uses before /usr/include.
 
52
 
 
53
AC_DEFUN([WGET_FNMATCH], [
 
54
  AC_MSG_CHECKING([for working fnmatch.h])
 
55
  AC_COMPILE_IFELSE([#include <fnmatch.h>
 
56
                    ], [
 
57
    AC_MSG_RESULT(yes)
 
58
    AC_DEFINE(HAVE_WORKING_FNMATCH_H)
 
59
  ], [
 
60
    AC_MSG_RESULT(no)
 
61
  ])
 
62
])
 
63
 
 
64
dnl
 
65
dnl ansi2knr support: check whether C prototypes are available.
 
66
dnl
 
67
 
 
68
AC_DEFUN(AM_C_PROTOTYPES,
 
69
[AC_REQUIRE([AM_PROG_CC_STDC])
 
70
AC_BEFORE([$0], [AC_C_INLINE])
 
71
AC_MSG_CHECKING([for function prototypes])
 
72
if test "$am_cv_prog_cc_stdc" != no; then
 
73
  AC_MSG_RESULT(yes)
 
74
  AC_DEFINE(PROTOTYPES)
 
75
  U= ANSI2KNR=
 
76
else
 
77
  AC_MSG_RESULT(no)
 
78
  U=_ ANSI2KNR=./ansi2knr
 
79
  # Ensure some checks needed by ansi2knr itself.
 
80
  AC_HEADER_STDC
 
81
  AC_CHECK_HEADERS(string.h)
 
82
fi
 
83
AC_SUBST(U)dnl
 
84
AC_SUBST(ANSI2KNR)dnl
 
85
])
 
86
 
 
87
 
 
88
# serial 1
 
89
 
 
90
# @defmac AC_PROG_CC_STDC
 
91
# @maindex PROG_CC_STDC
 
92
# @ovindex CC
 
93
# If the C compiler in not in ANSI C mode by default, try to add an option
 
94
# to output variable @code{CC} to make it so.  This macro tries various
 
95
# options that select ANSI C on some system or another.  It considers the
 
96
# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
 
97
# handles function prototypes correctly.
 
98
#
 
99
# If you use this macro, you should check after calling it whether the C
 
100
# compiler has been set to accept ANSI C; if not, the shell variable
 
101
# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
 
102
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
 
103
# program @code{ansi2knr}, which comes with Ghostscript.
 
104
# @end defmac
 
105
 
 
106
AC_DEFUN(AM_PROG_CC_STDC,
 
107
[AC_REQUIRE([AC_PROG_CC])
 
108
AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
 
109
AC_CACHE_VAL(am_cv_prog_cc_stdc,
 
110
[am_cv_prog_cc_stdc=no
 
111
ac_save_CC="$CC"
 
112
# Don't try gcc -ansi; that turns off useful extensions and
 
113
# breaks some systems' header files.
 
114
# AIX                   -qlanglvl=ansi
 
115
# Ultrix and OSF/1      -std1
 
116
# HP-UX                 -Aa -D_HPUX_SOURCE
 
117
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE"
 
118
do
 
119
  CC="$ac_save_CC $ac_arg"
 
120
  AC_TRY_COMPILE(
 
121
[#if !defined(__STDC__)
 
122
choke me
 
123
#endif
 
124
/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
 
125
#ifdef _SEQUENT_
 
126
# include <sys/types.h>
 
127
# include <sys/stat.h>
 
128
#endif
 
129
], [
 
130
int test (int i, double x);
 
131
struct s1 {int (*f) (int a);};
 
132
struct s2 {int (*f) (double a);};],
 
133
[am_cv_prog_cc_stdc="$ac_arg"; break])
 
134
done
 
135
CC="$ac_save_CC"
 
136
])
 
137
AC_MSG_RESULT($am_cv_prog_cc_stdc)
 
138
case "x$am_cv_prog_cc_stdc" in
 
139
  x|xno) ;;
 
140
  *) CC="$CC $am_cv_prog_cc_stdc" ;;
 
141
esac
 
142
])
 
143
 
 
144
 
 
145
dnl ************************************************************
 
146
dnl START OF IPv6 AUTOCONFIGURATION SUPPORT MACROS
 
147
dnl ************************************************************
 
148
 
 
149
AC_DEFUN([TYPE_STRUCT_SOCKADDR_IN6],[
 
150
  ds6_have_sockaddr_in6=
 
151
  AC_CHECK_TYPES([struct sockaddr_in6],[
 
152
    ds6_have_sockaddr_in6=yes
 
153
  ],[
 
154
    ds6_have_sockaddr_in6=no
 
155
  ],[
 
156
#include <sys/types.h>
 
157
#include <sys/socket.h>
 
158
#include <netinet/in.h>
 
159
  ])
 
160
 
 
161
  if test "X$ds6_have_sockaddr_in6" = "Xyes"; then :
 
162
    $1
 
163
  else :
 
164
    $2
 
165
  fi
 
166
])
 
167
 
 
168
 
 
169
AC_DEFUN([MEMBER_SIN6_SCOPE_ID],[
 
170
  AC_REQUIRE([TYPE_STRUCT_SOCKADDR_IN6])
 
171
  
 
172
  ds6_member_sin6_scope_id=
 
173
  if test "X$ds6_have_sockaddr_in6" = "Xyes"; then
 
174
    AC_CHECK_MEMBER([struct sockaddr_in6.sin6_scope_id],[
 
175
      ds6_member_sin6_scope_id=yes
 
176
    ],[
 
177
      ds6_member_sin6_scope_id=no
 
178
    ],[
 
179
#include <sys/types.h>
 
180
#include <sys/socket.h>
 
181
#include <netinet/in.h>
 
182
    ])
 
183
  fi
 
184
 
 
185
  if test "X$ds6_member_sin6_scope_id" = "Xyes"; then
 
186
    AC_DEFINE([HAVE_SOCKADDR_IN6_SCOPE_ID], 1,
 
187
      [Define if struct sockaddr_in6 has the sin6_scope_id member])
 
188
    $1
 
189
  else :
 
190
    $2
 
191
  fi
 
192
])
 
193
 
 
194
 
 
195
AC_DEFUN([PROTO_INET6],[
 
196
  AC_CACHE_CHECK([for INET6 protocol support], [ds6_cv_proto_inet6],[
 
197
    AC_TRY_CPP([
 
198
#include <sys/types.h>
 
199
#include <sys/socket.h>
 
200
 
 
201
#ifndef PF_INET6
 
202
#error Missing PF_INET6
 
203
#endif
 
204
#ifndef AF_INET6
 
205
#error Mlssing AF_INET6
 
206
#endif
 
207
    ],[
 
208
      ds6_cv_proto_inet6=yes
 
209
    ],[
 
210
      ds6_cv_proto_inet6=no
 
211
    ])
 
212
  ])
 
213
 
 
214
  if test "X$ds6_cv_proto_inet6" = "Xyes"; then :
 
215
    $1
 
216
  else :
 
217
    $2
 
218
  fi
 
219
])
 
220
 
 
221
 
 
222
AC_DEFUN([GETADDRINFO_AI_ADDRCONFIG],[
 
223
  AC_CACHE_CHECK([if getaddrinfo supports AI_ADDRCONFIG],
 
224
    [ds6_cv_gai_ai_addrconfig],[
 
225
    AC_TRY_CPP([
 
226
#include <netdb.h>
 
227
 
 
228
#ifndef AI_ADDRCONFIG
 
229
#error Missing AI_ADDRCONFIG
 
230
#endif
 
231
    ],[
 
232
      ds6_cv_gai_ai_addrconfig=yes
 
233
    ],[
 
234
      ds6_cv_gai_ai_addrconfig=no
 
235
    ])
 
236
  ])
 
237
 
 
238
  if test "X$ds6_cv_gai_ai_addrconfig" = "Xyes"; then :
 
239
    $1
 
240
  else :
 
241
    $2
 
242
  fi
 
243
])
 
244
 
 
245
 
 
246
AC_DEFUN([GETADDRINFO_AI_ALL],[
 
247
  AC_CACHE_CHECK([if getaddrinfo supports AI_ALL],[ds6_cv_gai_ai_all],[
 
248
    AC_TRY_CPP([
 
249
#include <netdb.h>
 
250
 
 
251
#ifndef AI_ALL
 
252
#error Missing AI_ALL
 
253
#endif
 
254
    ],[
 
255
      ds6_cv_gai_ai_all=yes
 
256
    ],[
 
257
      ds6_cv_gai_ai_all=no
 
258
    ])
 
259
  ])
 
260
 
 
261
  if test "X$ds6_cv_gai_ai_all" = "Xyes"; then :
 
262
    $1
 
263
  else :
 
264
    $2
 
265
  fi
 
266
])
 
267
 
 
268
 
 
269
AC_DEFUN([GETADDRINFO_AI_V4MAPPED],[
 
270
  AC_CACHE_CHECK([if getaddrinfo supports AI_V4MAPPED],[ds6_cv_gai_ai_v4mapped],[
 
271
    AC_TRY_CPP([
 
272
#include <netdb.h>
 
273
 
 
274
#ifndef AI_V4MAPPED
 
275
#error Missing AI_V4MAPPED
 
276
#endif
 
277
    ],[
 
278
      ds6_cv_gai_ai_v4mapped=yes
 
279
    ],[
 
280
      ds6_cv_gai_ai_v4mapped=no
 
281
    ])
 
282
  ])
 
283
 
 
284
  if test "X$ds6_cv_gai_ai_v4mapped" = "Xyes"; then :
 
285
    $1
 
286
  else :
 
287
    $2
 
288
  fi
 
289
])
 
290
 
 
291
dnl ************************************************************
 
292
dnl END OF IPv6 AUTOCONFIGURATION SUPPORT MACROS
 
293
dnl ************************************************************
 
294
 
 
295
# This code originates from Ulrich Drepper's AM_WITH_NLS.
 
296
 
 
297
AC_DEFUN(WGET_WITH_NLS,
 
298
  [AC_MSG_CHECKING([whether NLS is requested])
 
299
    dnl Default is enabled NLS
 
300
    AC_ARG_ENABLE(nls,
 
301
      [  --disable-nls           do not use Native Language Support],
 
302
      HAVE_NLS=$enableval, HAVE_NLS=yes)
 
303
    AC_MSG_RESULT($HAVE_NLS)
 
304
 
 
305
    dnl If something goes wrong, we may still decide not to use NLS.
 
306
    dnl For this reason, defer AC_SUBST'ing HAVE_NLS until the very
 
307
    dnl last moment.
 
308
 
 
309
    if test x"$HAVE_NLS" = xyes; then
 
310
      AC_MSG_RESULT([language catalogs: $ALL_LINGUAS])
 
311
      AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
312
        [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
 
313
      AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
314
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 
315
      AC_SUBST(MSGFMT)
 
316
      AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
317
      CATOBJEXT=.gmo
 
318
      INSTOBJEXT=.mo
 
319
      DATADIRNAME=share
 
320
 
 
321
      dnl Test whether we really found GNU xgettext.
 
322
      if test "$XGETTEXT" != ":"; then
 
323
        dnl If it is no GNU xgettext we define it as : so that the
 
324
        dnl Makefiles still can work.
 
325
        if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 
326
          : ;
 
327
        else
 
328
          AC_MSG_RESULT(
 
329
            [found xgettext programs is not GNU xgettext; ignore it])
 
330
          XGETTEXT=":"
 
331
        fi
 
332
      fi
 
333
 
 
334
      AC_CHECK_HEADERS(locale.h libintl.h)
 
335
 
 
336
      dnl Prefer gettext found in -lintl to the one in libc.
 
337
      dnl Otherwise it can happen that we include libintl.h from
 
338
      dnl /usr/local/lib, but fail to specify -lintl, which results in
 
339
      dnl link or run-time failures.  (Symptom: libintl_bindtextdomain
 
340
      dnl not found at link-time.)
 
341
 
 
342
      AC_CHECK_LIB(intl, gettext, [
 
343
        dnl gettext is in libintl; announce the fact manually.
 
344
        LIBS="-lintl $LIBS"
 
345
        AC_DEFINE(HAVE_GETTEXT)
 
346
      ], [
 
347
        AC_CHECK_FUNCS(gettext, [], [
 
348
          AC_MSG_RESULT([gettext not found; disabling NLS])
 
349
          HAVE_NLS=no
 
350
        ])
 
351
      ])
 
352
 
 
353
      dnl These rules are solely for the distribution goal.  While doing this
 
354
      dnl we only have to keep exactly one list of the available catalogs
 
355
      dnl in configure.in.
 
356
      for lang in $ALL_LINGUAS; do
 
357
        GMOFILES="$GMOFILES $lang.gmo"
 
358
        POFILES="$POFILES $lang.po"
 
359
      done
 
360
      dnl Construct list of names of catalog files to be constructed.
 
361
      for lang in $ALL_LINGUAS; do
 
362
        CATALOGS="$CATALOGS ${lang}${CATOBJEXT}"
 
363
      done
 
364
 
 
365
      dnl Make all variables we use known to autoconf.
 
366
      AC_SUBST(CATALOGS)
 
367
      AC_SUBST(CATOBJEXT)
 
368
      AC_SUBST(DATADIRNAME)
 
369
      AC_SUBST(GMOFILES)
 
370
      AC_SUBST(INSTOBJEXT)
 
371
      AC_SUBST(INTLLIBS)
 
372
      AC_SUBST(POFILES)
 
373
    fi
 
374
    AC_SUBST(HAVE_NLS)
 
375
    dnl Some independently maintained files, such as po/Makefile.in,
 
376
    dnl use `USE_NLS', so support it.
 
377
    USE_NLS=$HAVE_NLS
 
378
    AC_SUBST(USE_NLS)
 
379
    if test "x$HAVE_NLS" = xyes; then
 
380
      AC_DEFINE(HAVE_NLS)
 
381
    fi
 
382
  ])
 
383
 
 
384
dnl Generate list of files to be processed by xgettext which will
 
385
dnl be included in po/Makefile.
 
386
dnl
 
387
dnl This is not strictly an Autoconf macro, because it is run from
 
388
dnl within `config.status' rather than from within configure.  This
 
389
dnl is why special rules must be applied for it.
 
390
AC_DEFUN(WGET_PROCESS_PO,
 
391
  [
 
392
   dnl I wonder what the following several lines do...
 
393
   if test "x$srcdir" != "x."; then
 
394
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
 
395
       posrcprefix="$srcdir/"
 
396
     else
 
397
       posrcprefix="../$srcdir/"
 
398
     fi
 
399
   else
 
400
     posrcprefix="../"
 
401
   fi
 
402
   rm -f po/POTFILES
 
403
   dnl Use `echo' rather than AC_MSG_RESULT, because this is run from
 
404
   dnl `config.status'.
 
405
   echo "generating po/POTFILES from $srcdir/po/POTFILES.in"
 
406
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\,"  \
 
407
       -e "\$s/\(.*\) \\\\/\1/" \
 
408
        < $srcdir/po/POTFILES.in > po/POTFILES
 
409
   echo "creating po/Makefile"
 
410
   sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
 
411
  ])
 
412
 
 
413
# Search path for a program which passes the given test.
 
414
# Ulrich Drepper <drepper@cygnus.com>, 1996.
 
415
#
 
416
# This file may be copied and used freely without restrictions.  It
 
417
# can be used in projects which are not available under the GNU Public
 
418
# License but which still want to provide support for the GNU gettext
 
419
# functionality.  Please note that the actual code is *not* freely
 
420
# available.
 
421
 
 
422
# serial 1
 
423
 
 
424
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 
425
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
426
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
 
427
[# Extract the first word of "$2", so it can be a program name with args.
 
428
set dummy $2; ac_word=[$]2
 
429
AC_MSG_CHECKING([for $ac_word])
 
430
AC_CACHE_VAL(ac_cv_path_$1,
 
431
[case "[$]$1" in
 
432
  /*)
 
433
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
434
  ;;
 
435
  *)
 
436
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 
437
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
438
    test -z "$ac_dir" && ac_dir=.
 
439
    if test -f $ac_dir/$ac_word; then
 
440
      if [$3]; then
 
441
        ac_cv_path_$1="$ac_dir/$ac_word"
 
442
        break
 
443
      fi
 
444
    fi
 
445
  done
 
446
  IFS="$ac_save_ifs"
 
447
dnl If no 4th arg is given, leave the cache variable unset,
 
448
dnl so AC_PATH_PROGS will keep looking.
 
449
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
450
])dnl
 
451
  ;;
 
452
esac])dnl
 
453
$1="$ac_cv_path_$1"
 
454
if test -n "[$]$1"; then
 
455
  AC_MSG_RESULT([$]$1)
 
456
else
 
457
  AC_MSG_RESULT(no)
 
458
fi
 
459
AC_SUBST($1)dnl
 
460
])
 
461
 
 
462
# Include libtool code.
 
463
 
 
464
builtin(include, libtool.m4)dnl