~ubuntu-branches/ubuntu/edgy/curl/edgy-proposed

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Domenico Andreoli
  • Date: 2004-06-04 19:09:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040604190925-wy048bp31320r2z6
Tags: 7.12.0.is.7.11.2-1
* Reverted to version 7.11.2 (closes: #252348).
* Disabled support for libidn (closes: #252367). This is to leave
  curl in unstable as much similar as possible to the one in testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl $Id: configure.ac,v 1.72 2004/04/25 15:23:23 bagder Exp $
 
2
dnl Process this file with autoconf to produce a configure script.
 
3
 
 
4
AC_PREREQ(2.57)
 
5
 
 
6
dnl We don't know the version number "staticly" so we use a dash here
 
7
AC_INIT(curl, [-], [curl-bug@haxx.se])
 
8
 
 
9
dnl configure script copyright
 
10
AC_COPYRIGHT([Copyright (c) 1998 - 2004 Daniel Stenberg, <daniel@haxx.se>
 
11
This configure script may be copied, distributed and modified under the 
 
12
terms of the curl license; see COPYING for more details])
 
13
 
 
14
AC_CONFIG_SRCDIR([lib/urldata.h])
 
15
AM_CONFIG_HEADER(lib/config.h src/config.h)
 
16
AM_MAINTAINER_MODE
 
17
 
 
18
dnl SED is needed by some of the tools
 
19
AC_PATH_PROG( SED, sed, , $PATH:/usr/bin:/usr/local/bin)
 
20
AC_SUBST(SED)
 
21
 
 
22
dnl AR is used by libtool, and try the odd Solaris path too
 
23
AC_PATH_PROG( AR, ar, , $PATH:/usr/bin:/usr/local/bin:/usr/ccs/bin)
 
24
AC_SUBST(AR)
 
25
 
 
26
dnl figure out the libcurl version
 
27
VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
 
28
AM_INIT_AUTOMAKE(curl,$VERSION)
 
29
AC_MSG_CHECKING([curl version])
 
30
AC_MSG_RESULT($VERSION)
 
31
 
 
32
dnl
 
33
dnl we extract the numerical version for curl-config only
 
34
VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
 
35
AC_SUBST(VERSIONNUM)
 
36
 
 
37
dnl Solaris pkgadd support definitions
 
38
PKGADD_PKG="HAXXcurl"
 
39
PKGADD_NAME="cURL - a client that groks URLs"
 
40
PKGADD_VENDOR="curl.haxx.se"
 
41
AC_SUBST(PKGADD_PKG)
 
42
AC_SUBST(PKGADD_NAME)
 
43
AC_SUBST(PKGADD_VENDOR)
 
44
 
 
45
 
 
46
dnl
 
47
dnl Detect the canonical host and target build environment
 
48
dnl
 
49
 
 
50
AC_CANONICAL_HOST
 
51
dnl Get system canonical name
 
52
AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
 
53
 
 
54
dnl Check for AIX weirdos
 
55
AC_AIX
 
56
 
 
57
dnl Checks for programs.
 
58
AC_PROG_CC
 
59
 
 
60
dnl check for how to do large files
 
61
AC_SYS_LARGEFILE
 
62
 
 
63
dnl check for cygwin stuff
 
64
AC_LIBTOOL_WIN32_DLL
 
65
 
 
66
dnl libtool setup
 
67
AM_PROG_LIBTOOL
 
68
 
 
69
AC_MSG_CHECKING([if we need -no-undefined])
 
70
case $host in
 
71
  *-*-cygwin | *-*-mingw* | *-*-pw32*)
 
72
    need_no_undefined=yes
 
73
    ;;
 
74
  *)
 
75
    need_no_undefined=no
 
76
    ;;
 
77
esac
 
78
AC_MSG_RESULT($need_no_undefined)
 
79
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
 
80
 
 
81
AC_MSG_CHECKING([if we need -mimpure-text])
 
82
case $host in
 
83
  *-*-solaris2*)
 
84
    if test "$GCC" = "yes"; then
 
85
      mimpure="yes"
 
86
    fi
 
87
    ;;
 
88
  *)
 
89
    mimpure=no
 
90
    ;;
 
91
esac
 
92
AC_MSG_RESULT($mimpure)
 
93
AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
 
94
 
 
95
dnl The install stuff has already been taken care of by the automake stuff
 
96
dnl AC_PROG_INSTALL
 
97
AC_PROG_MAKE_SET
 
98
 
 
99
dnl ************************************************************
 
100
dnl switch off particular protocols
 
101
dnl
 
102
AC_MSG_CHECKING([whether to support http])
 
103
AC_ARG_ENABLE(http,
 
104
AC_HELP_STRING([--enable-http],[Enable HTTP support])
 
105
AC_HELP_STRING([--disable-http],[Disable HTTP support]),
 
106
[ case "$enableval" in
 
107
  no)
 
108
       AC_MSG_RESULT(no)
 
109
       AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
 
110
       AC_MSG_WARN([disable HTTP disables FTP over proxy and GOPHER too])
 
111
       AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
 
112
       AC_SUBST(CURL_DISABLE_HTTP)
 
113
       AC_SUBST(CURL_DISABLE_GOPHER)
 
114
       ;;
 
115
  *)   AC_MSG_RESULT(yes)
 
116
       ;;
 
117
  esac ],
 
118
       AC_MSG_RESULT(yes)
 
119
)
 
120
AC_MSG_CHECKING([whether to support ftp])
 
121
AC_ARG_ENABLE(ftp,
 
122
AC_HELP_STRING([--enable-ftp],[Enable FTP support])
 
123
AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
 
124
[ case "$enableval" in
 
125
  no)
 
126
       AC_MSG_RESULT(no)
 
127
       AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
 
128
       AC_SUBST(CURL_DISABLE_FTP)
 
129
       ;;
 
130
  *)   AC_MSG_RESULT(yes)
 
131
       ;;
 
132
  esac ],
 
133
       AC_MSG_RESULT(yes)
 
134
)
 
135
AC_MSG_CHECKING([whether to support gopher])
 
136
AC_ARG_ENABLE(gopher,
 
137
AC_HELP_STRING([--enable-gopher],[Enable GOPHER support])
 
138
AC_HELP_STRING([--disable-gopher],[Disable GOPHER support]),
 
139
[ case "$enableval" in
 
140
  no)
 
141
       AC_MSG_RESULT(no)
 
142
       AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
 
143
       AC_SUBST(CURL_DISABLE_GOPHER)
 
144
       ;;
 
145
  *)   AC_MSG_RESULT(yes)
 
146
       ;;
 
147
  esac ],
 
148
       AC_MSG_RESULT(yes)
 
149
)
 
