-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
3361 lines (2974 loc) · 95.6 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2012, Daniel Stenberg, <[email protected]>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
#***************************************************************************
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
dnl We don't know the version number "statically" so we use a dash here
AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/])
XC_OVR_ZZ50
CURL_OVERRIDE_AUTOCONF
dnl configure script copyright
AC_COPYRIGHT([Copyright (c) 1998 - 2011 Daniel Stenberg, <[email protected]>
This configure script may be copied, distributed and modified under the
terms of the curl license; see COPYING for more details])
AC_CONFIG_SRCDIR([lib/urldata.h])
AM_CONFIG_HEADER(lib/curl_config.h src/curl_config.h include/curl/curlbuild.h)
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
CURL_CHECK_OPTION_DEBUG
CURL_CHECK_OPTION_OPTIMIZE
CURL_CHECK_OPTION_WARNINGS
CURL_CHECK_OPTION_WERROR
CURL_CHECK_OPTION_CURLDEBUG
CURL_CHECK_OPTION_ARES
CURL_CHECK_PATH_SEPARATOR_REQUIRED
#
# save the configure arguments
#
CONFIGURE_OPTIONS="\"$ac_configure_args\""
AC_SUBST(CONFIGURE_OPTIONS)
CURL_CFLAG_EXTRAS=""
if test X"$want_werror" = Xyes; then
CURL_CFLAG_EXTRAS="-Werror"
fi
AC_SUBST(CURL_CFLAG_EXTRAS)
dnl SED is mandatory for configure process and libtool.
dnl Set it now, allowing it to be changed later.
if test -z "$SED"; then
dnl allow it to be overridden
AC_PATH_PROG([SED], [sed], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$SED" || test "$SED" = "not_found"; then
AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
fi
fi
AC_SUBST([SED])
dnl GREP is mandatory for configure process and libtool.
dnl Set it now, allowing it to be changed later.
if test -z "$GREP"; then
dnl allow it to be overridden
AC_PATH_PROG([GREP], [grep], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$GREP" || test "$GREP" = "not_found"; then
AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
fi
fi
AC_SUBST([GREP])
dnl EGREP is mandatory for configure process and libtool.
dnl Set it now, allowing it to be changed later.
if test -z "$EGREP"; then
dnl allow it to be overridden
if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
AC_MSG_CHECKING([for egrep])
EGREP="$GREP -E"
AC_MSG_RESULT([$EGREP])
else
AC_PATH_PROG([EGREP], [egrep], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
fi
fi
if test -z "$EGREP" || test "$EGREP" = "not_found"; then
AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
fi
AC_SUBST([EGREP])
dnl AR is mandatory for configure process and libtool.
dnl This is target dependent, so check it as a tool.
if test -z "$AR"; then
dnl allow it to be overridden
AC_PATH_TOOL([AR], [ar], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$AR" || test "$AR" = "not_found"; then
AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
fi
fi
AC_SUBST([AR])
AC_SUBST(libext)
dnl Remove non-configure distributed curlbuild.h
if test -f ${srcdir}/include/curl/curlbuild.h; then
rm -f ${srcdir}/include/curl/curlbuild.h
fi
dnl figure out the libcurl version
CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
AM_INIT_AUTOMAKE
AC_MSG_CHECKING([curl version])
AC_MSG_RESULT($CURLVERSION)
AC_SUBST(CURLVERSION)
dnl
dnl we extract the numerical version for curl-config only
VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
AC_SUBST(VERSIONNUM)
dnl Solaris pkgadd support definitions
PKGADD_PKG="HAXXcurl"
PKGADD_NAME="cURL - a client that groks URLs"
PKGADD_VENDOR="curl.haxx.se"
AC_SUBST(PKGADD_PKG)
AC_SUBST(PKGADD_NAME)
AC_SUBST(PKGADD_VENDOR)
dnl
dnl initialize all the info variables
curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,cyassl,axtls} )"
curl_ssh_msg="no (--with-libssh2)"
curl_zlib_msg="no (--with-zlib)"
curl_krb4_msg="no (--with-krb4*)"
curl_gss_msg="no (--with-gssapi)"
curl_spnego_msg="no (--with-spnego)"
curl_tls_srp_msg="no (--enable-tls-srp)"
curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
curl_ipv6_msg="no (--enable-ipv6)"
curl_idn_msg="no (--with-libidn)"
curl_manual_msg="no (--enable-manual)"
curl_libcurl_msg="enabled (--disable-libcurl-option)"
curl_verbose_msg="enabled (--disable-verbose)"
curl_sspi_msg="no (--enable-sspi)"
curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
curl_ldaps_msg="no (--enable-ldaps)"
curl_rtsp_msg="no (--enable-rtsp)"
curl_rtmp_msg="no (--with-librtmp)"
init_ssl_msg=${curl_ssl_msg}
dnl
dnl Save anything in $LIBS for later
dnl
ALL_LIBS=$LIBS
dnl
dnl Detect the canonical host and target build environment
dnl
AC_CANONICAL_HOST
dnl Get system canonical name
AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
dnl Checks for programs.
CURL_CHECK_PROG_CC
dnl Our curl_off_t internal and external configure settings
CURL_CONFIGURE_CURL_OFF_T
dnl This defines _ALL_SOURCE for AIX
CURL_CHECK_AIX_ALL_SOURCE
dnl Our configure and build reentrant settings
CURL_CONFIGURE_THREAD_SAFE
CURL_CONFIGURE_REENTRANT
dnl check for how to do large files
AC_SYS_LARGEFILE
dnl support building of Windows DLLs
AC_LIBTOOL_WIN32_DLL
dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
case $host in
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
AC_MSG_RESULT([yes])
with_pic=yes
;;
*)
AC_MSG_RESULT([no])
;;
esac
AC_MSG_CHECKING([if compiler is icc (to build with PIC)])
case $CC in
icc | */icc)
AC_MSG_RESULT([yes])
with_pic=yes
;;
*)
AC_MSG_RESULT([no])
;;
esac
dnl libtool setup
AC_PROG_LIBTOOL
AC_MSG_CHECKING([if we need -mimpure-text])
mimpure=no
case $host in
*-*-solaris2*)
if test "$GCC" = "yes"; then
mimpure="yes"
fi
;;
*)
;;
esac
AC_MSG_RESULT($mimpure)
AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
dnl 'STATICLIB' is, in spite of its name, not generic but only for static-only
dnl builds on Windows
AM_CONDITIONAL(STATICLIB, false)
AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
case $host in
*-*-mingw*)
AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
AC_MSG_RESULT(yes)
AC_MSG_CHECKING([if we need CURL_STATICLIB])
if test "X$enable_shared" = "Xno"
then
AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
AC_MSG_RESULT(yes)
AM_CONDITIONAL(STATICLIB, true)
else
AC_MSG_RESULT(no)
fi
;;
*)
AC_MSG_RESULT(no)
;;
esac
# Determine whether all dependent libraries must be specified when linking
if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
then
REQUIRE_LIB_DEPS=no
else
REQUIRE_LIB_DEPS=yes
fi
AC_SUBST(REQUIRE_LIB_DEPS)
dnl The install stuff has already been taken care of by the automake stuff
dnl AC_PROG_INSTALL
AC_PROG_MAKE_SET
dnl check if there's a way to force code inline
AC_C_INLINE
dnl **********************************************************************
dnl platform/compiler/architecture specific checks/flags
dnl **********************************************************************
CURL_CHECK_COMPILER
CURL_SET_COMPILER_BASIC_OPTS
CURL_SET_COMPILER_DEBUG_OPTS
CURL_SET_COMPILER_OPTIMIZE_OPTS
CURL_SET_COMPILER_WARNING_OPTS
if test "$compiler_id" = "INTEL_UNIX_C"; then
#
if test "$compiler_num" -ge "1000"; then
dnl icc 10.X or later
CFLAGS="$CFLAGS -shared-intel"
elif test "$compiler_num" -ge "900"; then
dnl icc 9.X specific
CFLAGS="$CFLAGS -i-dynamic"
fi
#
fi
CURL_CHECK_COMPILER_HALT_ON_ERROR
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
CURL_CHECK_NO_UNDEFINED
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
CURL_CHECK_CURLDEBUG
AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
supports_unittests=yes
# cross-compilation of unit tests static library/programs fails when
# libcurl shared library is built. This might be due to a libtool or
# automake issue. In this case we disable unit tests.
if test "x$cross_compiling" != "xno" &&
test "x$enable_shared" != "xno"; then
supports_unittests=no
fi
# IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
# a problem related with OpenSSL headers and library versions not matching.
# Disable unit tests while time to further investigate this is found.
case $host in
mips-sgi-irix6.5)
if test "$compiler_id" = "GNU_C"; then
supports_unittests=no
fi
;;
esac
# All AIX autobuilds fails unit tests linking against unittests library
# due to unittests library being built with no symbols or members. Libtool ?
# Disable unit tests while time to further investigate this is found.
case $host_os in
aix*)
supports_unittests=no
;;
esac
dnl Build unit tests when option --enable-debug is given.
if test "x$want_debug" = "xyes" &&
test "x$supports_unittests" = "xyes"; then
want_unittests=yes
else
want_unittests=no
fi
AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
dnl **********************************************************************
dnl Compilation based checks should not be done before this point.
dnl **********************************************************************
dnl **********************************************************************
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
dnl and ws2tcpip.h take precedence over any other further checks which
dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
dnl this specific header files. And do them before its results are used.
dnl **********************************************************************
CURL_CHECK_HEADER_WINDOWS
CURL_CHECK_NATIVE_WINDOWS
case X-"$ac_cv_native_windows" in
X-yes)
CURL_CHECK_HEADER_WINSOCK
CURL_CHECK_HEADER_WINSOCK2
CURL_CHECK_HEADER_WS2TCPIP
CURL_CHECK_HEADER_WINLDAP
CURL_CHECK_HEADER_WINBER
;;
*)
ac_cv_header_winsock_h="no"
ac_cv_header_winsock2_h="no"
ac_cv_header_ws2tcpip_h="no"
ac_cv_header_winldap_h="no"
ac_cv_header_winber_h="no"
;;
esac
CURL_CHECK_WIN32_LARGEFILE
dnl ************************************************************
dnl switch off particular protocols
dnl
AC_MSG_CHECKING([whether to support http])
AC_ARG_ENABLE(http,
AC_HELP_STRING([--enable-http],[Enable HTTP support])
AC_HELP_STRING([--disable-http],[Disable HTTP support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
AC_SUBST(CURL_DISABLE_HTTP, [1])
AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
AC_SUBST(CURL_DISABLE_RTSP, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support ftp])
AC_ARG_ENABLE(ftp,
AC_HELP_STRING([--enable-ftp],[Enable FTP support])
AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
AC_SUBST(CURL_DISABLE_FTP, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support file])
AC_ARG_ENABLE(file,
AC_HELP_STRING([--enable-file],[Enable FILE support])
AC_HELP_STRING([--disable-file],[Disable FILE support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
AC_SUBST(CURL_DISABLE_FILE, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support ldap])
AC_ARG_ENABLE(ldap,
AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
AC_SUBST(CURL_DISABLE_LDAP, [1])
;;
*)
AC_MSG_RESULT(yes)
;;
esac ],[
AC_MSG_RESULT(yes) ]
)
AC_MSG_CHECKING([whether to support ldaps])
AC_ARG_ENABLE(ldaps,
AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
;;
*) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
else
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
AC_SUBST(HAVE_LDAP_SSL, [1])
fi
;;
esac ],[
if test "x$CURL_DISABLE_LDAP" = "x1" ; then
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
else
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
AC_SUBST(HAVE_LDAP_SSL, [1])
fi ]
)
AC_MSG_CHECKING([whether to support rtsp])
AC_ARG_ENABLE(rtsp,
AC_HELP_STRING([--enable-rtsp],[Enable RTSP support])
AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
AC_SUBST(CURL_DISABLE_RTSP, [1])
;;
*) if test x$CURL_DISABLE_HTTP = x1 ; then
AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
else
AC_MSG_RESULT(yes)
curl_rtsp_msg="enabled"
fi
;;
esac ],
if test "x$CURL_DISABLE_HTTP" != "x1"; then
AC_MSG_RESULT(yes)
curl_rtsp_msg="enabled"
else
AC_MSG_RESULT(no)
fi
)
AC_MSG_CHECKING([whether to support proxies])
AC_ARG_ENABLE(proxy,
AC_HELP_STRING([--enable-proxy],[Enable proxy support])
AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
AC_SUBST(CURL_DISABLE_PROXY, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support dict])
AC_ARG_ENABLE(dict,
AC_HELP_STRING([--enable-dict],[Enable DICT support])
AC_HELP_STRING([--disable-dict],[Disable DICT support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
AC_SUBST(CURL_DISABLE_DICT, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support telnet])
AC_ARG_ENABLE(telnet,
AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
AC_SUBST(CURL_DISABLE_TELNET, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support tftp])
AC_ARG_ENABLE(tftp,
AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
AC_SUBST(CURL_DISABLE_TFTP, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support pop3])
AC_ARG_ENABLE(pop3,
AC_HELP_STRING([--enable-pop3],[Enable POP3 support])
AC_HELP_STRING([--disable-pop3],[Disable POP3 support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
AC_SUBST(CURL_DISABLE_POP3, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support imap])
AC_ARG_ENABLE(imap,
AC_HELP_STRING([--enable-imap],[Enable IMAP support])
AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
AC_SUBST(CURL_DISABLE_IMAP, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support smtp])
AC_ARG_ENABLE(smtp,
AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
AC_SUBST(CURL_DISABLE_SMTP, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support gopher])
AC_ARG_ENABLE(gopher,
AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
AC_SUBST(CURL_DISABLE_GOPHER, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl **********************************************************************
dnl Check for built-in manual
dnl **********************************************************************
AC_MSG_CHECKING([whether to provide built-in manual])
AC_ARG_ENABLE(manual,
AC_HELP_STRING([--enable-manual],[Enable built-in manual])
AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
;;
*) AC_MSG_RESULT(yes)
USE_MANUAL="1"
;;
esac ],
AC_MSG_RESULT(yes)
USE_MANUAL="1"
)
dnl The actual use of the USE_MANUAL variable is done much later in this
dnl script to allow other actions to disable it as well.
dnl ************************************************************
dnl disable C code generation support
dnl
AC_MSG_CHECKING([whether to enable generation of C code])
AC_ARG_ENABLE(libcurl_option,
AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
curl_libcurl_msg="no"
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl **********************************************************************
dnl Checks for libraries.
dnl **********************************************************************
CURL_CHECK_LIB_XNET
dnl gethostbyname without lib or in the nsl lib?
AC_CHECK_FUNC(gethostbyname,
[HAVE_GETHOSTBYNAME="1"
],
[ AC_CHECK_LIB(nsl, gethostbyname,
[HAVE_GETHOSTBYNAME="1"
LIBS="$LIBS -lnsl"
])
])
if test "$HAVE_GETHOSTBYNAME" != "1"
then
dnl gethostbyname in the socket lib?
AC_CHECK_LIB(socket, gethostbyname,
[HAVE_GETHOSTBYNAME="1"
LIBS="$LIBS -lsocket"
])
fi
dnl At least one system has been identified to require BOTH nsl and socket
dnl libs at the same time to link properly.
if test "$HAVE_GETHOSTBYNAME" != "1"
then
AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
my_ac_save_LIBS=$LIBS
LIBS="-lnsl -lsocket $LIBS"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
]],[[
gethostbyname();
]])
],[
AC_MSG_RESULT([yes])
HAVE_GETHOSTBYNAME="1"
],[
AC_MSG_RESULT([no])
LIBS=$my_ac_save_LIBS
])
fi
if test "$HAVE_GETHOSTBYNAME" != "1"
then
dnl This is for winsock systems
if test "$ac_cv_header_windows_h" = "yes"; then
if test "$ac_cv_header_winsock_h" = "yes"; then
case $host in
*-*-mingw32ce*)
winsock_LIB="-lwinsock"
;;
*)
winsock_LIB="-lwsock32"
;;
esac
fi
if test "$ac_cv_header_winsock2_h" = "yes"; then
winsock_LIB="-lws2_32"
fi
if test ! -z "$winsock_LIB"; then
my_ac_save_LIBS=$LIBS
LIBS="$winsock_LIB $LIBS"
AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#else
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
#endif
#endif
]],[[
gethostbyname("www.dummysite.com");
]])
],[
AC_MSG_RESULT([yes])
HAVE_GETHOSTBYNAME="1"
],[
AC_MSG_RESULT([no])
winsock_LIB=""
LIBS=$my_ac_save_LIBS
])
fi
fi
fi
if test "$HAVE_GETHOSTBYNAME" != "1"
then
dnl This is for Minix 3.1
AC_MSG_CHECKING([for gethostbyname for Minix 3])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
/* Older Minix versions may need <net/gen/netdb.h> here instead */
#include <netdb.h>
]],[[
gethostbyname("www.dummysite.com");
]])
],[
AC_MSG_RESULT([yes])
HAVE_GETHOSTBYNAME="1"
],[
AC_MSG_RESULT([no])
])
fi
if test "$HAVE_GETHOSTBYNAME" != "1"
then
dnl This is for eCos with a stubbed DNS implementation
AC_MSG_CHECKING([for gethostbyname for eCos])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
#include <stdio.h>
#include <netdb.h>
]],[[
gethostbyname("www.dummysite.com");
]])
],[
AC_MSG_RESULT([yes])
HAVE_GETHOSTBYNAME="1"
],[
AC_MSG_RESULT([no])
])
fi
if test "$HAVE_GETHOSTBYNAME" != "1"
then
dnl gethostbyname in the network lib - for Haiku OS
AC_CHECK_LIB(network, gethostbyname,
[HAVE_GETHOSTBYNAME="1"
LIBS="$LIBS -lnetwork"
])
fi
if test "$HAVE_GETHOSTBYNAME" != "1"
then
dnl gethostbyname in the net lib - for BeOS
AC_CHECK_LIB(net, gethostbyname,
[HAVE_GETHOSTBYNAME="1"
LIBS="$LIBS -lnet"
])
fi
if test "$HAVE_GETHOSTBYNAME" != "1"; then
AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
fi
dnl resolve lib?
AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
AC_CHECK_LIB(resolve, strcasecmp,
[LIBS="-lresolve $LIBS"],
,
-lnsl)
fi
ac_cv_func_strcasecmp="no"
CURL_CHECK_LIBS_CONNECT
CURL_NETWORK_LIBS=$LIBS
dnl **********************************************************************
dnl In case that function clock_gettime with monotonic timer is available,
dnl check for additional required libraries.
dnl **********************************************************************
CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
dnl **********************************************************************
dnl The preceding library checks are all potentially useful for test
dnl servers (for providing networking support). Save the list of required
dnl libraries at this point for use while linking those test servers.
dnl **********************************************************************
TEST_SERVER_LIBS=$LIBS
dnl **********************************************************************
AC_MSG_CHECKING([whether to use libgcc])
AC_ARG_ENABLE(libgcc,
AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
[ case "$enableval" in
yes)
ALL_LIBS="$ALL_LIBS -lgcc"
AC_MSG_RESULT(yes)
;;
*) AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
dnl **********************************************************************
dnl Check for LDAP
dnl **********************************************************************
LDAPLIBNAME=""
AC_ARG_WITH(ldap-lib,
AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
[LDAPLIBNAME="$withval"])
LBERLIBNAME=""
AC_ARG_WITH(lber-lib,
AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
[LBERLIBNAME="$withval"])
if test x$CURL_DISABLE_LDAP != x1 ; then
CURL_CHECK_HEADER_LBER
CURL_CHECK_HEADER_LDAP
CURL_CHECK_HEADER_LDAPSSL
CURL_CHECK_HEADER_LDAP_SSL
if test -z "$LDAPLIBNAME" ; then
if test "$ac_cv_native_windows" = "yes"; then
dnl Windows uses a single and unique LDAP library name
LDAPLIBNAME="wldap32"
LBERLIBNAME="no"
fi
fi
if test "$LDAPLIBNAME" ; then
AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
AC_SUBST(CURL_DISABLE_LDAP, [1])])
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
else
dnl Try to find the right ldap libraries for this system
CURL_CHECK_LIBS_LDAP
case X-"$curl_cv_ldap_LIBS" in
X-unknown)
AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
AC_SUBST(CURL_DISABLE_LDAP, [1])
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
;;
esac
fi
fi
if test x$CURL_DISABLE_LDAP != x1 ; then
if test "$LBERLIBNAME" ; then
dnl If name is "no" then don't define this library at all
dnl (it's only needed if libldap.so's dependencies are broken).
if test "$LBERLIBNAME" != "no" ; then
AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
AC_SUBST(CURL_DISABLE_LDAP, [1])])
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
fi
fi
fi
if test x$CURL_DISABLE_LDAP != x1 ; then
AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
if test "$LDAPLIBNAME" = "wldap32"; then
curl_ldap_msg="enabled (winldap)"
AC_DEFINE(CURL_LDAP_WIN, 1, [Use Windows LDAP implementation])
else
curl_ldap_msg="enabled (OpenLDAP)"
if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
AC_SUBST(USE_OPENLDAP, [1])
fi
fi
fi
if test x$CURL_DISABLE_LDAPS != x1 ; then
curl_ldaps_msg="enabled"
fi
dnl **********************************************************************
dnl Checks for IPv6
dnl **********************************************************************
AC_MSG_CHECKING([whether to enable ipv6])
AC_ARG_ENABLE(ipv6,
AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
ipv6=no
;;
*) AC_MSG_RESULT(yes)
ipv6=yes
;;
esac ],
AC_TRY_RUN([ /* is AF_INET6 available? */
#include <sys/types.h>
#include <sys/socket.h>
main()
{
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
exit(1);
else
exit(0);
}
],
AC_MSG_RESULT(yes)
ipv6=yes,
AC_MSG_RESULT(no)
ipv6=no,
AC_MSG_RESULT(no)
ipv6=no
))
if test "$ipv6" = "yes"; then
curl_ipv6_msg="enabled"
fi