-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
5565 lines (5018 loc) · 161 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) 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 https://curl.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.
#
# SPDX-License-Identifier: curl
#
#***************************************************************************
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
dnl We don't know the version number "statically" so we use a dash here
AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.se/mail/])
XC_OVR_ZZ50
XC_OVR_ZZ60
CURL_OVERRIDE_AUTOCONF
dnl configure script copyright
AC_COPYRIGHT([Copyright (C) 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])
AC_CONFIG_HEADERS(lib/curl_config.h)
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
CURL_CHECK_OPTION_DEBUG
AM_CONDITIONAL(DEBUGBUILD, test x$want_debug = xyes)
CURL_CHECK_OPTION_OPTIMIZE
CURL_CHECK_OPTION_WARNINGS
CURL_CHECK_OPTION_WERROR
CURL_CHECK_OPTION_CURLDEBUG
CURL_CHECK_OPTION_SYMBOL_HIDING
CURL_CHECK_OPTION_ARES
CURL_CHECK_OPTION_RT
CURL_CHECK_OPTION_HTTPSRR
CURL_CHECK_OPTION_ECH
XC_CHECK_PATH_SEPARATOR
#
# save the configure arguments
#
CONFIGURE_OPTIONS="\"$ac_configure_args\""
AC_SUBST(CONFIGURE_OPTIONS)
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 'grep -E' 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
AC_MSG_CHECKING([that grep -E works])
if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
EGREP="$GREP -E"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
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([grep -E is not working and egrep is not found in PATH. Cannot continue.])
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 figure out the libcurl version
CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
XC_CHECK_PROG_CC
CURL_ATOMIC
dnl for --enable-code-coverage
CURL_COVERAGE
XC_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\([0-9A-Fa-f]*\).*/\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.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-{openssl,gnutls,mbedtls,wolfssl,schannel,secure-transport,amissl,bearssl,rustls} )"
curl_ssh_msg="no (--with-{libssh,libssh2})"
curl_zlib_msg="no (--with-zlib)"
curl_brotli_msg="no (--with-brotli)"
curl_zstd_msg="no (--with-zstd)"
curl_gss_msg="no (--with-gssapi)"
curl_gsasl_msg="no (--with-gsasl)"
curl_tls_srp_msg="no (--enable-tls-srp)"
curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
curl_ipv6_msg="no (--enable-ipv6)"
curl_unix_sockets_msg="no (--enable-unix-sockets)"
curl_idn_msg="no (--with-{libidn2,winidn})"
curl_docs_msg="enabled (--disable-docs)"
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_ipfs_msg="no (--enable-ipfs)"
curl_rtsp_msg="no (--enable-rtsp)"
curl_rtmp_msg="no (--with-librtmp)"
curl_psl_msg="no (--with-libpsl)"
curl_altsvc_msg="enabled (--disable-alt-svc)"
curl_headers_msg="enabled (--disable-headers-api)"
curl_hsts_msg="enabled (--disable-hsts)"
ssl_backends=
curl_h1_msg="enabled (internal)"
curl_h2_msg="no (--with-nghttp2)"
curl_h3_msg="no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-openssl-quic, --with-msh3)"
enable_altsvc="yes"
hsts="yes"
dnl
dnl Save some initial values the user might have provided
dnl
INITIAL_LDFLAGS=$LDFLAGS
INITIAL_LIBS=$LIBS
dnl
dnl Generates a shell script to run the compiler with LD_LIBRARY_PATH set to
dnl the value used right now. This lets CURL_RUN_IFELSE set LD_LIBRARY_PATH to
dnl something different but only have that affect the execution of the results
dnl of the compile, not change the libraries for the compiler itself.
dnl
compilersh="run-compiler"
CURL_SAVED_CC="$CC"
export CURL_SAVED_CC
CURL_SAVED_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
export CURL_SAVED_LD_LIBRARY_PATH
cat <<\EOF > "$compilersh"
CC="$CURL_SAVED_CC"
export CC
LD_LIBRARY_PATH="$CURL_SAVED_LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
exec $CC "$@"
EOF
dnl **********************************************************************
dnl See which TLS backend(s) that are requested. Just do all the
dnl TLS AC_ARG_WITH() invokes here and do the checks later
dnl **********************************************************************
OPT_SCHANNEL=no
AC_ARG_WITH(schannel,dnl
AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]),
OPT_SCHANNEL=$withval
TLSCHOICE="schannel")
OPT_SECURETRANSPORT=no
AC_ARG_WITH(secure-transport,dnl
AS_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]),[
OPT_SECURETRANSPORT=$withval
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Secure-Transport"
])
OPT_AMISSL=no
AC_ARG_WITH(amissl,dnl
AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),[
OPT_AMISSL=$withval
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL"
])
OPT_OPENSSL=no
dnl Default to no CA bundle
ca="no"
AC_ARG_WITH(ssl,dnl
AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl])
AS_HELP_STRING([--without-ssl], [build without any TLS library]),[
OPT_SSL=$withval
OPT_OPENSSL=$withval
if test X"$withval" != Xno; then
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
else
SSL_DISABLED="D"
fi
])
AC_ARG_WITH(openssl,dnl
AS_HELP_STRING([--with-openssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]),[
OPT_OPENSSL=$withval
if test X"$withval" != Xno; then
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
fi
])
OPT_GNUTLS=no
AC_ARG_WITH(gnutls,dnl
AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),[
OPT_GNUTLS=$withval
if test X"$withval" != Xno; then
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS"
fi
])
OPT_MBEDTLS=no
AC_ARG_WITH(mbedtls,dnl
AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),[
OPT_MBEDTLS=$withval
if test X"$withval" != Xno; then
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS"
fi
])
OPT_WOLFSSL=no
AC_ARG_WITH(wolfssl,dnl
AS_HELP_STRING([--with-wolfssl=PATH],[where to look for wolfSSL, PATH points to the installation root (default: system lib default)]),[
OPT_WOLFSSL=$withval
if test X"$withval" != Xno; then
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL"
fi
])
OPT_BEARSSL=no
AC_ARG_WITH(bearssl,dnl
AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root]),[
OPT_BEARSSL=$withval
if test X"$withval" != Xno; then
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL"
fi
])
OPT_RUSTLS=no
AC_ARG_WITH(rustls,dnl
AS_HELP_STRING([--with-rustls=PATH],[where to look for Rustls, PATH points to the installation root]),[
OPT_RUSTLS=$withval
if test X"$withval" != Xno; then
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls"
experimental="$experimental rustls"
fi
])
TEST_NGHTTPX=nghttpx
AC_ARG_WITH(test-nghttpx,dnl
AS_HELP_STRING([--with-test-nghttpx=PATH],[where to find nghttpx for testing]),
TEST_NGHTTPX=$withval
if test X"$OPT_TEST_NGHTTPX" = "Xno"; then
TEST_NGHTTPX=""
fi
)
AC_SUBST(TEST_NGHTTPX)
CADDY=/usr/bin/caddy
AC_ARG_WITH(test-caddy,dnl
AS_HELP_STRING([--with-test-caddy=PATH],[where to find caddy for testing]),
CADDY=$withval
if test X"$OPT_CADDY" = "Xno"; then
CADDY=""
fi
)
AC_SUBST(CADDY)
VSFTPD=/usr/sbin/vsftpd
AC_ARG_WITH(test-vsftpd,dnl
AS_HELP_STRING([--with-test-vsftpd=PATH],[where to find vsftpd for testing]),
VSFTPD=$withval
if test X"$OPT_VSFTPD" = "Xno"; then
VSFTPD=""
fi
)
AC_SUBST(VSFTPD)
dnl we'd like a httpd+apachectl as test server
dnl
HTTPD_ENABLED="maybe"
AC_ARG_WITH(test-httpd, [AS_HELP_STRING([--with-test-httpd=PATH],
[where to find httpd/apache2 for testing])],
[request_httpd=$withval], [request_httpd=check])
if test x"$request_httpd" = "xcheck" -o x"$request_httpd" = "xyes"; then
if test -x "/usr/sbin/apache2" -a -x "/usr/sbin/apache2ctl"; then
# common location on distros (debian/ubuntu)
HTTPD="/usr/sbin/apache2"
APACHECTL="/usr/sbin/apache2ctl"
AC_PATH_PROG([APXS], [apxs])
if test "x$APXS" = "x"; then
AC_MSG_NOTICE([apache2-dev not installed, httpd tests disabled])
HTTPD_ENABLED="no"
fi
else
AC_PATH_PROG([HTTPD], [httpd])
if test "x$HTTPD" = "x"; then
AC_PATH_PROG([HTTPD], [apache2])
fi
AC_PATH_PROG([APACHECTL], [apachectl])
AC_PATH_PROG([APXS], [apxs])
if test "x$HTTPD" = "x" -o "x$APACHECTL" = "x"; then
AC_MSG_NOTICE([httpd/apache2 not in PATH, http tests disabled])
HTTPD_ENABLED="no"
fi
if test "x$APXS" = "x"; then
AC_MSG_NOTICE([apxs not in PATH, http tests disabled])
HTTPD_ENABLED="no"
fi
fi
elif test x"$request_httpd" != "xno"; then
HTTPD="${request_httpd}/bin/httpd"
APACHECTL="${request_httpd}/bin/apachectl"
APXS="${request_httpd}/bin/apxs"
if test ! -x "${HTTPD}"; then
AC_MSG_NOTICE([httpd not found as ${HTTPD}, http tests disabled])
HTTPD_ENABLED="no"
elif test ! -x "${APACHECTL}"; then
AC_MSG_NOTICE([apachectl not found as ${APACHECTL}, http tests disabled])
HTTPD_ENABLED="no"
elif test ! -x "${APXS}"; then
AC_MSG_NOTICE([apxs not found as ${APXS}, http tests disabled])
HTTPD_ENABLED="no"
else
AC_MSG_NOTICE([using HTTPD=$HTTPD for tests])
fi
fi
if test x"$HTTPD_ENABLED" = "xno"; then
HTTPD=""
APACHECTL=""
APXS=""
fi
AC_SUBST(HTTPD)
AC_SUBST(APACHECTL)
AC_SUBST(APXS)
dnl the nghttpx we might use in httpd testing
if test "x$TEST_NGHTTPX" != "x" -a "x$TEST_NGHTTPX" != "xnghttpx"; then
HTTPD_NGHTTPX="$TEST_NGHTTPX"
else
AC_PATH_PROG([HTTPD_NGHTTPX], [nghttpx], [],
[$PATH:/usr/bin:/usr/local/bin])
fi
AC_SUBST(HTTPD_NGHTTPX)
dnl the Caddy server we might use in testing
if test "x$TEST_CADDY" != "x"; then
CADDY="$TEST_CADDY"
else
AC_PATH_PROG([CADDY], [caddy])
fi
AC_SUBST(CADDY)
dnl If no TLS choice has been made, check if it was explicitly disabled or
dnl error out to force the user to decide.
if test -z "$TLSCHOICE"; then
if test "x$OPT_SSL" != "xno"; then
AC_MSG_ERROR([select TLS backend(s) or disable TLS with --without-ssl.
Select from these:
--with-amissl
--with-bearssl
--with-gnutls
--with-mbedtls
--with-openssl (also works for BoringSSL and LibreSSL)
--with-rustls
--with-schannel
--with-secure-transport
--with-wolfssl
])
fi
fi
AC_ARG_WITH(darwinssl,,
AC_MSG_ERROR([--with-darwin-ssl and --without-darwin-ssl no longer work!]))
dnl
dnl Detect the canonical host and target build environment
dnl
AC_CANONICAL_HOST
dnl Get system canonical name
AC_DEFINE_UNQUOTED(CURL_OS, "${host}", [cpu-machine-OS])
# Silence warning: ar: 'u' modifier ignored since 'D' is the default
AC_SUBST(AR_FLAGS, [cr])
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
XC_LIBTOOL
LT_LANG([Windows Resource])
#
# Automake conditionals based on libtool related checks
#
AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
[test "x$xc_lt_shlib_use_version_info" = 'xyes'])
AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
[test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
[test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
#
# Due to libtool and automake machinery limitations of not allowing
# specifying separate CPPFLAGS or CFLAGS when compiling objects for
# inclusion of these in shared or static libraries, we are forced to
# build using separate configure runs for shared and static libraries
# on systems where different CPPFLAGS or CFLAGS are mandatory in order
# to compile objects for each kind of library. Notice that relying on
# the '-DPIC' CFLAG that libtool provides is not valid given that the
# user might for example choose to build static libraries with PIC.
#
#
# Make our Makefile.am files use the staticlib CPPFLAG only when strictly
# targeting a static library and not building its shared counterpart.
#
AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
[test "x$xc_lt_build_static_only" = 'xyes'])
#
# Make staticlib CPPFLAG variable and its definition visible in output
# files unconditionally, providing an empty definition unless strictly
# targeting a static library and not building its shared counterpart.
#
LIBCURL_PC_CFLAGS_PRIVATE='-DCURL_STATICLIB'
AC_SUBST(LIBCURL_PC_CFLAGS_PRIVATE)
LIBCURL_PC_CFLAGS=
if test "x$xc_lt_build_static_only" = 'xyes'; then
LIBCURL_PC_CFLAGS="${LIBCURL_PC_CFLAGS_PRIVATE}"
fi
AC_SUBST([LIBCURL_PC_CFLAGS])
dnl **********************************************************************
dnl platform/compiler/architecture specific checks/flags
dnl **********************************************************************
CURL_CHECK_COMPILER
CURL_CHECK_NATIVE_WINDOWS
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_CFLAG_EXTRAS=""
if test X"$want_werror" = Xyes; then
CURL_CFLAG_EXTRAS="-Werror"
if test "$compiler_id" = "GNU_C"; then
dnl enable -pedantic-errors for GCC 5 and later,
dnl as before that it was the same as -Werror=pedantic
if test "$compiler_num" -ge "500"; then
CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
fi
elif test "$compiler_id" = "CLANG" -o "$compiler_id" = "APPLECLANG"; then
CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
fi
fi
AC_SUBST(CURL_CFLAG_EXTRAS)
CURL_CHECK_COMPILER_HALT_ON_ERROR
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
CURL_CHECK_COMPILER_SYMBOL_HIDING
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
# In order to detect support of sendmmsg(), we need to escape the POSIX
# jail by defining _GNU_SOURCE or <sys/socket.h> will not expose it.
case $host_os in
linux*)
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
;;
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 **********************************************************************
CURL_CHECK_WIN32_LARGEFILE
CURL_CHECK_WIN32_CRYPTO
CURL_DARWIN_CFLAGS
case $host in
*-apple-*)
CURL_SUPPORTS_BUILTIN_AVAILABLE
;;
esac
curl_cv_cygwin='no'
case $host_os in
cygwin*|msys*) curl_cv_cygwin='yes';;
esac
AM_CONDITIONAL([HAVE_WINDRES],
[test "$curl_cv_native_windows" = "yes" && test -n "${RC}"])
if test "$curl_cv_native_windows" = "yes"; then
AM_COND_IF([HAVE_WINDRES],,
[AC_MSG_ERROR([windres not found in PATH. Windows builds require windres. Cannot continue.])])
fi
dnl ----------------------------------------
dnl whether use "unity" mode for lib and src
dnl ----------------------------------------
want_unity='no'
AC_MSG_CHECKING([whether to build libcurl and curl in "unity" mode])
AC_ARG_ENABLE(unity,
AS_HELP_STRING([--enable-unity],[Enable unity mode])
AS_HELP_STRING([--disable-unity],[Disable unity (default)]),
[ case "$enableval" in
yes)
want_unity='yes'
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac ],
AC_MSG_RESULT([no])
)
AM_CONDITIONAL([USE_UNITY], [test "$want_unity" = 'yes'])
dnl -----------------------
dnl whether to bundle tests
dnl -----------------------
want_test_bundles='no'
AC_MSG_CHECKING([whether to build tests into single-binary bundles])
AC_ARG_ENABLE(test-bundles,
AS_HELP_STRING([--enable-test-bundles],[Enable test bundles])
AS_HELP_STRING([--disable-test-bundles],[Disable test bundles (default)]),
[ case "$enableval" in
yes)
want_test_bundles='yes'
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac ],
AC_MSG_RESULT([no])
)
AM_CONDITIONAL([USE_TEST_BUNDLES], [test "$want_test_bundles" = 'yes'])
dnl ************************************************************
dnl switch off particular protocols
dnl
AC_MSG_CHECKING([whether to support http])
AC_ARG_ENABLE(http,
AS_HELP_STRING([--enable-http],[Enable HTTP support])
AS_HELP_STRING([--disable-http],[Disable HTTP support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
disable_http="yes"
AC_MSG_WARN([disable HTTP disables FTP over proxy, IPFS and RTSP])
AC_SUBST(CURL_DISABLE_HTTP, [1])
AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS])
AC_SUBST(CURL_DISABLE_IPFS, [1])
AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
AC_SUBST(CURL_DISABLE_RTSP, [1])
dnl toggle off alt-svc too when HTTP is disabled
AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS])
curl_h1_msg="no (--enable-http, --with-hyper)"
curl_altsvc_msg="no";
curl_hsts_msg="no (--enable-hsts)";
enable_altsvc="no"
hsts="no"
;;
*)
AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support ftp])
AC_ARG_ENABLE(ftp,
AS_HELP_STRING([--enable-ftp],[Enable FTP support])
AS_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,
AS_HELP_STRING([--enable-file],[Enable FILE support])
AS_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 IPFS])
AC_ARG_ENABLE(ipfs,
AS_HELP_STRING([--enable-ipfs],[Enable IPFS support])
AS_HELP_STRING([--disable-ipfs],[Disable IPFS support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS])
AC_SUBST(CURL_DISABLE_IPFS, [1])
;;
*)
if test x$CURL_DISABLE_HTTP = x1; then
AC_MSG_ERROR(HTTP support needs to be enabled in order to enable IPFS support!)
else
AC_MSG_RESULT(yes)
curl_ipfs_msg="enabled"
fi
;;
esac ],
if test "x$CURL_DISABLE_HTTP" != "x1"; then
AC_MSG_RESULT(yes)
curl_ipfs_msg="enabled"
else
AC_MSG_RESULT(no)
fi
)
AC_MSG_CHECKING([whether to support ldap])
AC_ARG_ENABLE(ldap,
AS_HELP_STRING([--enable-ldap],[Enable LDAP support])
AS_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])
;;
yes)
ldap_askedfor="yes"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(yes)
;;
esac ],[
AC_MSG_RESULT(yes) ]
)
AC_MSG_CHECKING([whether to support ldaps])
AC_ARG_ENABLE(ldaps,
AS_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
AS_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 ]
)
dnl **********************************************************************
dnl Check for Hyper
dnl **********************************************************************
OPT_HYPER="no"
AC_ARG_WITH(hyper,
AS_HELP_STRING([--with-hyper=PATH],[Enable hyper usage])
AS_HELP_STRING([--without-hyper],[Disable hyper usage]),
[OPT_HYPER=$withval])
case "$OPT_HYPER" in
no)
dnl --without-hyper option used
want_hyper="no"
;;
yes)
dnl --with-hyper option used without path
want_hyper="default"
want_hyper_path=""
;;
*)
dnl --with-hyper option used with path
want_hyper="yes"
want_hyper_path="$withval"
;;
esac
if test X"$want_hyper" != Xno; then
if test "x$disable_http" = "xyes"; then
AC_MSG_ERROR([--with-hyper is not compatible with --disable-http])
fi
dnl backup the pre-hyper variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
CURL_CHECK_PKGCONFIG(hyper, $want_hyper_path)
if test "$PKGCONFIG" != "no"; then
LIB_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
$PKGCONFIG --libs-only-l hyper`
CPP_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path]) dnl
$PKGCONFIG --cflags-only-I hyper`
LD_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
$PKGCONFIG --libs-only-L hyper`
else
dnl no hyper pkg-config found
LIB_HYPER="-lhyper -ldl -lpthread -lm"
if test X"$want_hyper" != Xdefault; then
CPP_HYPER=-I"$want_hyper_path/capi/include"
LD_HYPER="-L$want_hyper_path/target/release -L$want_hyper_path/target/debug"
fi
fi
if test -n "$LIB_HYPER"; then
AC_MSG_NOTICE([-l is $LIB_HYPER])
AC_MSG_NOTICE([-I is $CPP_HYPER])
AC_MSG_NOTICE([-L is $LD_HYPER])
LDFLAGS="$LDFLAGS $LD_HYPER"
CPPFLAGS="$CPPFLAGS $CPP_HYPER"
LIBS="$LIB_HYPER $LIBS"
if test "x$cross_compiling" != "xyes"; then
dnl remove -L, separate with colon if more than one
DIR_HYPER=`echo $LD_HYPER | $SED -e 's/^-L//' -e 's/ -L/:/g'`
fi
AC_CHECK_LIB(hyper, hyper_io_new,
[
AC_CHECK_HEADERS(hyper.h,
experimental="$experimental Hyper"
AC_MSG_NOTICE([Hyper support is experimental])
curl_h1_msg="enabled (Hyper)"
HYPER_ENABLED=1
AC_DEFINE(USE_HYPER, 1, [if hyper is in use])
AC_SUBST(USE_HYPER, [1])
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_HYPER"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_HYPER to CURL_LIBRARY_PATH])
LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE hyper"
)
],
for d in `echo $DIR_HYPER | $SED -e 's/:/ /'`; do
if test -f "$d/libhyper.a"; then
AC_MSG_ERROR([hyper was found in $d but was probably built with wrong flags. See docs/HYPER.md.])
fi
done
AC_MSG_ERROR([--with-hyper but hyper was not found. See docs/HYPER.md.])
)
fi
fi
if test X"$want_hyper" != Xno; then
AC_MSG_NOTICE([Disable RTSP support with hyper])
AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
AC_SUBST(CURL_DISABLE_RTSP, [1])
else
AC_MSG_CHECKING([whether to support rtsp])
AC_ARG_ENABLE(rtsp,
AS_HELP_STRING([--enable-rtsp],[Enable RTSP support])
AS_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
)
fi
AC_MSG_CHECKING([whether to support proxies])
AC_ARG_ENABLE(proxy,
AS_HELP_STRING([--enable-proxy],[Enable proxy support])
AS_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])
https_proxy="no"
;;
*)
AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support dict])
AC_ARG_ENABLE(dict,
AS_HELP_STRING([--enable-dict],[Enable DICT support])
AS_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,
AS_HELP_STRING([--enable-telnet],[Enable TELNET support])
AS_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,
AS_HELP_STRING([--enable-tftp],[Enable TFTP support])
AS_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)