150
AC_MSG_CHECKING([whether to support file])
 
151
AC_ARG_ENABLE(file,
 
152
AC_HELP_STRING([--enable-file],[Enable FILE support])
 
153
AC_HELP_STRING([--disable-file],[Disable FILE support]),
 
154
[ case "$enableval" in
 
155
  no)
 
156
       AC_MSG_RESULT(no)
 
157
       AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
 
158
       AC_SUBST(CURL_DISABLE_FILE)
 
159
       ;;
 
160
  *)   AC_MSG_RESULT(yes)
 
161
       ;;
 
162
  esac ],
 
163
       AC_MSG_RESULT(yes)
 
164
)
 
165
AC_MSG_CHECKING([whether to support ldap])
 
166
AC_ARG_ENABLE(ldap,
 
167
AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
 
168
AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
 
169
[ case "$enableval" in
 
170
  no)
 
171
       AC_MSG_RESULT(no)
 
172
       AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
 
173
       AC_SUBST(CURL_DISABLE_LDAP)
 
174
       ;;
 
175
  *)   AC_MSG_RESULT(yes)
 
176
       ;;
 
177
  esac ],
 
178
       AC_MSG_RESULT(yes)
 
179
)
 
180
AC_MSG_CHECKING([whether to support dict])
 
181
AC_ARG_ENABLE(dict,
 
182
AC_HELP_STRING([--enable-dict],[Enable DICT support])
 
183
AC_HELP_STRING([--disable-dict],[Disable DICT support]),
 
184
[ case "$enableval" in
 
185
  no)
 
186
       AC_MSG_RESULT(no)
 
187
       AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
 
188
       AC_SUBST(CURL_DISABLE_DICT)
 
189
       ;;
 
190
  *)   AC_MSG_RESULT(yes)
 
191
       ;;
 
192
  esac ],
 
193
       AC_MSG_RESULT(yes)
 
194
)
 
195
AC_MSG_CHECKING([whether to support telnet])
 
196
AC_ARG_ENABLE(telnet,
 
197
AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
 
198
AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
 
199
[ case "$enableval" in
 
200
  no)
 
201
       AC_MSG_RESULT(no)
 
202
       AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
 
203
       AC_SUBST(CURL_DISABLE_TELNET)
 
204
       ;;
 
205
  *)   AC_MSG_RESULT(yes)
 
206
       ;;
 
207
  esac ],
 
208
       AC_MSG_RESULT(yes)
 
209
)
 
210
 
 
211
dnl **********************************************************************
 
212
dnl Check for built-in manual
 
213
dnl **********************************************************************
 
214
 
 
215
AC_MSG_CHECKING([whether to provide built-in manual])
 
216
AC_ARG_ENABLE(manual,
 
217
AC_HELP_STRING([--enable-manual],[Enable built-in manual])
 
218
AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
 
219
[ case "$enableval" in
 
220
  no)
 
221
       AC_MSG_RESULT(no)
 
222
       ;;
 
223
  *)   AC_MSG_RESULT(yes)
 
224
       USE_MANUAL="1"
 
225
       ;;
 
226
  esac ],
 
227
       AC_MSG_RESULT(yes)
 
228
       USE_MANUAL="1"
 
229
)
 
230
dnl The actual use of the USE_MANUAL variable is done much later in this
 
231
dnl script to allow other actions to disable it as well.
 
232
 
 
233
 
 
234
dnl **********************************************************************
 
235
dnl Checks for libraries.
 
236
dnl **********************************************************************
 
237
 
 
238
dnl gethostbyname without lib or in the nsl lib?
 
239
AC_CHECK_FUNC(gethostbyname,
 
240
              [HAVE_GETHOSTBYNAME="1"
 
241
              ],
 
242
              [ AC_CHECK_LIB(nsl, gethostbyname,
 
243
                             [HAVE_GETHOSTBYNAME="1"
 
244
                             LIBS="$LIBS -lnsl"
 
245
                             ])
 
246
              ])
 
247
 
 
248
if test "$HAVE_GETHOSTBYNAME" != "1"
 
249
then
 
250
  dnl gethostbyname in the socket lib?
 
251
  AC_CHECK_LIB(socket, gethostbyname,
 
252
               [HAVE_GETHOSTBYNAME="1"
 
253
               LIBS="$LIBS -lsocket"
 
254
               ])
 
255
fi
 
256
 
 
257
dnl At least one system has been identified to require BOTH nsl and socket
 
258
dnl libs at the same time to link properly.
 
259
if test "$HAVE_GETHOSTBYNAME" != "1"
 
260
then
 
261
  AC_MSG_CHECKING([trying gethostbyname with both nsl and socket libs])
 
262
  my_ac_save_LIBS=$LIBS
 
263
  LIBS="-lnsl -lsocket $LIBS"
 
264
  AC_TRY_LINK( ,
 
265
             [gethostbyname();],
 
266
             [ dnl found it!
 
267
             HAVE_GETHOSTBYNAME="1",
 
268
             AC_MSG_RESULT([yes])],
 
269
             [ dnl failed!
 
270
             AC_MSG_RESULT([no])
 
271
             dnl restore LIBS
 
272
             LIBS=$my_ac_save_LIBS]
 
273
             )
 
274
fi
 
275
 
 
276
if test "$HAVE_GETHOSTBYNAME" != "1"
 
277
then
 
278
  dnl This is for Msys/Mingw
 
279
  AC_MSG_CHECKING([for gethostbyname in ws2_32])
 
280
  my_ac_save_LIBS=$LIBS
 
281
  LIBS="-lws2_32 $LIBS"
 
282
  AC_TRY_LINK([#include <winsock2.h>],
 
283
               [gethostbyname("www.dummysite.com");],
 
284
               [ dnl worked!
 
285
               AC_MSG_RESULT([yes])
 
286
               HAVE_GETHOSTBYNAME="1"],
 
287
               [ dnl failed, restore LIBS
 
288
               LIBS=$my_ac_save_LIBS
 
289
               AC_MSG_RESULT(no)]
 
290
             )
 
291
fi
 
292
 
 
293
if test "$HAVE_GETHOSTBYNAME" = "1"; then
 
294
  AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
 
295
else
 
296
  AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
 
297
fi
 
298
 
 
299
dnl resolve lib?
 
300
AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
 
301
 
 
302
if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
 
303
  AC_CHECK_LIB(resolve, strcasecmp,
 
304
              [LIBS="-lresolve $LIBS"],
 
305
               ,
 
306
               -lnsl)
 
307
fi
 
308
 
 
309
dnl socket lib?
 
310
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
 
311
 
 
312
dnl dl lib?
 
313
AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ])
 
314
 
 
315
AC_MSG_CHECKING([whether to use libgcc])
 
316
AC_ARG_ENABLE(libgcc,
 
317
AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
 
318
[ case "$enableval" in
 
319
  yes)
 
320
        LIBS="$LIBS -lgcc"
 
321
       AC_MSG_RESULT(yes)
 
322
       ;;
 
323
  *)   AC_MSG_RESULT(no)
 
324
       ;;
 
325
  esac ],
 
326
       AC_MSG_RESULT(no)
 
327
)
 
328
 
 
329
dnl **********************************************************************
 
330
dnl Check for the presence of the winmm library.
 
331
dnl **********************************************************************
 
332
 
 
333
AC_MSG_CHECKING([for timeGetTime in winmm])
 
334
my_ac_save_LIBS=$LIBS
 
335
LIBS="-lwinmm $LIBS"
 
336
AC_TRY_LINK([#include <windef.h>
 
337
             #include <mmsystem.h>
 
338
             ],
 
339
             [timeGetTime();],
 
340
             [ dnl worked!
 
341
             AC_MSG_RESULT([yes])
 
342
             ],
 
343
             [ dnl failed, restore LIBS
 
344
             LIBS=$my_ac_save_LIBS
 
345
             AC_MSG_RESULT(no)]
 
346
           )
 
347
 
 
348
dnl **********************************************************************
 
349
dnl Checks for IPv6
 
350
dnl **********************************************************************
 
351
 
 
352
AC_MSG_CHECKING([whether to enable ipv6])
 
353
AC_ARG_ENABLE(ipv6,
 
354
AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
 
355
AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
 
356
[ case "$enableval" in
 
357
  no)
 
358
       AC_MSG_RESULT(no)
 
359
       ipv6=no
 
360
       ;;
 
361
  *)   AC_MSG_RESULT(yes)
 
362
       ipv6=yes
 
363
       ;;
 
364
  esac ],
 
365
 
 
366
  AC_TRY_RUN([ /* is AF_INET6 available? */
 
367
#include <sys/types.h>
 
368
#include <sys/socket.h>
 
369
main()
 
370
{
 
371
 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
 
372
   exit(1);
 
373
 else
 
374
   exit(0);
 
375
}
 
376
],
 
377
  AC_MSG_RESULT(yes)
 
378
  ipv6=yes,
 
379
  AC_MSG_RESULT(no)
 
380
  ipv6=no,
 
381
  AC_MSG_RESULT(no)
 
382
  ipv6=no
 
383
))
 
384
 
 
385
if test "$ipv6" = "yes"; then
 
386
  CURL_CHECK_WORKING_GETADDRINFO
 
387
 
 
388
  CURL_CHECK_NI_WITHSCOPEID
 
389
fi
 
390
 
 
391
dnl **********************************************************************
 
392
dnl Check how non-blocking sockets are set
 
393
dnl **********************************************************************
 
394
AC_ARG_ENABLE(nonblocking,
 
395
AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it])
 
396
AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]),
 
397
[
 
398
  if test "$enableval" = "no" ; then
 
399
    AC_MSG_WARN([non-blocking sockets disabled])
 
400
    AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
 
401
    [to disable NON-BLOCKING connections])
 
402
  else
 
403
    CURL_CHECK_NONBLOCKING_SOCKET
 
404
  fi
 
405
],
 
406
[
 
407
  CURL_CHECK_NONBLOCKING_SOCKET
 
408
])
 
409
 
 
410
dnl **********************************************************************
 
411
dnl Check for the random seed preferences 
 
412
dnl **********************************************************************
 
413
 
 
414
AC_ARG_WITH(egd-socket,
 
415
AC_HELP_STRING([--with-egd-socket=FILE],
 
416
               [Entropy Gathering Daemon socket pathname]),
 
417
    [ EGD_SOCKET="$withval" ]
 
418
)
 
419
if test -n "$EGD_SOCKET" ; then
 
420
        AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
 
421
        [your Entropy Gathering Daemon socket pathname] )
 
422
fi
 
423
 
 
424
dnl Check for user-specified random device
 
425
AC_ARG_WITH(random,
 
426
AC_HELP_STRING([--with-random=FILE],[read randomness from FILE (default=/dev/urandom)]),
 
427
    [ RANDOM_FILE="$withval" ],
 
428
    [
 
429
        dnl Check for random device
 
430
        AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
 
431
    ]
 
432
)
 
433
if test -n "$RANDOM_FILE" ; then
 
434
        AC_SUBST(RANDOM_FILE)
 
435
        AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
 
436
        [a suitable file to read random data from])
 
437
fi
 
438
 
 
439
dnl **********************************************************************
 
440
dnl Check if the operating system allows programs to write to their own argv[]
 
441
dnl **********************************************************************
 
442
 
 
443
AC_MSG_CHECKING([if argv can be written to])
 
444
AC_CACHE_VAL(curl_cv_writable_argv, [
 
445
AC_RUN_IFELSE([[
 
446
int main(int argc, char ** argv) {
 
447
        argv[0][0] = ' ';
 
448
        return (argv[0][0] == ' ')?0:1;
 
449
}
 
450
        ]],
 
451
        curl_cv_writable_argv=yes,
 
452
        curl_cv_writable_argv=no,
 
453
        curl_cv_writable_argv=cross)
 
454
])
 
455
case $curl_cv_writable_argv in
 
456
yes)
 
457
        AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
 
458
        AC_MSG_RESULT(yes)
 
459
        ;;
 
460
no)
 
461
        AC_MSG_RESULT(no)
 
462
        ;;
 
463
*)
 
464
        AC_MSG_RESULT(no)
 
465
        AC_MSG_WARN([the previous check could not be made default was used])
 
466
        ;;
 
467
esac
 
468
 
 
469
dnl **********************************************************************
 
470
dnl Check for the presence of Kerberos4 libraries and headers
 
471
dnl **********************************************************************
 
472
 
 
473
AC_ARG_WITH(krb4-includes,
 
474
AC_HELP_STRING([--with-krb4-includes=DIR],
 
475
               [Specify location of kerberos4 headers]),[
 
476
 CPPFLAGS="$CPPFLAGS -I$withval"
 
477
 KRB4INC="$withval"
 
478
 want_krb4=yes
 
479
 ])
 
480
 
 
481
AC_ARG_WITH(krb4-libs,
 
482
AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
 
483
 LDFLAGS="$LDFLAGS -L$withval"
 
484
 KRB4LIB="$withval"
 
485
 want_krb4=yes
 
486
 ])
 
487
 
 
488
 
 
489
OPT_KRB4=off
 
490
AC_ARG_WITH(krb4,dnl
 
491
AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
 
492
  OPT_KRB4="$withval"
 
493
  if test X"$OPT_KRB4" != Xyes
 
494
  then
 
495
    LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
 
496
    KRB4LIB="$OPT_KRB4/lib$libsuff"
 
497
    CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
 
498
    KRB4INC="$OPT_KRB4/include"
 
499
  fi
 
500
  want_krb4="yes"
 
501
 ])
 
502
 
 
503
AC_MSG_CHECKING([if Kerberos4 support is requested])
 
504
 
 
505
if test "$want_krb4" = yes
 
506
then
 
507
  if test "$ipv6" = "yes"; then
 
508
    echo krb4 is not compatible with IPv6
 
509
    exit 1
 
510
  fi
 
511
  AC_MSG_RESULT(yes)
 
512
 
 
513
  dnl Check for & handle argument to --with-krb4
 
514
 
 
515
  AC_MSG_CHECKING(where to look for Kerberos4)
 
516
  if test X"$OPT_KRB4" = Xyes
 
517
  then
 
518
    AC_MSG_RESULT([defaults])
 
519
  else
 
520
    AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
 
521
  fi
 
522
 
 
523
  dnl Check for DES library
 
524
  AC_CHECK_LIB(des, des_pcbc_encrypt,
 
525
  [
 
526
    AC_CHECK_HEADERS(des.h)
 
527
 
 
528
    dnl resolv lib?
 
529
    AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
 
530
 
 
531
    dnl Check for the Kerberos4 library
 
532
    AC_CHECK_LIB(krb, krb_net_read,
 
533
    [
 
534
      dnl Check for header files
 
535
      AC_CHECK_HEADERS(krb.h)
 
536
 
 
537
      dnl we found the required libraries, add to LIBS
 
538
      LIBS="-lkrb -ldes $LIBS"
 
539
 
 
540
      dnl Check for function krb_get_our_ip_for_realm
 
541
      dnl this is needed for NAT networks
 
542
      AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
 
543
 
 
544
      dnl add define KRB4
 
545
      AC_DEFINE(HAVE_KRB4, 1,
 
546
      [if you have the Kerberos4 libraries (including -ldes)])
 
547
 
 
548
      dnl substitute it too!
 
549
      KRB4_ENABLED=1
 
550
      AC_SUBST(KRB4_ENABLED)
 
551
 
 
552
      dnl the krb4 stuff needs a strlcpy()
 
553
      AC_CHECK_FUNCS(strlcpy)
 
554
 
 
555
    ])
 
556
  ])
 
557
else
 
558
  AC_MSG_RESULT(no)
 
559
fi
 
560
 
 
561
dnl **********************************************************************
 
562
dnl Check for FBopenssl(SPNEGO) libraries
 
563
dnl **********************************************************************
 
564
 
 
565
AC_ARG_WITH(spnego,
 
566
  AC_HELP_STRING([--with-spnego=DIR],
 
567
                 [Specify location of SPNEGO library fbopenssl]),
 
568
  [ SPNEGO_ROOT="$withval"
 
569
    want_spnego="yes" ]
 
570
)
 
571
AC_MSG_CHECKING([if SPNEGO support is requested])
 
572
if test x"$want_spnego" = xyes; then
 
573
 
 
574
  if test X"$SPNEGO_ROOT" = Xyes; then
 
575
     AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
 
576
     AC_MSG_RESULT(no)
 
577
  else
 
578
     if test -z "$SPNEGO_LIB_DIR"; then
 
579
        LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
 
580
     else
 
581
        LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
 
582
     fi
 
583
 
 
584
     AC_MSG_RESULT(yes)
 
585
     AC_DEFINE(HAVE_SPNEGO, 1, [Define this if you have the SPNEGO library fbopenssl])
 
586
  fi
 
587
else
 
588
  AC_MSG_RESULT(no)
 
589
fi
 
590
 
 
591
dnl **********************************************************************
 
592
dnl Check for GSS-API libraries
 
593
dnl **********************************************************************
 
594
 
 
595
AC_ARG_WITH(gssapi-includes,
 
596
  AC_HELP_STRING([--with-gssapi-includes=DIR],
 
597
                 [Specify location of GSSAPI header]),
 
598
  [ GSSAPI_INCS="-I$withval" 
 
599
    want_gss="yes" ]
 
600
)
 
601
 
 
602
AC_ARG_WITH(gssapi-libs,
 
603
  AC_HELP_STRING([--with-gssapi-libs=DIR],
 
604
                 [Specify location of GSSAPI libs]),
 
605
  [ GSSAPI_LIBS="-L$withval -lgssapi"
 
606
    want_gss="yes" ]
 
607
)
 
608
 
 
609
AC_ARG_WITH(gssapi,
 
610
  AC_HELP_STRING([--with-gssapi=DIR],
 
611
                 [Where to look for GSSAPI]),
 
612
  [ GSSAPI_ROOT="$withval"
 
613
    want_gss="yes" ]
 
614
)
 
615
 
 
616
AC_MSG_CHECKING([if GSSAPI support is requested])
 
617
if test x"$want_gss" = xyes; then
 
618
  if test -z "$GSSAPI_INCS"; then
 
619
     if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
 
620
        GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
 
621
     else
 
622
        GSSAPI_INCS="-I$GSSAPI_ROOT/include"
 
623
     fi
 
624
  fi
 
625
  CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
 
626
  
 
627
  if test -z "$GSSAPI_LIB_DIR"; then
 
628
     if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
 
629
        gss_ldflags=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
 
630
        LDFLAGS="$LDFLAGS $gss_ldflags"
 
631
     else
 
632
        LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff -lgssapi"
 
633
     fi
 
634
  else
 
635
     LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
 
636
  fi
 
637
 
 
638
  AC_MSG_RESULT(yes)
 
639
  AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
 
640
 
 
641
  if test -n "$GSSAPI_INCS"; then
 
642
    # cut off the preceding -I from the include path
 
643
    GSSAPI_INCS=`echo $GSSAPI_INCS | sed -e s/^-I//g`
 
644
  fi
 
645
 
 
646
  if test -f "$GSSAPI_INCS/gssapi.h"; then
 
647
      AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
 
648
  else
 
649
      AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
 
650
  fi
 
651
  
 
652
else
 
653
  AC_MSG_RESULT(no)
 
654
fi
 
655
  
 
656
 
 
657
dnl Detect the pkg-config tool, as it may have extra info about the
 
658
dnl openssl installation we can use. I *believe* this is what we are
 
659
dnl expected to do on really recent Redhat Linux hosts.
 
660
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
 
661
if test "$PKGCONFIG" != "no" ; then
 
662
  AC_MSG_CHECKING([for OpenSSL options using pkg-config])
 
663
 
 
664
  $PKGCONFIG --exists openssl
 
665
  SSL_EXISTS=$?
 
666
 
 
667
  if test "$SSL_EXISTS" -eq "0"; then
 
668
    SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
 
669
    SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
 
670
    SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
 
671
 
 
672
    LIBS="$LIBS $SSL_LIBS"
 
673
    CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
 
674
    LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
 
675
 
 
676
    AC_MSG_RESULT([yes])
 
677
  else
 
678
    AC_MSG_RESULT([no])
 
679
  fi
 
680
 
 
681
fi
 
682
 
 
683
dnl **********************************************************************
 
684
dnl Check for the presence of SSL libraries and headers
 
685
dnl **********************************************************************
 
686
 
 
687
dnl Default to compiler & linker defaults for SSL files & libraries.
 
688
OPT_SSL=off
 
689
dnl Default to no CA bundle
 
690
ca="no"
 
691
AC_ARG_WITH(ssl,dnl
 
692
AC_HELP_STRING([--with-ssl=PATH],[where to look for SSL, PATH points to the SSL installation (default: /usr/local/ssl)])
 
693
AC_HELP_STRING([--without-ssl], [disable SSL]),
 
694
  OPT_SSL=$withval)
 
695
 
 
696
if test X"$OPT_SSL" = Xno
 
697
then
 
698
  AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more])  
 
699
else
 
700
 
 
701
  dnl Check for and handle argument to --with-ssl.
 
702
 
 
703
  dnl save the pre-ssl check flags for a while
 
704
  CLEANLDFLAGS="$LDFLAGS"
 
705
  CLEANCPPFLAGS="$CPPFLAGS"
 
706
 
 
707
  case "$OPT_SSL" in
 
708
  yes)
 
709
    EXTRA_SSL=/usr/local/ssl ;;
 
710
  off)
 
711
    EXTRA_SSL= ;;
 
712
  *)
 
713
    dnl check the given spot right away!
 
714
    EXTRA_SSL=$OPT_SSL
 
715
    LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib$libsuff"
 
716
    CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
 
717
    ;;
 
718
  esac
 
719
 
 
720
  AC_CHECK_LIB(crypto, CRYPTO_lock,[
 
721
     HAVECRYPTO="yes"
 
722
     ],[
 
723
     OLDLDFLAGS="$LDFLAGS"
 
724
     OLDCPPFLAGS="$CPPFLAGS"
 
725
     LDFLAGS="$CLEANLDFLAGS -L$EXTRA_SSL/lib$libsuff"
 
726
     CPPFLAGS="$CLEANCPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
 
727
     AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
 
728
       HAVECRYPTO="yes" ], [
 
729
       LDFLAGS="$OLDLDFLAGS"
 
730
       CPPFLAGS="$OLDCPPFLAGS"
 
731
       ])
 
732
    ])
 
733
 
 
734
 
 
735
  if test "$HAVECRYPTO" = "yes"; then
 
736
    dnl This is only reasonable to do if crypto actually is there: check for
 
737
    dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
 
738
 
 
739
    dnl This is for Msys/Mingw
 
740
    AC_MSG_CHECKING([for gdi32])
 
741
    my_ac_save_LIBS=$LIBS
 
742
    LIBS="-lgdi32 $LIBS"
 
743
    AC_TRY_LINK([#include <windef.h>
 
744
                 #include <wingdi.h>],
 
745
               [GdiFlush();],
 
746
               [ dnl worked!
 
747
               AC_MSG_RESULT([yes])],
 
748
               [ dnl failed, restore LIBS
 
749
               LIBS=$my_ac_save_LIBS
 
750
               AC_MSG_RESULT(no)]
 
751
              )
 
752
 
 
753
    AC_CHECK_LIB(crypto, CRYPTO_add_lock)
 
754
    AC_CHECK_LIB(ssl, SSL_connect)
 
755
 
 
756
    if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
 
757
        dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
 
758
        AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
 
759
        OLIBS=$LIBS
 
760
        LIBS="$LIBS -lRSAglue -lrsaref"
 
761
        AC_CHECK_LIB(ssl, SSL_connect)
 
762
        if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
 
763
            dnl still no SSL_connect
 
764
            AC_MSG_RESULT(no)
 
765
            LIBS=$OLIBS
 
766
        else
 
767
            AC_MSG_RESULT(yes)
 
768
        fi
 
769
    fi
 
770
 
 
771
 
 
772
    dnl Check for SSLeay headers
 
773
    AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
 
774
                     openssl/pem.h openssl/ssl.h openssl/err.h,
 
775
      OPENSSL_ENABLED=1)
 
776
 
 
777
    if test $ac_cv_header_openssl_x509_h = no; then
 
778
      AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h,
 
779
        OPENSSL_ENABLED=1)
 
780
    fi
 
781
 
 
782
    dnl If the ENGINE library seems to be around, check for the OpenSSL engine
 
783
    dnl header, it is kind of "separated" from the main SSL check
 
784
    AC_CHECK_FUNC(ENGINE_init, [ AC_CHECK_HEADERS(openssl/engine.h) ])
 
785
 
 
786
    AC_SUBST(OPENSSL_ENABLED)
 
787
 
 
788
    AC_MSG_CHECKING([CA cert bundle install path])
 
789
 
 
790
    AC_ARG_WITH(ca-bundle,
 
791
AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
 
792
AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
 
793
    [ ca="$withval" ],
 
794
    [
 
795
      if test "x$prefix" != xNONE; then
 
796
        ca="\${prefix}/share/curl/curl-ca-bundle.crt"
 
797
      else
 
798
        ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
 
799
      fi
 
800
    ] )
 
801
 
 
802
    if test X"$OPT_SSL" = Xno; then
 
803
      ca="no"
 
804
    fi
 
805
 
 
806
    if test "x$ca" != "xno"; then
 
807
      CURL_CA_BUNDLE='"'$ca'"'
 
808
      AC_SUBST(CURL_CA_BUNDLE)  
 
809
    fi
 
810
    AC_MSG_RESULT([$ca])
 
811
 
 
812
    dnl these can only exist if openssl exists
 
813
 
 
814
    AC_CHECK_FUNCS( RAND_status \
 
815
                    RAND_screen \
 
816
                    RAND_egd \
 
817
                    CRYPTO_cleanup_all_ex_data )
 
818
 
 
819
  fi
 
820
 
 
821
  if test X"$OPT_SSL" != Xoff &&
 
822
     test "$OPENSSL_ENABLED" != "1"; then
 
823
    AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
 
824
  fi
 
825
 
 
826
fi
 
827
 
 
828
AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
 
829
 
 
830
dnl **********************************************************************
 
831
dnl Check for the presence of ZLIB libraries and headers
 
832
dnl **********************************************************************
 
833
 
 
834
dnl Check for & handle argument to --with-zlib.
 
835
 
 
836
_cppflags=$CPPFLAGS
 
837
_ldflags=$LDFLAGS
 
838
OPT_ZLIB="/usr/local"
 
839
AC_ARG_WITH(zlib,
 
840
AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
 
841
AC_HELP_STRING([--without-zlib],[disable use of zlib]),
 
842
               [OPT_ZLIB="$withval"])
 
843
 
 
844
case "$OPT_ZLIB" in
 
845
  no)
 
846
    AC_MSG_WARN([zlib disabled]) ;;
 
847
  *)
 
848
    dnl check for the lib first without setting any new path, since many
 
849
    dnl people have it in the default path
 
850
 
 
851
    AC_CHECK_LIB(z, inflateEnd,
 
852
                   dnl libz found, set the variable
 
853
                   [HAVE_LIBZ="1"],
 
854
                   dnl if no lib found, try to add the given library
 
855
                   [if test -d "$OPT_ZLIB"; then
 
856
                      CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
 
857
                      LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
 
858
                   fi])
 
859
 
 
860
    AC_CHECK_HEADER(zlib.h,
 
861
      [
 
862
      dnl zlib.h was found
 
863
      HAVE_ZLIB_H="1"
 
864
      dnl if the lib wasn't found already, try again with the new paths
 
865
      if test "$HAVE_LIBZ" != "1"; then
 
866
        AC_CHECK_LIB(z, gzread,
 
867
                     [
 
868
                     dnl the lib was found!
 
869
                     HAVE_LIBZ="1"
 
870
                     ],
 
871
                     [ CPPFLAGS=$_cppflags
 
872
                     LDFLAGS=$_ldflags])
 
873
      fi
 
874
      ],
 
875
      [
 
876
        dnl zlib.h was not found, restore the flags
 
877
        CPPFLAGS=$_cppflags
 
878
        LDFLAGS=$_ldflags]
 
879
      )
 
880
 
 
881
    if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
 
882
    then
 
883
      AC_MSG_WARN([configure found only the libz lib, not the header file!])
 
884
    elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
 
885
    then
 
886
      AC_MSG_WARN([configure found only the libz header file, not the lib!])
 
887
    elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
 
888
    then
 
889
      dnl both header and lib were found!
 
890
      AC_SUBST(HAVE_LIBZ)
 
891
      AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
 
892
      AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
 
893
 
 
894
      LIBS="$LIBS -lz"
 
895
 
 
896
      dnl replace 'HAVE_LIBZ' in the automake makefile.ams
 
897
      AMFIXLIB="1"
 
898
      AC_MSG_NOTICE([found both libz and libz.h header])
 
899
    fi
 
900
    ;;
 
901
esac
 
902
 
 
903
dnl set variable for use in automakefile(s)
 
904
AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
 
905
 
 
906
dnl Default is to try the thread-safe versions of a few functions
 
907
OPT_THREAD=on
 
908
 
 
909
dnl detect AIX 4.3 or later
 
910
dnl see full docs on this reasoning in the lib/hostip.c source file
 
911
AC_MSG_CHECKING([AIX 4.3 or later])
 
912
AC_PREPROC_IFELSE([
 
913
#if defined(_AIX) && defined(_AIX43)
 
914
printf("just fine");
 
915
#else
 
916
#error "this is not AIX 4.3 or later"
 
917
#endif
 
918
],
 
919
 [ AC_MSG_RESULT([yes])
 
920
   RECENTAIX=yes
 
921
   OPT_THREAD=off ],
 
922
 [ AC_MSG_RESULT([no]) ]
 
923
)
 
924
 
 
925
AC_ARG_ENABLE(thread,dnl
 
926
AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
 
927
AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
 
928
[ case "$enableval" in
 
929
  no)
 
930
    OPT_THREAD=off
 
931
    AC_MSG_WARN(libcurl will not get built using thread-safe functions)
 
932
    ;;
 
933
  *)
 
934
    ;;
 
935
  esac
 
936
]
 
937
)
 
938
 
 
939
if test X"$OPT_THREAD" = Xoff
 
940
then
 
941
  AC_DEFINE(DISABLED_THREADSAFE, 1, \
 
942
Set to explicitly specify we don't want to use thread-safe functions)
 
943
else
 
944
  if test "$ipv6" != "yes"; then
 
945
    dnl dig around for gethostbyname_r()
 
946
    CURL_CHECK_GETHOSTBYNAME_R()
 
947
 
 
948
    dnl dig around for gethostbyaddr_r()
 
949
    CURL_CHECK_GETHOSTBYADDR_R()
 
950
  fi
 
951
 
 
952
  dnl poke around for inet_ntoa_r()
 
953
  CURL_CHECK_INET_NTOA_R()
 
954
 
 
955
  dnl is there a localtime_r()
 
956
  CURL_CHECK_LOCALTIME_R()
 
957
 
 
958
  dnl is there a strerror_r()
 
959
  CURL_CHECK_STRERROR_R()
 
960
 
 
961
  AC_CHECK_FUNCS( gmtime_r )
 
962
fi
 
963
 
 
964
dnl for recent AIX versions, we skip all the thread-safe checks above since
 
965
dnl they claim a thread-safe libc using the standard API. But there are
 
966
dnl some functions still not thread-safe. Check for these!
 
967
 
 
968
dnl Let's hope this split URL remains working:
 
969
dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
 
970
dnl genprogc/thread_quick_ref.htm
 
971
 
 
972
if test "x$RECENTAIX" = "xyes"; then
 
973
  dnl is there a localtime_r()
 
974
  CURL_CHECK_LOCALTIME_R()
 
975
 
 
976
  dnl is there a strerror_r()
 
977
  CURL_CHECK_STRERROR_R()
 
978
 
 
979
  AC_CHECK_FUNCS( gmtime_r )
 
980
fi
 
981
 
 
982
 
 
983
dnl **********************************************************************
 
984
dnl Back to "normal" configuring
 
985
dnl **********************************************************************
 
986
 
 
987
dnl Checks for header files.
 
988
AC_HEADER_STDC
 
989
 
 
990
dnl First check for the very most basic headers. Then we can use these
 
991
dnl ones as default-headers when checking for the rest!
 
992
AC_CHECK_HEADERS(
 
993
        sys/types.h \
 
994
        sys/time.h \
 
995
        sys/select.h \
 
996
        sys/socket.h \
 
997
        sys/ioctl.h \
 
998
        assert.h \
 
999
        unistd.h \
 
1000
        malloc.h \
 
1001
        stdlib.h \
 
1002
        limits.h \
 
1003
        arpa/inet.h \
 
1004
        net/if.h \
 
1005
        netinet/in.h \
 
1006
        netinet/tcp.h \
 
1007
        netdb.h \
 
1008
        sys/sockio.h \
 
1009
        sys/stat.h \
 
1010
        sys/param.h \
 
1011
        termios.h \
 
1012
        termio.h \
 
1013
        sgtty.h \
 
1014
        fcntl.h \
 
1015
        dlfcn.h \
 
1016
        alloca.h \
 
1017
        winsock.h \
 
1018
        time.h \
 
1019
        io.h \
 
1020
        pwd.h \
 
1021
        utime.h \
 
1022
        sys/utime.h \
 
1023
        sys/poll.h \
 
1024
        setjmp.h,
 
1025
dnl to do if not found
 
1026
[],
 
1027
dnl to do if found
 
1028
[],
 
1029
dnl default includes
 
1030
[
 
1031
#ifdef HAVE_SYS_TYPES_H
 
1032
#include <sys/types.h>
 
1033
#endif
 
1034
#ifdef HAVE_SYS_TIME_H
 
1035
#include <sys/time.h>
 
1036
#endif
 
1037
#ifdef HAVE_SYS_SELECT_H
 
1038
#include <sys/select.h>
 
1039
#endif
 
1040
#ifdef HAVE_SYS_SOCKET_H
 
1041
#include <sys/socket.h>
 
1042
#endif
 
1043
#ifdef HAVE_NETINET_IN_H
 
1044
#include <netinet/in.h>
 
1045
#endif
 
1046
]
 
1047
)
 
1048
 
 
1049
dnl Checks for typedefs, structures, and compiler characteristics.
 
1050
AC_C_CONST
 
1051
AC_TYPE_SIZE_T
 
1052
AC_HEADER_TIME
 
1053
 
 
1054
AC_CHECK_SIZEOF(curl_off_t, ,[
 
1055
#include <stdio.h>
 
1056
#include "$srcdir/include/curl/curl.h"
 
1057
])
 
1058
 
 
1059
AC_CHECK_TYPE(long long,
 
1060
   [AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports 'long long'])])
 
1061
 
 
1062
# check for ssize_t
 
1063
AC_CHECK_TYPE(ssize_t, ,
 
1064
   AC_DEFINE(ssize_t, int, [the signed version of size_t]))
 
1065
 
 
1066
TYPE_SOCKLEN_T
 
1067
TYPE_IN_ADDR_T
 
1068
 
 
1069
AC_FUNC_SELECT_ARGTYPES
 
1070
 
 
1071
dnl Checks for library functions.
 
1072
dnl AC_PROG_GCC_TRADITIONAL
 
1073
AC_TYPE_SIGNAL
 
1074
dnl AC_FUNC_VPRINTF
 
1075
AC_CHECK_FUNCS( strtoll \
 
1076
                socket \
 
1077
                select \
 
1078
                strdup \
 
1079
                strstr \
 
1080
                strtok_r \
 
1081
                strftime \
 
1082
                uname \
 
1083
                strcasecmp \
 
1084
                stricmp \
 
1085
                strcmpi \
 
1086
                gethostbyaddr \
 
1087
                gettimeofday \
 
1088
                inet_addr \
 
1089
                inet_ntoa \
 
1090
                inet_pton \
 
1091
                tcsetattr \
 
1092
                tcgetattr \
 
1093
                perror \
 
1094
                closesocket \
 
1095
                siginterrupt \
 
1096
                sigaction \
 
1097
                signal \
 
1098
                getpass_r \
 
1099
                strlcat \
 
1100
                getpwuid \
 
1101
                geteuid \
 
1102
                dlopen \
 
1103
                utime \
 
1104
                sigsetjmp \
 
1105
                poll,
 
1106
dnl if found
 
1107
[],
 
1108
dnl if not found, $ac_func is the name we check for
 
1109
  func="$ac_func"
 
1110
  AC_MSG_CHECKING([deeper for $func])
 
1111
  AC_TRY_LINK( [],
 
1112
               [ $func ();],
 
1113
               AC_MSG_RESULT(yes!)
 
1114
               eval "ac_cv_func_$func=yes"
 
1115
               def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'`
 
1116
               AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
 
1117
               AC_MSG_RESULT(but still no)
 
1118
               )
 
1119
 
 
1120
)
 
1121
 
 
1122
dnl sigsetjmp() might be a macro and no function so if it isn't found already
 
1123
dnl we make an extra check here!
 
1124
if test "$ac_cv_func_sigsetjmp" != "yes"; then
 
1125
  AC_MSG_CHECKING([for sigsetjmp defined as macro])
 
1126
  AC_TRY_LINK( [#include <setjmp.h>],
 
1127
               [sigjmp_buf jmpenv;
 
1128
                sigsetjmp(jmpenv, 1);],
 
1129
               AC_MSG_RESULT(yes)
 
1130
               AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]),
 
1131
               AC_MSG_RESULT(no)
 
1132
               )
 
1133
fi
 
1134
 
 
1135
AC_PATH_PROG( PERL, perl, , 
 
1136
  $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
 
1137
AC_SUBST(PERL)
 
1138
 
 
1139
AC_PATH_PROGS( NROFF, gnroff nroff, , 
 
1140
  $PATH:/usr/bin/:/usr/local/bin )
 
1141
AC_SUBST(NROFF)
 
1142
 
 
1143
if test -n "$NROFF"; then
 
1144
  dnl only check for nroff options if an nroff command was found
 
1145
 
 
1146
  AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
 
1147
  MANOPT="-man"
 
1148
  mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
 
1149
  if test -z "$mancheck"; then
 
1150
    MANOPT="-mandoc"
 
1151
   mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
 
1152
    if test -z "$mancheck"; then
 
1153
      MANOPT=""
 
1154
      AC_MSG_RESULT([failed])
 
1155
      AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
 
1156
    else
 
1157
      AC_MSG_RESULT([$MANOPT])
 
1158
    fi
 
1159
  else
 
1160
    AC_MSG_RESULT([$MANOPT])
 
1161
  fi
 
1162
  AC_SUBST(MANOPT)
 
1163
fi
 
1164
 
 
1165
if test -z "$MANOPT"
 
1166
then
 
1167
  dnl if no nroff tool was found, or no option that could convert man pages
 
1168
  dnl was found, then disable the built-in manual stuff
 
1169
  AC_MSG_WARN([disabling built-in manual])
 
1170
  USE_MANUAL="no";
 
1171
fi
 
1172
 
 
1173
AC_PROG_YACC
 
1174
 
 
1175
if test -z "$YACC"
 
1176
then
 
1177
  AC_MSG_CHECKING([if OK to build without bison/yacc])
 
1178
  dnl no yacc is a big deal if we have no pre-fixed getdate.y
 
1179
  if test -r "$srcdir/lib/getdate.c"
 
1180
  then
 
1181
    dnl all is well, we don't have to generate it!
 
1182
    AC_MSG_RESULT(yes)
 
1183
  else
 
1184
    AC_MSG_RESULT(no)
 
1185
    AC_MSG_ERROR([no yacc or bison found, can't build libcurl!])
 
1186
  fi
 
1187
fi
 
1188
 
 
1189
dnl *************************************************************************
 
1190
dnl If the manual variable still is set, then we go with providing a built-in
 
1191
dnl manual
 
1192
 
 
1193
if test "$USE_MANUAL" = "1"; then
 
1194
  AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
 
1195
fi
 
1196
 
 
1197
dnl set variable for use in automakefile(s)
 
1198
AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
 
1199
 
 
1200
 
 
1201
dnl AC_PATH_PROG( RANLIB, ranlib, /usr/bin/ranlib, 
 
1202
dnl   $PATH:/usr/bin/:/usr/local/bin )
 
1203
dnl AC_SUBST(RANLIB)
 
1204
 
 
1205
dnl ************************************************************
 
1206
dnl lame option to switch on debug options
 
1207
dnl
 
1208
AC_MSG_CHECKING([whether to enable debug options])
 
1209
AC_ARG_ENABLE(debug,
 
1210
AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
 
1211
AC_HELP_STRING([--disable-debug],[Disable debug options]),
 
1212
[ case "$enableval" in
 
1213
  no)
 
1214
       AC_MSG_RESULT(no)
 
1215
       ;;
 
1216
  *)   AC_MSG_RESULT(yes)
 
1217
 
 
1218
    CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
 
1219
    CFLAGS="$CFLAGS -g"
 
1220
 
 
1221
    dnl set compiler "debug" options to become more picky, and remove
 
1222
    dnl optimize options from CFLAGS
 
1223
    CURL_CC_DEBUG_OPTS
 
1224
       ;;
 
1225
  esac
 
1226
 ],
 
1227
       AC_MSG_RESULT(no)
 
1228
)
 
1229
 
 
1230
AC_MSG_CHECKING([whether to enable ares])
 
1231
AC_ARG_ENABLE(ares,
 
1232
AC_HELP_STRING([--enable-ares=PATH],[Enable ares for name lookups])
 
1233
AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
 
1234
[ case "$enableval" in
 
1235
  no)
 
1236
       AC_MSG_RESULT(no)
 
1237
       ;;
 
1238
  *)   AC_MSG_RESULT(yes)
 
1239
 
 
1240
       if test "x$IPV6_ENABLED" = "x1"; then
 
1241
         AC_MSG_ERROR([ares doesn't work with ipv6, disable ipv6 to use ares])
 
1242
       fi
 
1243
 
 
1244
       AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
 
1245
       dnl substitute HAVE_ARES for curl-config and similar
 
1246
       HAVE_ARES="1"
 
1247
       AC_SUBST(HAVE_ARES)
 
1248
 
 
1249
       LIBS="$LIBS -lcares"
 
1250
 
 
1251
       dnl For backwards compatibility default to includes/lib in srcdir/ares
 
1252
       dnl If a value is specified it is assumed that the libs are in $val/lib
 
1253
       dnl and the includes are in $val/include. This is the default setup for
 
1254
       dnl ares so it should not be a problem.
 
1255
       if test "x$enableval" = "xyes" ; then
 
1256
         if test -d "$srcdir/ares"; then
 
1257
            aresembedded="yes"
 
1258
            AC_CONFIG_SUBDIRS(ares)
 
1259
            aresinc=`cd $srcdir/ares && pwd`
 
1260
            CPPFLAGS="$CPPFLAGS -I$aresinc"
 
1261
 
 
1262
            dnl the pwd= below cannot 'cd' into the ares dir to get the full
 
1263
            dnl path to it, since it may not exist yet if we build outside of
 
1264
            dnl the source tree
 
1265
            pwd=`pwd`
 
1266
            LDFLAGS="$LDFLAGS -L$pwd/ares"
 
1267
         fi
 
1268
       else
 
1269
         CPPFLAGS="$CPPFLAGS -I$enableval/include"
 
1270
         LDFLAGS="$LDFLAGS -L$enableval/lib"
 
1271
       fi
 
1272
 
 
1273
       if test -z "$aresembedded"; then
 
1274
         dnl verify that a sufficient c-ares is here if we have pointed one
 
1275
         dnl out and don't use the "embedded" ares dir (in which case we don't
 
1276
         dnl check it because it might not have been built yet)
 
1277
         AC_MSG_CHECKING([that c-ares is good and recent enough])
 
1278
         AC_LINK_IFELSE( [
 
1279
#include <ares.h>
 
1280
/* provide a set of dummy functions in case c-ares was built with debug */
 
1281
void curl_dofree() { }
 
1282
void curl_sclose() { }
 
1283
void curl_domalloc() { }
 
1284
 
 
1285
int main(void)
 
1286
{
 
1287
  ares_channel channel;
 
1288
  ares_cancel(channel);
 
1289
  return 0;
 
1290
}
 
1291
],
 
1292
          AC_MSG_RESULT(yes),
 
1293
          AC_MSG_RESULT(no)
 
1294
          AC_MSG_ERROR([c-ares library defective or too old])
 
1295
          )
 
1296
       fi
 
1297
       ;;
 
1298
  esac ],
 
1299
       AC_MSG_RESULT(no)
 
1300
)
 
1301
 
 
1302
AC_CONFIG_FILES([Makefile \
 
1303
           docs/Makefile \
 
1304
           docs/examples/Makefile \
 
1305
           docs/libcurl/Makefile \
 
1306
           include/Makefile \
 
1307
           include/curl/Makefile \
 
1308
           src/Makefile \
 
1309
           lib/Makefile \
 
1310
           tests/Makefile \
 
1311
           tests/data/Makefile \
 
1312
           tests/server/Makefile \
 
1313
           tests/libtest/Makefile \
 
1314
           packages/Makefile \
 
1315
           packages/Win32/Makefile \
 
1316
           packages/Win32/cygwin/Makefile \
 
1317
           packages/Linux/Makefile \
 
1318
           packages/Linux/RPM/Makefile \
 
1319
           packages/Linux/RPM/curl.spec \
 
1320
           packages/Linux/RPM/curl-ssl.spec \
 
1321
           packages/Solaris/Makefile \
 
1322
           packages/DOS/Makefile \
 
1323
           packages/EPM/curl.list \
 
1324
           packages/EPM/Makefile \
 
1325
           packages/vms/Makefile \
 
1326
           curl-config
 
1327
])
 
1328
AC_OUTPUT