configure.ac 131 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2022, Daniel Stenberg, <[email protected]>, et al.
  9. #
  10. # This software is licensed as described in the file COPYING, which
  11. # you should have received as part of this distribution. The terms
  12. # are also available at https://curl.se/docs/copyright.html.
  13. #
  14. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. # copies of the Software, and permit persons to whom the Software is
  16. # furnished to do so, under the terms of the COPYING file.
  17. #
  18. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. # KIND, either express or implied.
  20. #
  21. # SPDX-License-Identifier: curl
  22. #
  23. #***************************************************************************
  24. dnl Process this file with autoconf to produce a configure script.
  25. AC_PREREQ(2.59)
  26. dnl We don't know the version number "statically" so we use a dash here
  27. AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.se/mail/])
  28. XC_OVR_ZZ50
  29. XC_OVR_ZZ60
  30. CURL_OVERRIDE_AUTOCONF
  31. dnl configure script copyright
  32. AC_COPYRIGHT([Copyright (c) 1998 - 2022 Daniel Stenberg, <[email protected]>
  33. This configure script may be copied, distributed and modified under the
  34. terms of the curl license; see COPYING for more details])
  35. AC_CONFIG_SRCDIR([lib/urldata.h])
  36. AC_CONFIG_HEADERS(lib/curl_config.h)
  37. AC_CONFIG_MACRO_DIR([m4])
  38. AM_MAINTAINER_MODE
  39. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  40. CURL_CHECK_OPTION_DEBUG
  41. CURL_CHECK_OPTION_OPTIMIZE
  42. CURL_CHECK_OPTION_WARNINGS
  43. CURL_CHECK_OPTION_WERROR
  44. CURL_CHECK_OPTION_CURLDEBUG
  45. CURL_CHECK_OPTION_SYMBOL_HIDING
  46. CURL_CHECK_OPTION_ARES
  47. CURL_CHECK_OPTION_RT
  48. CURL_CHECK_OPTION_ECH
  49. XC_CHECK_PATH_SEPARATOR
  50. #
  51. # save the configure arguments
  52. #
  53. CONFIGURE_OPTIONS="\"$ac_configure_args\""
  54. AC_SUBST(CONFIGURE_OPTIONS)
  55. dnl SED is mandatory for configure process and libtool.
  56. dnl Set it now, allowing it to be changed later.
  57. if test -z "$SED"; then
  58. dnl allow it to be overridden
  59. AC_PATH_PROG([SED], [sed], [not_found],
  60. [$PATH:/usr/bin:/usr/local/bin])
  61. if test -z "$SED" || test "$SED" = "not_found"; then
  62. AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
  63. fi
  64. fi
  65. AC_SUBST([SED])
  66. dnl GREP is mandatory for configure process and libtool.
  67. dnl Set it now, allowing it to be changed later.
  68. if test -z "$GREP"; then
  69. dnl allow it to be overridden
  70. AC_PATH_PROG([GREP], [grep], [not_found],
  71. [$PATH:/usr/bin:/usr/local/bin])
  72. if test -z "$GREP" || test "$GREP" = "not_found"; then
  73. AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
  74. fi
  75. fi
  76. AC_SUBST([GREP])
  77. dnl EGREP is mandatory for configure process and libtool.
  78. dnl Set it now, allowing it to be changed later.
  79. if test -z "$EGREP"; then
  80. dnl allow it to be overridden
  81. if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
  82. AC_MSG_CHECKING([for egrep])
  83. EGREP="$GREP -E"
  84. AC_MSG_RESULT([$EGREP])
  85. else
  86. AC_PATH_PROG([EGREP], [egrep], [not_found],
  87. [$PATH:/usr/bin:/usr/local/bin])
  88. fi
  89. fi
  90. if test -z "$EGREP" || test "$EGREP" = "not_found"; then
  91. AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
  92. fi
  93. AC_SUBST([EGREP])
  94. dnl AR is mandatory for configure process and libtool.
  95. dnl This is target dependent, so check it as a tool.
  96. if test -z "$AR"; then
  97. dnl allow it to be overridden
  98. AC_PATH_TOOL([AR], [ar], [not_found],
  99. [$PATH:/usr/bin:/usr/local/bin])
  100. if test -z "$AR" || test "$AR" = "not_found"; then
  101. AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
  102. fi
  103. fi
  104. AC_SUBST([AR])
  105. AC_SUBST(libext)
  106. dnl figure out the libcurl version
  107. CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
  108. XC_CHECK_PROG_CC
  109. CURL_ATOMIC
  110. dnl for --enable-code-coverage
  111. CURL_COVERAGE
  112. XC_AUTOMAKE
  113. AC_MSG_CHECKING([curl version])
  114. AC_MSG_RESULT($CURLVERSION)
  115. AC_SUBST(CURLVERSION)
  116. dnl
  117. dnl we extract the numerical version for curl-config only
  118. VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
  119. AC_SUBST(VERSIONNUM)
  120. dnl Solaris pkgadd support definitions
  121. PKGADD_PKG="HAXXcurl"
  122. PKGADD_NAME="curl - a client that groks URLs"
  123. PKGADD_VENDOR="curl.se"
  124. AC_SUBST(PKGADD_PKG)
  125. AC_SUBST(PKGADD_NAME)
  126. AC_SUBST(PKGADD_VENDOR)
  127. dnl
  128. dnl initialize all the info variables
  129. curl_ssl_msg="no (--with-{openssl,gnutls,nss,mbedtls,wolfssl,schannel,secure-transport,amissl,bearssl,rustls} )"
  130. curl_ssh_msg="no (--with-{libssh,libssh2})"
  131. curl_zlib_msg="no (--with-zlib)"
  132. curl_brotli_msg="no (--with-brotli)"
  133. curl_zstd_msg="no (--with-zstd)"
  134. curl_gss_msg="no (--with-gssapi)"
  135. curl_gsasl_msg="no (--with-gsasl)"
  136. curl_tls_srp_msg="no (--enable-tls-srp)"
  137. curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
  138. curl_ipv6_msg="no (--enable-ipv6)"
  139. curl_unix_sockets_msg="no (--enable-unix-sockets)"
  140. curl_idn_msg="no (--with-{libidn2,winidn})"
  141. curl_manual_msg="no (--enable-manual)"
  142. curl_libcurl_msg="enabled (--disable-libcurl-option)"
  143. curl_verbose_msg="enabled (--disable-verbose)"
  144. curl_sspi_msg="no (--enable-sspi)"
  145. curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
  146. curl_ldaps_msg="no (--enable-ldaps)"
  147. curl_rtsp_msg="no (--enable-rtsp)"
  148. curl_rtmp_msg="no (--with-librtmp)"
  149. curl_psl_msg="no (--with-libpsl)"
  150. curl_altsvc_msg="enabled (--disable-alt-svc)"
  151. curl_headers_msg="enabled (--disable-headers-api)"
  152. curl_hsts_msg="enabled (--disable-hsts)"
  153. ssl_backends=
  154. curl_h1_msg="enabled (internal)"
  155. curl_h2_msg="no (--with-nghttp2, --with-hyper)"
  156. curl_h3_msg="no (--with-ngtcp2, --with-quiche --with-msh3)"
  157. enable_altsvc="yes"
  158. hsts="yes"
  159. dnl
  160. dnl Save some initial values the user might have provided
  161. dnl
  162. INITIAL_LDFLAGS=$LDFLAGS
  163. INITIAL_LIBS=$LIBS
  164. dnl **********************************************************************
  165. dnl See which TLS backend(s) that are requested. Just do all the
  166. dnl TLS AC_ARG_WITH() invokes here and do the checks later
  167. dnl **********************************************************************
  168. OPT_SCHANNEL=no
  169. AC_ARG_WITH(schannel,dnl
  170. AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]),
  171. OPT_SCHANNEL=$withval
  172. TLSCHOICE="schannel")
  173. OPT_SECURETRANSPORT=no
  174. AC_ARG_WITH(secure-transport,dnl
  175. AS_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]),[
  176. OPT_SECURETRANSPORT=$withval
  177. TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Secure-Transport"
  178. ])
  179. OPT_AMISSL=no
  180. AC_ARG_WITH(amissl,dnl
  181. AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),[
  182. OPT_AMISSL=$withval
  183. TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL"
  184. ])
  185. OPT_OPENSSL=no
  186. dnl Default to no CA bundle
  187. ca="no"
  188. AC_ARG_WITH(ssl,dnl
  189. AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl])
  190. AS_HELP_STRING([--without-ssl], [build without any TLS library]),[
  191. OPT_SSL=$withval
  192. OPT_OPENSSL=$withval
  193. if test X"$withval" != Xno; then
  194. TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
  195. else
  196. SSL_DISABLED="D"
  197. fi
  198. ])
  199. AC_ARG_WITH(openssl,dnl
  200. 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]),[
  201. OPT_OPENSSL=$withval
  202. if test X"$withval" != Xno; then
  203. TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
  204. fi
  205. ])
  206. OPT_GNUTLS=no
  207. AC_ARG_WITH(gnutls,dnl
  208. AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),[
  209. OPT_GNUTLS=$withval
  210. if test X"$withval" != Xno; then
  211. TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS"
  212. fi
  213. ])
  214. OPT_MBEDTLS=no
  215. AC_ARG_WITH(mbedtls,dnl
  216. AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),[
  217. OPT_MBEDTLS=$withval
  218. if test X"$withval" != Xno; then
  219. TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS"
  220. fi
  221. ])
  222. OPT_WOLFSSL=no
  223. AC_ARG_WITH(wolfssl,dnl
  224. AS_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)]),[
  225. OPT_WOLFSSL=$withval
  226. if test X"$withval" != Xno; then
  227. TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL"
  228. fi
  229. ])
  230. OPT_BEARSSL=no
  231. AC_ARG_WITH(bearssl,dnl
  232. AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root]),[
  233. OPT_BEARSSL=$withval
  234. if test X"$withval" != Xno; then
  235. TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL"
  236. fi
  237. ])
  238. OPT_RUSTLS=no
  239. AC_ARG_WITH(rustls,dnl
  240. AS_HELP_STRING([--with-rustls=PATH],[where to look for rustls, PATH points to the installation root]),[
  241. OPT_RUSTLS=$withval
  242. if test X"$withval" != Xno; then
  243. TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls"
  244. experimental="$experimental rustls"
  245. fi
  246. ])
  247. OPT_NSS_AWARE=no
  248. AC_ARG_WITH(nss-deprecated,dnl
  249. AS_HELP_STRING([--with-nss-deprecated],[confirm you realize NSS is going away]),
  250. if test X"$withval" != Xno; then
  251. OPT_NSS_AWARE=$withval
  252. fi
  253. )
  254. OPT_NSS=no
  255. AC_ARG_WITH(nss,dnl
  256. AS_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]),
  257. OPT_NSS=$withval
  258. if test X"$withval" != Xno; then
  259. if test X"$OPT_NSS_AWARE" = "Xno" ; then
  260. AC_MSG_ERROR([NSS use must be confirmed using --with-nss-deprecated. NSS support will be dropped from curl in August 2022. See docs/DEPRECATE.md])
  261. fi
  262. [TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }NSS"]
  263. fi
  264. )
  265. dnl If no TLS choice has been made, check if it was explicitly disabled or
  266. dnl error out to force the user to decide.
  267. if test -z "$TLSCHOICE"; then
  268. if test "x$OPT_SSL" != "xno"; then
  269. AC_MSG_ERROR([select TLS backend(s) or disable TLS with --without-ssl.
  270. Select from these:
  271. --with-amissl
  272. --with-bearssl
  273. --with-gnutls
  274. --with-mbedtls
  275. --with-nss
  276. --with-openssl (also works for BoringSSL and libressl)
  277. --with-rustls
  278. --with-schannel
  279. --with-secure-transport
  280. --with-wolfssl
  281. ])
  282. fi
  283. fi
  284. AC_ARG_WITH(darwinssl,,
  285. AC_MSG_ERROR([--with-darwin-ssl no longer works!]))
  286. dnl
  287. dnl Detect the canonical host and target build environment
  288. dnl
  289. AC_CANONICAL_HOST
  290. dnl Get system canonical name
  291. AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
  292. # Silence warning: ar: 'u' modifier ignored since 'D' is the default
  293. AC_SUBST(AR_FLAGS, [cr])
  294. dnl This defines _ALL_SOURCE for AIX
  295. CURL_CHECK_AIX_ALL_SOURCE
  296. dnl Our configure and build reentrant settings
  297. CURL_CONFIGURE_THREAD_SAFE
  298. CURL_CONFIGURE_REENTRANT
  299. dnl check for how to do large files
  300. AC_SYS_LARGEFILE
  301. XC_LIBTOOL
  302. #
  303. # Automake conditionals based on libtool related checks
  304. #
  305. AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
  306. [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
  307. AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
  308. [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
  309. AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
  310. [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
  311. #
  312. # Due to libtool and automake machinery limitations of not allowing
  313. # specifying separate CPPFLAGS or CFLAGS when compiling objects for
  314. # inclusion of these in shared or static libraries, we are forced to
  315. # build using separate configure runs for shared and static libraries
  316. # on systems where different CPPFLAGS or CFLAGS are mandatory in order
  317. # to compile objects for each kind of library. Notice that relying on
  318. # the '-DPIC' CFLAG that libtool provides is not valid given that the
  319. # user might for example choose to build static libraries with PIC.
  320. #
  321. #
  322. # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
  323. # targeting a static library and not building its shared counterpart.
  324. #
  325. AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
  326. [test "x$xc_lt_build_static_only" = 'xyes'])
  327. #
  328. # Make staticlib CPPFLAG variable and its definition visible in output
  329. # files unconditionally, providing an empty definition unless strictly
  330. # targeting a static library and not building its shared counterpart.
  331. #
  332. CPPFLAG_CURL_STATICLIB=
  333. if test "x$xc_lt_build_static_only" = 'xyes'; then
  334. CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
  335. fi
  336. AC_SUBST([CPPFLAG_CURL_STATICLIB])
  337. # Determine whether all dependent libraries must be specified when linking
  338. if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
  339. then
  340. REQUIRE_LIB_DEPS=no
  341. else
  342. REQUIRE_LIB_DEPS=yes
  343. fi
  344. AC_SUBST(REQUIRE_LIB_DEPS)
  345. AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
  346. dnl check if there's a way to force code inline
  347. AC_C_INLINE
  348. dnl **********************************************************************
  349. dnl platform/compiler/architecture specific checks/flags
  350. dnl **********************************************************************
  351. CURL_CHECK_COMPILER
  352. CURL_SET_COMPILER_BASIC_OPTS
  353. CURL_SET_COMPILER_DEBUG_OPTS
  354. CURL_SET_COMPILER_OPTIMIZE_OPTS
  355. CURL_SET_COMPILER_WARNING_OPTS
  356. if test "$compiler_id" = "INTEL_UNIX_C"; then
  357. #
  358. if test "$compiler_num" -ge "1000"; then
  359. dnl icc 10.X or later
  360. CFLAGS="$CFLAGS -shared-intel"
  361. elif test "$compiler_num" -ge "900"; then
  362. dnl icc 9.X specific
  363. CFLAGS="$CFLAGS -i-dynamic"
  364. fi
  365. #
  366. fi
  367. CURL_CFLAG_EXTRAS=""
  368. if test X"$want_werror" = Xyes; then
  369. CURL_CFLAG_EXTRAS="-Werror"
  370. if test "$compiler_id" = "GNU_C"; then
  371. dnl enable -pedantic-errors for GCC 5 and later,
  372. dnl as before that it was the same as -Werror=pedantic
  373. if test "$compiler_num" -ge "500"; then
  374. CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
  375. fi
  376. fi
  377. fi
  378. AC_SUBST(CURL_CFLAG_EXTRAS)
  379. CURL_CHECK_COMPILER_HALT_ON_ERROR
  380. CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
  381. CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
  382. CURL_CHECK_COMPILER_SYMBOL_HIDING
  383. CURL_CHECK_CURLDEBUG
  384. AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
  385. supports_unittests=yes
  386. # cross-compilation of unit tests static library/programs fails when
  387. # libcurl shared library is built. This might be due to a libtool or
  388. # automake issue. In this case we disable unit tests.
  389. if test "x$cross_compiling" != "xno" &&
  390. test "x$enable_shared" != "xno"; then
  391. supports_unittests=no
  392. fi
  393. # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
  394. # a problem related with OpenSSL headers and library versions not matching.
  395. # Disable unit tests while time to further investigate this is found.
  396. case $host in
  397. mips-sgi-irix6.5)
  398. if test "$compiler_id" = "GNU_C"; then
  399. supports_unittests=no
  400. fi
  401. ;;
  402. esac
  403. # All AIX autobuilds fails unit tests linking against unittests library
  404. # due to unittests library being built with no symbols or members. Libtool ?
  405. # Disable unit tests while time to further investigate this is found.
  406. case $host_os in
  407. aix*)
  408. supports_unittests=no
  409. ;;
  410. esac
  411. dnl Build unit tests when option --enable-debug is given.
  412. if test "x$want_debug" = "xyes" &&
  413. test "x$supports_unittests" = "xyes"; then
  414. want_unittests=yes
  415. else
  416. want_unittests=no
  417. fi
  418. AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
  419. # For original MinGW (ie not MinGW-w64) define the Windows minimum supported OS
  420. # version to Windows XP (0x501) if it hasn't already been defined by the user.
  421. # Without this override original MinGW defaults the version to Windows NT 4.0.
  422. # Note original MinGW sets _WIN32_WINNT if not defined to whatever WINVER is.
  423. case $host in
  424. *-*-mingw32*)
  425. AC_MSG_CHECKING([if MinGW minimum supported OS should be set to XP])
  426. AC_COMPILE_IFELSE([
  427. AC_LANG_PROGRAM([[
  428. #include <_mingw.h>
  429. ]],[[
  430. #if defined(__MINGW64_VERSION_MAJOR) || \
  431. defined(WINVER) || \
  432. defined(_WIN32_WINNT)
  433. #error
  434. #endif
  435. ]])
  436. ],[
  437. CPPFLAGS="$CPPFLAGS -DWINVER=0x501"
  438. AC_MSG_RESULT([yes])
  439. ],[
  440. AC_MSG_RESULT([no])
  441. ])
  442. ;;
  443. esac
  444. # Detect original MinGW (not MinGW-w64)
  445. curl_mingw_original=no
  446. case $host in
  447. *-*-mingw32*)
  448. AC_MSG_CHECKING([using original MinGW (not MinGW-w64)])
  449. AC_COMPILE_IFELSE([
  450. AC_LANG_PROGRAM([[
  451. #include <_mingw.h>
  452. ]],[[
  453. #if defined(__MINGW64_VERSION_MAJOR)
  454. #error
  455. #endif
  456. ]])
  457. ],[
  458. curl_mingw_original=yes
  459. AC_MSG_RESULT([yes])
  460. ],[
  461. AC_MSG_RESULT([no])
  462. ])
  463. ;;
  464. esac
  465. dnl **********************************************************************
  466. dnl Compilation based checks should not be done before this point.
  467. dnl **********************************************************************
  468. dnl **********************************************************************
  469. dnl Make sure that our checks for headers windows.h winsock2.h
  470. dnl and ws2tcpip.h take precedence over any other further checks which
  471. dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
  472. dnl this specific header files. And do them before its results are used.
  473. dnl **********************************************************************
  474. CURL_CHECK_HEADER_WINDOWS
  475. CURL_CHECK_NATIVE_WINDOWS
  476. case X-"$curl_cv_native_windows" in
  477. X-yes)
  478. CURL_CHECK_HEADER_WINSOCK2
  479. CURL_CHECK_HEADER_WS2TCPIP
  480. CURL_CHECK_HEADER_WINCRYPT
  481. CURL_CHECK_HEADER_WINLDAP
  482. ;;
  483. *)
  484. curl_cv_header_winsock2_h="no"
  485. curl_cv_header_ws2tcpip_h="no"
  486. curl_cv_header_wincrypt_h="no"
  487. curl_cv_header_winldap_h="no"
  488. ;;
  489. esac
  490. CURL_CHECK_WIN32_LARGEFILE
  491. CURL_CHECK_WIN32_CRYPTO
  492. CURL_DARWIN_CFLAGS
  493. CURL_DARWIN_SYSTEMCONFIGURATION
  494. CURL_SUPPORTS_BUILTIN_AVAILABLE
  495. dnl ************************************************************
  496. dnl switch off particular protocols
  497. dnl
  498. AC_MSG_CHECKING([whether to support http])
  499. AC_ARG_ENABLE(http,
  500. AS_HELP_STRING([--enable-http],[Enable HTTP support])
  501. AS_HELP_STRING([--disable-http],[Disable HTTP support]),
  502. [ case "$enableval" in
  503. no)
  504. AC_MSG_RESULT(no)
  505. AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
  506. disable_http="yes"
  507. AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
  508. AC_SUBST(CURL_DISABLE_HTTP, [1])
  509. AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
  510. AC_SUBST(CURL_DISABLE_RTSP, [1])
  511. dnl toggle off alt-svc too when HTTP is disabled
  512. AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
  513. AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS])
  514. curl_h1_msg="no (--enable-http, --with-hyper)"
  515. curl_altsvc_msg="no";
  516. curl_hsts_msg="no (--enable-hsts)";
  517. enable_altsvc="no"
  518. hsts="no"
  519. ;;
  520. *) AC_MSG_RESULT(yes)
  521. ;;
  522. esac ],
  523. AC_MSG_RESULT(yes)
  524. )
  525. AC_MSG_CHECKING([whether to support ftp])
  526. AC_ARG_ENABLE(ftp,
  527. AS_HELP_STRING([--enable-ftp],[Enable FTP support])
  528. AS_HELP_STRING([--disable-ftp],[Disable FTP support]),
  529. [ case "$enableval" in
  530. no)
  531. AC_MSG_RESULT(no)
  532. AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
  533. AC_SUBST(CURL_DISABLE_FTP, [1])
  534. ;;
  535. *) AC_MSG_RESULT(yes)
  536. ;;
  537. esac ],
  538. AC_MSG_RESULT(yes)
  539. )
  540. AC_MSG_CHECKING([whether to support file])
  541. AC_ARG_ENABLE(file,
  542. AS_HELP_STRING([--enable-file],[Enable FILE support])
  543. AS_HELP_STRING([--disable-file],[Disable FILE support]),
  544. [ case "$enableval" in
  545. no)
  546. AC_MSG_RESULT(no)
  547. AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
  548. AC_SUBST(CURL_DISABLE_FILE, [1])
  549. ;;
  550. *) AC_MSG_RESULT(yes)
  551. ;;
  552. esac ],
  553. AC_MSG_RESULT(yes)
  554. )
  555. AC_MSG_CHECKING([whether to support ldap])
  556. AC_ARG_ENABLE(ldap,
  557. AS_HELP_STRING([--enable-ldap],[Enable LDAP support])
  558. AS_HELP_STRING([--disable-ldap],[Disable LDAP support]),
  559. [ case "$enableval" in
  560. no)
  561. AC_MSG_RESULT(no)
  562. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  563. AC_SUBST(CURL_DISABLE_LDAP, [1])
  564. ;;
  565. yes)
  566. ldap_askedfor="yes"
  567. AC_MSG_RESULT(yes)
  568. ;;
  569. *)
  570. AC_MSG_RESULT(yes)
  571. ;;
  572. esac ],[
  573. AC_MSG_RESULT(yes) ]
  574. )
  575. AC_MSG_CHECKING([whether to support ldaps])
  576. AC_ARG_ENABLE(ldaps,
  577. AS_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
  578. AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
  579. [ case "$enableval" in
  580. no)
  581. AC_MSG_RESULT(no)
  582. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  583. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  584. ;;
  585. *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
  586. AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
  587. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  588. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  589. else
  590. AC_MSG_RESULT(yes)
  591. AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
  592. AC_SUBST(HAVE_LDAP_SSL, [1])
  593. fi
  594. ;;
  595. esac ],[
  596. if test "x$CURL_DISABLE_LDAP" = "x1" ; then
  597. AC_MSG_RESULT(no)
  598. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  599. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  600. else
  601. AC_MSG_RESULT(yes)
  602. AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
  603. AC_SUBST(HAVE_LDAP_SSL, [1])
  604. fi ]
  605. )
  606. dnl **********************************************************************
  607. dnl Check for Hyper
  608. dnl **********************************************************************
  609. OPT_HYPER="no"
  610. AC_ARG_WITH(hyper,
  611. AS_HELP_STRING([--with-hyper=PATH],[Enable hyper usage])
  612. AS_HELP_STRING([--without-hyper],[Disable hyper usage]),
  613. [OPT_HYPER=$withval])
  614. case "$OPT_HYPER" in
  615. no)
  616. dnl --without-hyper option used
  617. want_hyper="no"
  618. ;;
  619. yes)
  620. dnl --with-hyper option used without path
  621. want_hyper="default"
  622. want_hyper_path=""
  623. ;;
  624. *)
  625. dnl --with-hyper option used with path
  626. want_hyper="yes"
  627. want_hyper_path="$withval"
  628. ;;
  629. esac
  630. if test X"$want_hyper" != Xno; then
  631. if test "x$disable_http" = "xyes"; then
  632. AC_MSG_ERROR([--with-hyper is not compatible with --disable-http])
  633. fi
  634. dnl backup the pre-hyper variables
  635. CLEANLDFLAGS="$LDFLAGS"
  636. CLEANCPPFLAGS="$CPPFLAGS"
  637. CLEANLIBS="$LIBS"
  638. CURL_CHECK_PKGCONFIG(hyper, $want_hyper_path)
  639. if test "$PKGCONFIG" != "no" ; then
  640. LIB_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
  641. $PKGCONFIG --libs-only-l hyper`
  642. CPP_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path]) dnl
  643. $PKGCONFIG --cflags-only-I hyper`
  644. LD_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
  645. $PKGCONFIG --libs-only-L hyper`
  646. else
  647. dnl no hyper pkg-config found
  648. LIB_HYPER="-lhyper -ldl -lpthread -lm"
  649. if test X"$want_hyper" != Xdefault; then
  650. CPP_HYPER=-I"$want_hyper_path/capi/include"
  651. LD_HYPER="-L$want_hyper_path/target/release -L$want_hyper_path/target/debug"
  652. fi
  653. fi
  654. if test -n "$LIB_HYPER"; then
  655. AC_MSG_NOTICE([-l is $LIB_HYPER])
  656. AC_MSG_NOTICE([-I is $CPP_HYPER])
  657. AC_MSG_NOTICE([-L is $LD_HYPER])
  658. LDFLAGS="$LDFLAGS $LD_HYPER"
  659. CPPFLAGS="$CPPFLAGS $CPP_HYPER"
  660. LIBS="$LIB_HYPER $LIBS"
  661. if test "x$cross_compiling" != "xyes"; then
  662. dnl remove -L, separate with colon if more than one
  663. DIR_HYPER=`echo $LD_HYPER | $SED -e 's/^-L//' -e 's/ -L/:/g'`
  664. fi
  665. AC_CHECK_LIB(hyper, hyper_io_new,
  666. [
  667. AC_CHECK_HEADERS(hyper.h,
  668. experimental="$experimental Hyper"
  669. AC_MSG_NOTICE([Hyper support is experimental])
  670. curl_h1_msg="enabled (Hyper)"
  671. curl_h2_msg=$curl_h1_msg
  672. HYPER_ENABLED=1
  673. AC_DEFINE(USE_HYPER, 1, [if hyper is in use])
  674. AC_SUBST(USE_HYPER, [1])
  675. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_HYPER"
  676. export CURL_LIBRARY_PATH
  677. AC_MSG_NOTICE([Added $DIR_HYPER to CURL_LIBRARY_PATH]),
  678. )
  679. ],
  680. for d in `echo $DIR_HYPER | $SED -e 's/:/ /'`; do
  681. if test -f "$d/libhyper.a"; then
  682. AC_MSG_ERROR([hyper was found in $d but was probably built with wrong flags. See docs/HYPER.md.])
  683. fi
  684. done
  685. AC_MSG_ERROR([--with-hyper but hyper was not found. See docs/HYPER.md.])
  686. )
  687. fi
  688. fi
  689. if test X"$want_hyper" != Xno; then
  690. AC_MSG_NOTICE([Disable RTSP support with hyper])
  691. AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
  692. AC_SUBST(CURL_DISABLE_RTSP, [1])
  693. else
  694. AC_MSG_CHECKING([whether to support rtsp])
  695. AC_ARG_ENABLE(rtsp,
  696. AS_HELP_STRING([--enable-rtsp],[Enable RTSP support])
  697. AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
  698. [ case "$enableval" in
  699. no)
  700. AC_MSG_RESULT(no)
  701. AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
  702. AC_SUBST(CURL_DISABLE_RTSP, [1])
  703. ;;
  704. *)
  705. if test x$CURL_DISABLE_HTTP = x1 ; then
  706. AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
  707. else
  708. AC_MSG_RESULT(yes)
  709. curl_rtsp_msg="enabled"
  710. fi
  711. ;;
  712. esac ],
  713. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  714. AC_MSG_RESULT(yes)
  715. curl_rtsp_msg="enabled"
  716. else
  717. AC_MSG_RESULT(no)
  718. fi
  719. )
  720. fi
  721. AC_MSG_CHECKING([whether to support proxies])
  722. AC_ARG_ENABLE(proxy,
  723. AS_HELP_STRING([--enable-proxy],[Enable proxy support])
  724. AS_HELP_STRING([--disable-proxy],[Disable proxy support]),
  725. [ case "$enableval" in
  726. no)
  727. AC_MSG_RESULT(no)
  728. AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
  729. AC_SUBST(CURL_DISABLE_PROXY, [1])
  730. https_proxy="no"
  731. ;;
  732. *) AC_MSG_RESULT(yes)
  733. ;;
  734. esac ],
  735. AC_MSG_RESULT(yes)
  736. )
  737. AC_MSG_CHECKING([whether to support dict])
  738. AC_ARG_ENABLE(dict,
  739. AS_HELP_STRING([--enable-dict],[Enable DICT support])
  740. AS_HELP_STRING([--disable-dict],[Disable DICT support]),
  741. [ case "$enableval" in
  742. no)
  743. AC_MSG_RESULT(no)
  744. AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
  745. AC_SUBST(CURL_DISABLE_DICT, [1])
  746. ;;
  747. *) AC_MSG_RESULT(yes)
  748. ;;
  749. esac ],
  750. AC_MSG_RESULT(yes)
  751. )
  752. AC_MSG_CHECKING([whether to support telnet])
  753. AC_ARG_ENABLE(telnet,
  754. AS_HELP_STRING([--enable-telnet],[Enable TELNET support])
  755. AS_HELP_STRING([--disable-telnet],[Disable TELNET support]),
  756. [ case "$enableval" in
  757. no)
  758. AC_MSG_RESULT(no)
  759. AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
  760. AC_SUBST(CURL_DISABLE_TELNET, [1])
  761. ;;
  762. *) AC_MSG_RESULT(yes)
  763. ;;
  764. esac ],
  765. AC_MSG_RESULT(yes)
  766. )
  767. AC_MSG_CHECKING([whether to support tftp])
  768. AC_ARG_ENABLE(tftp,
  769. AS_HELP_STRING([--enable-tftp],[Enable TFTP support])
  770. AS_HELP_STRING([--disable-tftp],[Disable TFTP support]),
  771. [ case "$enableval" in
  772. no)
  773. AC_MSG_RESULT(no)
  774. AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
  775. AC_SUBST(CURL_DISABLE_TFTP, [1])
  776. ;;
  777. *) AC_MSG_RESULT(yes)
  778. ;;
  779. esac ],
  780. AC_MSG_RESULT(yes)
  781. )
  782. AC_MSG_CHECKING([whether to support pop3])
  783. AC_ARG_ENABLE(pop3,
  784. AS_HELP_STRING([--enable-pop3],[Enable POP3 support])
  785. AS_HELP_STRING([--disable-pop3],[Disable POP3 support]),
  786. [ case "$enableval" in
  787. no)
  788. AC_MSG_RESULT(no)
  789. AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
  790. AC_SUBST(CURL_DISABLE_POP3, [1])
  791. ;;
  792. *) AC_MSG_RESULT(yes)
  793. ;;
  794. esac ],
  795. AC_MSG_RESULT(yes)
  796. )
  797. AC_MSG_CHECKING([whether to support imap])
  798. AC_ARG_ENABLE(imap,
  799. AS_HELP_STRING([--enable-imap],[Enable IMAP support])
  800. AS_HELP_STRING([--disable-imap],[Disable IMAP support]),
  801. [ case "$enableval" in
  802. no)
  803. AC_MSG_RESULT(no)
  804. AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
  805. AC_SUBST(CURL_DISABLE_IMAP, [1])
  806. ;;
  807. *) AC_MSG_RESULT(yes)
  808. ;;
  809. esac ],
  810. AC_MSG_RESULT(yes)
  811. )
  812. AC_MSG_CHECKING([whether to support smb])
  813. AC_ARG_ENABLE(smb,
  814. AS_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
  815. AS_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
  816. [ case "$enableval" in
  817. no)
  818. AC_MSG_RESULT(no)
  819. AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
  820. AC_SUBST(CURL_DISABLE_SMB, [1])
  821. ;;
  822. *) AC_MSG_RESULT(yes)
  823. ;;
  824. esac ],
  825. AC_MSG_RESULT(yes)
  826. )
  827. AC_MSG_CHECKING([whether to support smtp])
  828. AC_ARG_ENABLE(smtp,
  829. AS_HELP_STRING([--enable-smtp],[Enable SMTP support])
  830. AS_HELP_STRING([--disable-smtp],[Disable SMTP support]),
  831. [ case "$enableval" in
  832. no)
  833. AC_MSG_RESULT(no)
  834. AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
  835. AC_SUBST(CURL_DISABLE_SMTP, [1])
  836. ;;
  837. *) AC_MSG_RESULT(yes)
  838. ;;
  839. esac ],
  840. AC_MSG_RESULT(yes)
  841. )
  842. AC_MSG_CHECKING([whether to support gopher])
  843. AC_ARG_ENABLE(gopher,
  844. AS_HELP_STRING([--enable-gopher],[Enable Gopher support])
  845. AS_HELP_STRING([--disable-gopher],[Disable Gopher support]),
  846. [ case "$enableval" in
  847. no)
  848. AC_MSG_RESULT(no)
  849. AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
  850. AC_SUBST(CURL_DISABLE_GOPHER, [1])
  851. ;;
  852. *) AC_MSG_RESULT(yes)
  853. ;;
  854. esac ],
  855. AC_MSG_RESULT(yes)
  856. )
  857. AC_MSG_CHECKING([whether to support mqtt])
  858. AC_ARG_ENABLE(mqtt,
  859. AS_HELP_STRING([--enable-mqtt],[Enable MQTT support])
  860. AS_HELP_STRING([--disable-mqtt],[Disable MQTT support]),
  861. [ case "$enableval" in
  862. no)
  863. AC_MSG_RESULT(no)
  864. AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT])
  865. AC_SUBST(CURL_DISABLE_MQTT, [1])
  866. ;;
  867. *) AC_MSG_RESULT(yes)
  868. ;;
  869. esac ],
  870. AC_MSG_RESULT(no)
  871. )
  872. dnl **********************************************************************
  873. dnl Check for built-in manual
  874. dnl **********************************************************************
  875. AC_MSG_CHECKING([whether to provide built-in manual])
  876. AC_ARG_ENABLE(manual,
  877. AS_HELP_STRING([--enable-manual],[Enable built-in manual])
  878. AS_HELP_STRING([--disable-manual],[Disable built-in manual]),
  879. [ case "$enableval" in
  880. no)
  881. AC_MSG_RESULT(no)
  882. ;;
  883. *) AC_MSG_RESULT(yes)
  884. USE_MANUAL="1"
  885. ;;
  886. esac ],
  887. AC_MSG_RESULT(yes)
  888. USE_MANUAL="1"
  889. )
  890. dnl The actual use of the USE_MANUAL variable is done much later in this
  891. dnl script to allow other actions to disable it as well.
  892. dnl ************************************************************
  893. dnl disable C code generation support
  894. dnl
  895. AC_MSG_CHECKING([whether to enable generation of C code])
  896. AC_ARG_ENABLE(libcurl_option,
  897. AS_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
  898. AS_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
  899. [ case "$enableval" in
  900. no)
  901. AC_MSG_RESULT(no)
  902. AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
  903. curl_libcurl_msg="no"
  904. ;;
  905. *) AC_MSG_RESULT(yes)
  906. ;;
  907. esac ],
  908. AC_MSG_RESULT(yes)
  909. )
  910. dnl **********************************************************************
  911. dnl Checks for libraries.
  912. dnl **********************************************************************
  913. AC_MSG_CHECKING([whether to use libgcc])
  914. AC_ARG_ENABLE(libgcc,
  915. AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
  916. [ case "$enableval" in
  917. yes)
  918. LIBS="-lgcc $LIBS"
  919. AC_MSG_RESULT(yes)
  920. ;;
  921. *) AC_MSG_RESULT(no)
  922. ;;
  923. esac ],
  924. AC_MSG_RESULT(no)
  925. )
  926. CURL_CHECK_LIB_XNET
  927. dnl gethostbyname without lib or in the nsl lib?
  928. AC_CHECK_FUNC(gethostbyname,
  929. [HAVE_GETHOSTBYNAME="1"
  930. ],
  931. [ AC_CHECK_LIB(nsl, gethostbyname,
  932. [HAVE_GETHOSTBYNAME="1"
  933. LIBS="-lnsl $LIBS"
  934. ])
  935. ])
  936. if test "$HAVE_GETHOSTBYNAME" != "1"
  937. then
  938. dnl gethostbyname in the socket lib?
  939. AC_CHECK_LIB(socket, gethostbyname,
  940. [HAVE_GETHOSTBYNAME="1"
  941. LIBS="-lsocket $LIBS"
  942. ])
  943. fi
  944. if test "$HAVE_GETHOSTBYNAME" != "1"
  945. then
  946. dnl gethostbyname in the watt lib?
  947. AC_CHECK_LIB(watt, gethostbyname,
  948. [HAVE_GETHOSTBYNAME="1"
  949. CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
  950. LDFLAGS="-L/dev/env/WATT_ROOT/lib"
  951. LIBS="-lwatt $LIBS"
  952. ])
  953. fi
  954. dnl At least one system has been identified to require BOTH nsl and socket
  955. dnl libs at the same time to link properly.
  956. if test "$HAVE_GETHOSTBYNAME" != "1"
  957. then
  958. AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
  959. my_ac_save_LIBS=$LIBS
  960. LIBS="-lnsl -lsocket $LIBS"
  961. AC_LINK_IFELSE([
  962. AC_LANG_PROGRAM([[
  963. ]],[[
  964. gethostbyname();
  965. ]])
  966. ],[
  967. AC_MSG_RESULT([yes])
  968. HAVE_GETHOSTBYNAME="1"
  969. ],[
  970. AC_MSG_RESULT([no])
  971. LIBS=$my_ac_save_LIBS
  972. ])
  973. fi
  974. if test "$HAVE_GETHOSTBYNAME" != "1"
  975. then
  976. dnl This is for winsock systems
  977. if test "$curl_cv_header_windows_h" = "yes"; then
  978. if test "$curl_cv_header_winsock2_h" = "yes"; then
  979. winsock_LIB="-lws2_32"
  980. fi
  981. if test ! -z "$winsock_LIB"; then
  982. my_ac_save_LIBS=$LIBS
  983. LIBS="$winsock_LIB $LIBS"
  984. AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
  985. AC_LINK_IFELSE([
  986. AC_LANG_PROGRAM([[
  987. #ifdef HAVE_WINDOWS_H
  988. #ifndef WIN32_LEAN_AND_MEAN
  989. #define WIN32_LEAN_AND_MEAN
  990. #endif
  991. #include <windows.h>
  992. #ifdef HAVE_WINSOCK2_H
  993. #include <winsock2.h>
  994. #endif
  995. #endif
  996. ]],[[
  997. gethostbyname("www.dummysite.com");
  998. ]])
  999. ],[
  1000. AC_MSG_RESULT([yes])
  1001. HAVE_GETHOSTBYNAME="1"
  1002. ],[
  1003. AC_MSG_RESULT([no])
  1004. winsock_LIB=""
  1005. LIBS=$my_ac_save_LIBS
  1006. ])
  1007. fi
  1008. fi
  1009. fi
  1010. if test "$HAVE_GETHOSTBYNAME" != "1"
  1011. then
  1012. dnl This is for Minix 3.1
  1013. AC_MSG_CHECKING([for gethostbyname for Minix 3])
  1014. AC_LINK_IFELSE([
  1015. AC_LANG_PROGRAM([[
  1016. /* Older Minix versions may need <net/gen/netdb.h> here instead */
  1017. #include <netdb.h>
  1018. ]],[[
  1019. gethostbyname("www.dummysite.com");
  1020. ]])
  1021. ],[
  1022. AC_MSG_RESULT([yes])
  1023. HAVE_GETHOSTBYNAME="1"
  1024. ],[
  1025. AC_MSG_RESULT([no])
  1026. ])
  1027. fi
  1028. if test "$HAVE_GETHOSTBYNAME" != "1"
  1029. then
  1030. dnl This is for eCos with a stubbed DNS implementation
  1031. AC_MSG_CHECKING([for gethostbyname for eCos])
  1032. AC_LINK_IFELSE([
  1033. AC_LANG_PROGRAM([[
  1034. #include <stdio.h>
  1035. #include <netdb.h>
  1036. ]],[[
  1037. gethostbyname("www.dummysite.com");
  1038. ]])
  1039. ],[
  1040. AC_MSG_RESULT([yes])
  1041. HAVE_GETHOSTBYNAME="1"
  1042. ],[
  1043. AC_MSG_RESULT([no])
  1044. ])
  1045. fi
  1046. if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set
  1047. then
  1048. dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet
  1049. AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library])
  1050. AC_LINK_IFELSE([
  1051. AC_LANG_PROGRAM([[
  1052. #define __USE_INLINE__
  1053. #include <proto/bsdsocket.h>
  1054. #ifdef __amigaos4__
  1055. struct SocketIFace *ISocket = NULL;
  1056. #else
  1057. struct Library *SocketBase = NULL;
  1058. #endif
  1059. ]],[[
  1060. gethostbyname("www.dummysite.com");
  1061. ]])
  1062. ],[
  1063. AC_MSG_RESULT([yes])
  1064. HAVE_GETHOSTBYNAME="1"
  1065. HAVE_PROTO_BSDSOCKET_H="1"
  1066. AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use])
  1067. AC_SUBST(HAVE_PROTO_BSDSOCKET_H, [1])
  1068. ],[
  1069. AC_MSG_RESULT([no])
  1070. ])
  1071. fi
  1072. if test "$HAVE_GETHOSTBYNAME" != "1"
  1073. then
  1074. dnl gethostbyname in the network lib - for Haiku OS
  1075. AC_CHECK_LIB(network, gethostbyname,
  1076. [HAVE_GETHOSTBYNAME="1"
  1077. LIBS="-lnetwork $LIBS"
  1078. ])
  1079. fi
  1080. if test "$HAVE_GETHOSTBYNAME" != "1"; then
  1081. AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
  1082. fi
  1083. CURL_CHECK_LIBS_CONNECT
  1084. CURL_NETWORK_LIBS=$LIBS
  1085. dnl **********************************************************************
  1086. dnl In case that function clock_gettime with monotonic timer is available,
  1087. dnl check for additional required libraries.
  1088. dnl **********************************************************************
  1089. CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
  1090. dnl **********************************************************************
  1091. dnl The preceding library checks are all potentially useful for test
  1092. dnl servers and libtest cases which require networking and clock_gettime
  1093. dnl support. Save the list of required libraries at this point for use
  1094. dnl while linking those test servers and programs.
  1095. dnl **********************************************************************
  1096. CURL_NETWORK_AND_TIME_LIBS=$LIBS
  1097. dnl **********************************************************************
  1098. dnl Check for the presence of ZLIB libraries and headers
  1099. dnl **********************************************************************
  1100. dnl Check for & handle argument to --with-zlib.
  1101. clean_CPPFLAGS=$CPPFLAGS
  1102. clean_LDFLAGS=$LDFLAGS
  1103. clean_LIBS=$LIBS
  1104. ZLIB_LIBS=""
  1105. AC_ARG_WITH(zlib,
  1106. AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
  1107. AS_HELP_STRING([--without-zlib],[disable use of zlib]),
  1108. [OPT_ZLIB="$withval"])
  1109. if test "$OPT_ZLIB" = "no" ; then
  1110. AC_MSG_WARN([zlib disabled])
  1111. else
  1112. if test "$OPT_ZLIB" = "yes" ; then
  1113. OPT_ZLIB=""
  1114. fi
  1115. if test -z "$OPT_ZLIB" ; then
  1116. CURL_CHECK_PKGCONFIG(zlib)
  1117. if test "$PKGCONFIG" != "no" ; then
  1118. LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS"
  1119. LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
  1120. CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`"
  1121. OPT_ZLIB=""
  1122. HAVE_LIBZ="1"
  1123. fi
  1124. if test -z "$HAVE_LIBZ"; then
  1125. dnl Check for the lib without setting any new path, since many
  1126. dnl people have it in the default path
  1127. AC_CHECK_LIB(z, inflateEnd,
  1128. dnl libz found, set the variable
  1129. [HAVE_LIBZ="1"
  1130. LIBS="-lz $LIBS"],
  1131. dnl if no lib found, try /usr/local
  1132. [OPT_ZLIB="/usr/local"])
  1133. fi
  1134. fi
  1135. dnl Add a nonempty path to the compiler flags
  1136. if test -n "$OPT_ZLIB"; then
  1137. CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
  1138. LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
  1139. fi
  1140. AC_CHECK_HEADER(zlib.h,
  1141. [
  1142. dnl zlib.h was found
  1143. HAVE_ZLIB_H="1"
  1144. dnl if the lib wasn't found already, try again with the new paths
  1145. if test "$HAVE_LIBZ" != "1"; then
  1146. AC_CHECK_LIB(z, gzread,
  1147. [
  1148. dnl the lib was found!
  1149. HAVE_LIBZ="1"
  1150. LIBS="-lz $LIBS"
  1151. ],
  1152. [ CPPFLAGS=$clean_CPPFLAGS
  1153. LDFLAGS=$clean_LDFLAGS])
  1154. fi
  1155. ],
  1156. [
  1157. dnl zlib.h was not found, restore the flags
  1158. CPPFLAGS=$clean_CPPFLAGS
  1159. LDFLAGS=$clean_LDFLAGS]
  1160. )
  1161. if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
  1162. then
  1163. AC_MSG_WARN([configure found only the libz lib, not the header file!])
  1164. HAVE_LIBZ=""
  1165. CPPFLAGS=$clean_CPPFLAGS
  1166. LDFLAGS=$clean_LDFLAGS
  1167. LIBS=$clean_LIBS
  1168. elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
  1169. then
  1170. AC_MSG_WARN([configure found only the libz header file, not the lib!])
  1171. CPPFLAGS=$clean_CPPFLAGS
  1172. LDFLAGS=$clean_LDFLAGS
  1173. LIBS=$clean_LIBS
  1174. elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
  1175. then
  1176. dnl both header and lib were found!
  1177. AC_SUBST(HAVE_LIBZ)
  1178. AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
  1179. AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
  1180. ZLIB_LIBS="-lz"
  1181. LIBS="-lz $clean_LIBS"
  1182. dnl replace 'HAVE_LIBZ' in the automake makefile.ams
  1183. AMFIXLIB="1"
  1184. AC_MSG_NOTICE([found both libz and libz.h header])
  1185. curl_zlib_msg="enabled"
  1186. fi
  1187. fi
  1188. dnl set variable for use in automakefile(s)
  1189. AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
  1190. AC_SUBST(ZLIB_LIBS)
  1191. dnl **********************************************************************
  1192. dnl Check for the presence of BROTLI decoder libraries and headers
  1193. dnl **********************************************************************
  1194. dnl Brotli project home page: https://github.com/google/brotli
  1195. dnl Default to compiler & linker defaults for BROTLI files & libraries.
  1196. OPT_BROTLI=off
  1197. AC_ARG_WITH(brotli,dnl
  1198. AS_HELP_STRING([--with-brotli=PATH],[Where to look for brotli, PATH points to the BROTLI installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  1199. AS_HELP_STRING([--without-brotli], [disable BROTLI]),
  1200. OPT_BROTLI=$withval)
  1201. if test X"$OPT_BROTLI" != Xno; then
  1202. dnl backup the pre-brotli variables
  1203. CLEANLDFLAGS="$LDFLAGS"
  1204. CLEANCPPFLAGS="$CPPFLAGS"
  1205. CLEANLIBS="$LIBS"
  1206. case "$OPT_BROTLI" in
  1207. yes)
  1208. dnl --with-brotli (without path) used
  1209. CURL_CHECK_PKGCONFIG(libbrotlidec)
  1210. if test "$PKGCONFIG" != "no" ; then
  1211. LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
  1212. LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
  1213. CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
  1214. version=`$PKGCONFIG --modversion libbrotlidec`
  1215. DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`
  1216. fi
  1217. ;;
  1218. off)
  1219. dnl no --with-brotli option given, just check default places
  1220. ;;
  1221. *)
  1222. dnl use the given --with-brotli spot
  1223. PREFIX_BROTLI=$OPT_BROTLI
  1224. ;;
  1225. esac
  1226. dnl if given with a prefix, we set -L and -I based on that
  1227. if test -n "$PREFIX_BROTLI"; then
  1228. LIB_BROTLI="-lbrotlidec"
  1229. LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
  1230. CPP_BROTLI=-I${PREFIX_BROTLI}/include
  1231. DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
  1232. fi
  1233. LDFLAGS="$LDFLAGS $LD_BROTLI"
  1234. CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
  1235. LIBS="$LIB_BROTLI $LIBS"
  1236. AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
  1237. AC_CHECK_HEADERS(brotli/decode.h,
  1238. curl_brotli_msg="enabled (libbrotlidec)"
  1239. HAVE_BROTLI=1
  1240. AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
  1241. AC_SUBST(HAVE_BROTLI, [1])
  1242. )
  1243. if test X"$OPT_BROTLI" != Xoff &&
  1244. test "$HAVE_BROTLI" != "1"; then
  1245. AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
  1246. fi
  1247. if test "$HAVE_BROTLI" = "1"; then
  1248. if test -n "$DIR_BROTLI"; then
  1249. dnl when the brotli shared libs were found in a path that the run-time
  1250. dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
  1251. dnl to prevent further configure tests to fail due to this
  1252. if test "x$cross_compiling" != "xyes"; then
  1253. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
  1254. export CURL_LIBRARY_PATH
  1255. AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
  1256. fi
  1257. fi
  1258. else
  1259. dnl no brotli, revert back to clean variables
  1260. LDFLAGS=$CLEANLDFLAGS
  1261. CPPFLAGS=$CLEANCPPFLAGS
  1262. LIBS=$CLEANLIBS
  1263. fi
  1264. fi
  1265. dnl **********************************************************************
  1266. dnl Check for libzstd
  1267. dnl **********************************************************************
  1268. dnl Default to compiler & linker defaults for libzstd
  1269. OPT_ZSTD=off
  1270. AC_ARG_WITH(zstd,dnl
  1271. AS_HELP_STRING([--with-zstd=PATH],[Where to look for libzstd, PATH points to the libzstd installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  1272. AS_HELP_STRING([--without-zstd], [disable libzstd]),
  1273. OPT_ZSTD=$withval)
  1274. if test X"$OPT_ZSTD" != Xno; then
  1275. dnl backup the pre-zstd variables
  1276. CLEANLDFLAGS="$LDFLAGS"
  1277. CLEANCPPFLAGS="$CPPFLAGS"
  1278. CLEANLIBS="$LIBS"
  1279. case "$OPT_ZSTD" in
  1280. yes)
  1281. dnl --with-zstd (without path) used
  1282. CURL_CHECK_PKGCONFIG(libzstd)
  1283. if test "$PKGCONFIG" != "no" ; then
  1284. LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd`
  1285. LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd`
  1286. CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd`
  1287. version=`$PKGCONFIG --modversion libzstd`
  1288. DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'`
  1289. fi
  1290. ;;
  1291. off)
  1292. dnl no --with-zstd option given, just check default places
  1293. ;;
  1294. *)
  1295. dnl use the given --with-zstd spot
  1296. PREFIX_ZSTD=$OPT_ZSTD
  1297. ;;
  1298. esac
  1299. dnl if given with a prefix, we set -L and -I based on that
  1300. if test -n "$PREFIX_ZSTD"; then
  1301. LIB_ZSTD="-lzstd"
  1302. LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff
  1303. CPP_ZSTD=-I${PREFIX_ZSTD}/include
  1304. DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff
  1305. fi
  1306. LDFLAGS="$LDFLAGS $LD_ZSTD"
  1307. CPPFLAGS="$CPPFLAGS $CPP_ZSTD"
  1308. LIBS="$LIB_ZSTD $LIBS"
  1309. AC_CHECK_LIB(zstd, ZSTD_createDStream)
  1310. AC_CHECK_HEADERS(zstd.h,
  1311. curl_zstd_msg="enabled (libzstd)"
  1312. HAVE_ZSTD=1
  1313. AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use])
  1314. AC_SUBST(HAVE_ZSTD, [1])
  1315. )
  1316. if test X"$OPT_ZSTD" != Xoff &&
  1317. test "$HAVE_ZSTD" != "1"; then
  1318. AC_MSG_ERROR([libzstd was not found where specified!])
  1319. fi
  1320. if test "$HAVE_ZSTD" = "1"; then
  1321. if test -n "$DIR_ZSTD"; then
  1322. dnl when the zstd shared lib were found in a path that the run-time
  1323. dnl linker doesn't search through, we need to add it to
  1324. dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
  1325. dnl this
  1326. if test "x$cross_compiling" != "xyes"; then
  1327. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD"
  1328. export CURL_LIBRARY_PATH
  1329. AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH])
  1330. fi
  1331. fi
  1332. else
  1333. dnl no zstd, revert back to clean variables
  1334. LDFLAGS=$CLEANLDFLAGS
  1335. CPPFLAGS=$CLEANCPPFLAGS
  1336. LIBS=$CLEANLIBS
  1337. fi
  1338. fi
  1339. dnl **********************************************************************
  1340. dnl Check for LDAP
  1341. dnl **********************************************************************
  1342. LDAPLIBNAME=""
  1343. AC_ARG_WITH(ldap-lib,
  1344. AS_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
  1345. [LDAPLIBNAME="$withval"])
  1346. LBERLIBNAME=""
  1347. AC_ARG_WITH(lber-lib,
  1348. AS_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
  1349. [LBERLIBNAME="$withval"])
  1350. if test x$CURL_DISABLE_LDAP != x1 ; then
  1351. CURL_CHECK_HEADER_LBER
  1352. CURL_CHECK_HEADER_LDAP
  1353. CURL_CHECK_HEADER_LDAP_SSL
  1354. if test -z "$LDAPLIBNAME" ; then
  1355. if test "$curl_cv_native_windows" = "yes"; then
  1356. dnl Windows uses a single and unique LDAP library name
  1357. LDAPLIBNAME="wldap32"
  1358. LBERLIBNAME="no"
  1359. fi
  1360. fi
  1361. if test "$LDAPLIBNAME" ; then
  1362. AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
  1363. if test -n "$ldap_askedfor"; then
  1364. AC_MSG_ERROR([couldn't detect the LDAP libraries])
  1365. fi
  1366. AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
  1367. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  1368. AC_SUBST(CURL_DISABLE_LDAP, [1])
  1369. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  1370. AC_SUBST(CURL_DISABLE_LDAPS, [1])])
  1371. else
  1372. dnl Try to find the right ldap libraries for this system
  1373. CURL_CHECK_LIBS_LDAP
  1374. case X-"$curl_cv_ldap_LIBS" in
  1375. X-unknown)
  1376. if test -n "$ldap_askedfor"; then
  1377. AC_MSG_ERROR([couldn't detect the LDAP libraries])
  1378. fi
  1379. AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
  1380. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  1381. AC_SUBST(CURL_DISABLE_LDAP, [1])
  1382. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  1383. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  1384. ;;
  1385. esac
  1386. fi
  1387. fi
  1388. if test x$CURL_DISABLE_LDAP != x1 ; then
  1389. if test "$LBERLIBNAME" ; then
  1390. dnl If name is "no" then don't define this library at all
  1391. dnl (it's only needed if libldap.so's dependencies are broken).
  1392. if test "$LBERLIBNAME" != "no" ; then
  1393. AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
  1394. AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
  1395. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  1396. AC_SUBST(CURL_DISABLE_LDAP, [1])
  1397. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  1398. AC_SUBST(CURL_DISABLE_LDAPS, [1])])
  1399. fi
  1400. fi
  1401. fi
  1402. if test x$CURL_DISABLE_LDAP != x1 ; then
  1403. AC_CHECK_FUNCS([ldap_url_parse])
  1404. if test "$LDAPLIBNAME" = "wldap32"; then
  1405. curl_ldap_msg="enabled (winldap)"
  1406. AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
  1407. else
  1408. curl_ldap_msg="enabled (OpenLDAP)"
  1409. if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
  1410. AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
  1411. AC_SUBST(USE_OPENLDAP, [1])
  1412. fi
  1413. fi
  1414. fi
  1415. if test x$CURL_DISABLE_LDAPS != x1 ; then
  1416. curl_ldaps_msg="enabled"
  1417. fi
  1418. dnl **********************************************************************
  1419. dnl Checks for IPv6
  1420. dnl **********************************************************************
  1421. AC_MSG_CHECKING([whether to enable IPv6])
  1422. AC_ARG_ENABLE(ipv6,
  1423. AS_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
  1424. AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
  1425. [ case "$enableval" in
  1426. no)
  1427. AC_MSG_RESULT(no)
  1428. ipv6=no
  1429. ;;
  1430. *) AC_MSG_RESULT(yes)
  1431. ipv6=yes
  1432. ;;
  1433. esac ],
  1434. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  1435. /* are AF_INET6 and sockaddr_in6 available? */
  1436. #include <sys/types.h>
  1437. #ifdef HAVE_WINSOCK2_H
  1438. #include <winsock2.h>
  1439. #include <ws2tcpip.h>
  1440. #else
  1441. #include <sys/socket.h>
  1442. #include <netinet/in.h>
  1443. #if defined (__TANDEM)
  1444. # include <netinet/in6.h>
  1445. #endif
  1446. #endif
  1447. #include <stdlib.h> /* for exit() */
  1448. main()
  1449. {
  1450. struct sockaddr_in6 s;
  1451. (void)s;
  1452. if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
  1453. exit(1);
  1454. else
  1455. exit(0);
  1456. }
  1457. ]])
  1458. ],
  1459. AC_MSG_RESULT(yes)
  1460. ipv6=yes,
  1461. AC_MSG_RESULT(no)
  1462. ipv6=no,
  1463. AC_MSG_RESULT(yes)
  1464. ipv6=yes
  1465. ))
  1466. if test "$ipv6" = yes; then
  1467. curl_ipv6_msg="enabled"
  1468. AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
  1469. IPV6_ENABLED=1
  1470. AC_SUBST(IPV6_ENABLED)
  1471. AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
  1472. AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
  1473. #include <sys/types.h>
  1474. #ifdef HAVE_WINSOCK2_H
  1475. #include <winsock2.h>
  1476. #include <ws2tcpip.h>
  1477. #else
  1478. #include <netinet/in.h>
  1479. #if defined (__TANDEM)
  1480. # include <netinet/in6.h>
  1481. #endif
  1482. #endif
  1483. ]], [[
  1484. struct sockaddr_in6 s;
  1485. s.sin6_scope_id = 0;
  1486. ]])], [
  1487. AC_MSG_RESULT([yes])
  1488. AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
  1489. ], [
  1490. AC_MSG_RESULT([no])
  1491. ])
  1492. fi
  1493. dnl **********************************************************************
  1494. dnl Check if the operating system allows programs to write to their own argv[]
  1495. dnl **********************************************************************
  1496. AC_MSG_CHECKING([if argv can be written to])
  1497. CURL_RUN_IFELSE([[
  1498. int main(int argc, char **argv)
  1499. {
  1500. (void)argc;
  1501. argv[0][0] = ' ';
  1502. return (argv[0][0] == ' ')?0:1;
  1503. }
  1504. ]],[
  1505. curl_cv_writable_argv=yes
  1506. ],[
  1507. curl_cv_writable_argv=no
  1508. ],[
  1509. curl_cv_writable_argv=cross
  1510. ])
  1511. case $curl_cv_writable_argv in
  1512. yes)
  1513. AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
  1514. AC_MSG_RESULT(yes)
  1515. ;;
  1516. no)
  1517. AC_MSG_RESULT(no)
  1518. ;;
  1519. *)
  1520. AC_MSG_RESULT(no)
  1521. AC_MSG_WARN([the previous check could not be made default was used])
  1522. ;;
  1523. esac
  1524. dnl **********************************************************************
  1525. dnl Check for GSS-API libraries
  1526. dnl **********************************************************************
  1527. dnl check for GSS-API stuff in the /usr as default
  1528. GSSAPI_ROOT="/usr"
  1529. AC_ARG_WITH(gssapi-includes,
  1530. AS_HELP_STRING([--with-gssapi-includes=DIR],
  1531. [Specify location of GSS-API headers]),
  1532. [ GSSAPI_INCS="-I$withval"
  1533. want_gss="yes" ]
  1534. )
  1535. AC_ARG_WITH(gssapi-libs,
  1536. AS_HELP_STRING([--with-gssapi-libs=DIR],
  1537. [Specify location of GSS-API libs]),
  1538. [ GSSAPI_LIB_DIR="-L$withval"
  1539. want_gss="yes" ]
  1540. )
  1541. AC_ARG_WITH(gssapi,
  1542. AS_HELP_STRING([--with-gssapi=DIR],
  1543. [Where to look for GSS-API]), [
  1544. GSSAPI_ROOT="$withval"
  1545. if test x"$GSSAPI_ROOT" != xno; then
  1546. want_gss="yes"
  1547. if test x"$GSSAPI_ROOT" = xyes; then
  1548. dnl if yes, then use default root
  1549. GSSAPI_ROOT="/usr"
  1550. fi
  1551. fi
  1552. ])
  1553. : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
  1554. save_CPPFLAGS="$CPPFLAGS"
  1555. AC_MSG_CHECKING([if GSS-API support is requested])
  1556. if test x"$want_gss" = xyes; then
  1557. AC_MSG_RESULT(yes)
  1558. if test $GSSAPI_ROOT != "/usr"; then
  1559. CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
  1560. else
  1561. CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
  1562. fi
  1563. if test -z "$GSSAPI_INCS"; then
  1564. if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
  1565. GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
  1566. elif test "$PKGCONFIG" != "no" ; then
  1567. GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi`
  1568. elif test -f "$KRB5CONFIG"; then
  1569. GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
  1570. elif test "$GSSAPI_ROOT" != "yes"; then
  1571. GSSAPI_INCS="-I$GSSAPI_ROOT/include"
  1572. fi
  1573. fi
  1574. CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
  1575. AC_CHECK_HEADER(gss.h,
  1576. [
  1577. dnl found in the given dirs
  1578. AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
  1579. gnu_gss=yes
  1580. ],
  1581. [
  1582. dnl not found, check Heimdal or MIT
  1583. AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
  1584. AC_CHECK_HEADERS(
  1585. [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
  1586. [],
  1587. [not_mit=1],
  1588. [
  1589. AC_INCLUDES_DEFAULT
  1590. #ifdef HAVE_GSSAPI_GSSAPI_H
  1591. #include <gssapi/gssapi.h>
  1592. #endif
  1593. ])
  1594. if test "x$not_mit" = "x1"; then
  1595. dnl MIT not found, check for Heimdal
  1596. AC_CHECK_HEADER(gssapi.h,
  1597. [
  1598. dnl found
  1599. AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
  1600. ],
  1601. [
  1602. dnl no header found, disabling GSS
  1603. want_gss=no
  1604. AC_MSG_WARN(disabling GSS-API support since no header files were found)
  1605. ]
  1606. )
  1607. else
  1608. dnl MIT found
  1609. AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
  1610. dnl check if we have a really old MIT Kerberos version (<= 1.2)
  1611. AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
  1612. AC_COMPILE_IFELSE([
  1613. AC_LANG_PROGRAM([[
  1614. #include <gssapi/gssapi.h>
  1615. #include <gssapi/gssapi_generic.h>
  1616. #include <gssapi/gssapi_krb5.h>
  1617. ]],[[
  1618. gss_import_name(
  1619. (OM_uint32 *)0,
  1620. (gss_buffer_t)0,
  1621. GSS_C_NT_HOSTBASED_SERVICE,
  1622. (gss_name_t *)0);
  1623. ]])
  1624. ],[
  1625. AC_MSG_RESULT([yes])
  1626. ],[
  1627. AC_MSG_RESULT([no])
  1628. AC_DEFINE(HAVE_OLD_GSSMIT, 1,
  1629. [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
  1630. ])
  1631. fi
  1632. ]
  1633. )
  1634. else
  1635. AC_MSG_RESULT(no)
  1636. fi
  1637. if test x"$want_gss" = xyes; then
  1638. AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
  1639. HAVE_GSSAPI=1
  1640. curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
  1641. if test -n "$gnu_gss"; then
  1642. curl_gss_msg="enabled (GNU GSS)"
  1643. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1644. LIBS="-lgss $LIBS"
  1645. elif test -z "$GSSAPI_LIB_DIR"; then
  1646. case $host in
  1647. *-*-darwin*)
  1648. LIBS="-lgssapi_krb5 -lresolv $LIBS"
  1649. ;;
  1650. *)
  1651. if test $GSSAPI_ROOT != "/usr"; then
  1652. CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
  1653. else
  1654. CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
  1655. fi
  1656. if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
  1657. dnl krb5-config doesn't have --libs-only-L or similar, put everything
  1658. dnl into LIBS
  1659. gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
  1660. LIBS="$gss_libs $LIBS"
  1661. elif test "$PKGCONFIG" != "no" ; then
  1662. gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
  1663. LIBS="$gss_libs $LIBS"
  1664. elif test -f "$KRB5CONFIG"; then
  1665. dnl krb5-config doesn't have --libs-only-L or similar, put everything
  1666. dnl into LIBS
  1667. gss_libs=`$KRB5CONFIG --libs gssapi`
  1668. LIBS="$gss_libs $LIBS"
  1669. else
  1670. case $host in
  1671. *-hp-hpux*)
  1672. gss_libname="gss"
  1673. ;;
  1674. *)
  1675. gss_libname="gssapi"
  1676. ;;
  1677. esac
  1678. if test "$GSSAPI_ROOT" != "yes"; then
  1679. LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
  1680. LIBS="-l$gss_libname $LIBS"
  1681. else
  1682. LIBS="-l$gss_libname $LIBS"
  1683. fi
  1684. fi
  1685. ;;
  1686. esac
  1687. else
  1688. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1689. case $host in
  1690. *-hp-hpux*)
  1691. LIBS="-lgss $LIBS"
  1692. ;;
  1693. *)
  1694. LIBS="-lgssapi $LIBS"
  1695. ;;
  1696. esac
  1697. fi
  1698. else
  1699. CPPFLAGS="$save_CPPFLAGS"
  1700. fi
  1701. if test x"$want_gss" = xyes; then
  1702. AC_MSG_CHECKING([if we can link against GSS-API library])
  1703. AC_LINK_IFELSE([
  1704. AC_LANG_FUNC_LINK_TRY([gss_init_sec_context])
  1705. ],[
  1706. AC_MSG_RESULT([yes])
  1707. ],[
  1708. AC_MSG_RESULT([no])
  1709. AC_MSG_ERROR([--with-gssapi was specified, but a GSS-API library was not found.])
  1710. ])
  1711. fi
  1712. build_libstubgss=no
  1713. if test x"$want_gss" = "xyes"; then
  1714. build_libstubgss=yes
  1715. fi
  1716. AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
  1717. dnl -------------------------------------------------------------
  1718. dnl parse --with-default-ssl-backend so it can be validated below
  1719. dnl -------------------------------------------------------------
  1720. DEFAULT_SSL_BACKEND=no
  1721. VALID_DEFAULT_SSL_BACKEND=
  1722. AC_ARG_WITH(default-ssl-backend,
  1723. AS_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
  1724. AS_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
  1725. [DEFAULT_SSL_BACKEND=$withval])
  1726. case "$DEFAULT_SSL_BACKEND" in
  1727. no)
  1728. dnl --without-default-ssl-backend option used
  1729. ;;
  1730. default|yes)
  1731. dnl --with-default-ssl-backend option used without name
  1732. AC_MSG_ERROR([The name of the default SSL backend is required.])
  1733. ;;
  1734. *)
  1735. dnl --with-default-ssl-backend option used with name
  1736. AC_SUBST(DEFAULT_SSL_BACKEND)
  1737. dnl needs to be validated below
  1738. VALID_DEFAULT_SSL_BACKEND=no
  1739. ;;
  1740. esac
  1741. CURL_WITH_SCHANNEL
  1742. CURL_WITH_SECURETRANSPORT
  1743. CURL_WITH_AMISSL
  1744. CURL_WITH_OPENSSL
  1745. CURL_WITH_GNUTLS
  1746. CURL_WITH_MBEDTLS
  1747. CURL_WITH_WOLFSSL
  1748. CURL_WITH_BEARSSL
  1749. CURL_WITH_RUSTLS
  1750. CURL_WITH_NSS
  1751. dnl link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL
  1752. if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$USE_SCHANNEL" = "x1"; then
  1753. LIBS="-ladvapi32 -lcrypt32 $LIBS"
  1754. fi
  1755. dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer)
  1756. if test "x$curl_cv_native_windows" = "xyes" &&
  1757. test "x$curl_mingw_original" = "xno"; then
  1758. LIBS="-lbcrypt $LIBS"
  1759. fi
  1760. case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$BEARSSL_ENABLED$RUSTLS_ENABLED$SSL_DISABLED"
  1761. in
  1762. x)
  1763. AC_MSG_ERROR([TLS not detected, you will not be able to use HTTPS, FTPS, NTLM and more.
  1764. Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-nss, --with-schannel, --with-secure-transport, --with-amissl, --with-bearssl or --with-rustls to address this.])
  1765. ;;
  1766. x1)
  1767. # one SSL backend is enabled
  1768. AC_SUBST(SSL_ENABLED)
  1769. SSL_ENABLED="1"
  1770. AC_MSG_NOTICE([built with one SSL backend])
  1771. ;;
  1772. xD)
  1773. # explicitly built without TLS
  1774. ;;
  1775. *)
  1776. # more than one SSL backend is enabled
  1777. AC_SUBST(SSL_ENABLED)
  1778. SSL_ENABLED="1"
  1779. AC_SUBST(CURL_WITH_MULTI_SSL)
  1780. CURL_WITH_MULTI_SSL="1"
  1781. AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
  1782. AC_MSG_NOTICE([built with multiple SSL backends])
  1783. ;;
  1784. esac
  1785. if test -n "$ssl_backends"; then
  1786. curl_ssl_msg="enabled ($ssl_backends)"
  1787. fi
  1788. if test no = "$VALID_DEFAULT_SSL_BACKEND"
  1789. then
  1790. if test -n "$SSL_ENABLED"
  1791. then
  1792. AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
  1793. else
  1794. AC_MSG_ERROR([Default SSL backend requires SSL!])
  1795. fi
  1796. elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
  1797. then
  1798. AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
  1799. fi
  1800. dnl **********************************************************************
  1801. dnl Check for the CA bundle
  1802. dnl **********************************************************************
  1803. if test -n "$check_for_ca_bundle"; then
  1804. CURL_CHECK_CA_BUNDLE
  1805. fi
  1806. dnl **********************************************************************
  1807. dnl Check for libpsl
  1808. dnl **********************************************************************
  1809. AC_ARG_WITH(libpsl,
  1810. AS_HELP_STRING([--without-libpsl],
  1811. [disable support for libpsl cookie checking]),
  1812. with_libpsl=$withval,
  1813. with_libpsl=yes)
  1814. if test $with_libpsl != "no"; then
  1815. AC_SEARCH_LIBS(psl_builtin, psl,
  1816. [curl_psl_msg="enabled";
  1817. AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
  1818. ],
  1819. [curl_psl_msg="no (libpsl not found)";
  1820. AC_MSG_WARN([libpsl was not found])
  1821. ]
  1822. )
  1823. fi
  1824. AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
  1825. dnl **********************************************************************
  1826. dnl Check for libgsasl
  1827. dnl **********************************************************************
  1828. AC_ARG_WITH(libgsasl,
  1829. AS_HELP_STRING([--without-libgsasl],
  1830. [disable libgsasl support for SCRAM]),
  1831. with_libgsasl=$withval,
  1832. with_libgsasl=yes)
  1833. if test $with_libgsasl != "no"; then
  1834. AC_SEARCH_LIBS(gsasl_init, gsasl,
  1835. [curl_gsasl_msg="enabled";
  1836. AC_DEFINE([USE_GSASL], [1], [GSASL support enabled])
  1837. ],
  1838. [curl_gsasl_msg="no (libgsasl not found)";
  1839. AC_MSG_WARN([libgsasl was not found])
  1840. ]
  1841. )
  1842. fi
  1843. AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"])
  1844. AC_ARG_WITH(libmetalink,,
  1845. AC_MSG_ERROR([--with-libmetalink no longer works!]))
  1846. dnl **********************************************************************
  1847. dnl Check for the presence of LIBSSH2 libraries and headers
  1848. dnl **********************************************************************
  1849. dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
  1850. OPT_LIBSSH2=off
  1851. AC_ARG_WITH(libssh2,dnl
  1852. AS_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the libssh2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  1853. AS_HELP_STRING([--with-libssh2], [enable libssh2]),
  1854. OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
  1855. OPT_LIBSSH=off
  1856. AC_ARG_WITH(libssh,dnl
  1857. AS_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the libssh installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  1858. AS_HELP_STRING([--with-libssh], [enable libssh]),
  1859. OPT_LIBSSH=$withval, OPT_LIBSSH=no)
  1860. OPT_WOLFSSH=off
  1861. AC_ARG_WITH(wolfssh,dnl
  1862. AS_HELP_STRING([--with-wolfssh=PATH],[Where to look for wolfssh, PATH points to the wolfSSH installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  1863. AS_HELP_STRING([--with-wolfssh], [enable wolfssh]),
  1864. OPT_WOLFSSH=$withval, OPT_WOLFSSH=no)
  1865. if test X"$OPT_LIBSSH2" != Xno; then
  1866. dnl backup the pre-libssh2 variables
  1867. CLEANLDFLAGS="$LDFLAGS"
  1868. CLEANCPPFLAGS="$CPPFLAGS"
  1869. CLEANLIBS="$LIBS"
  1870. case "$OPT_LIBSSH2" in
  1871. yes)
  1872. dnl --with-libssh2 (without path) used
  1873. CURL_CHECK_PKGCONFIG(libssh2)
  1874. if test "$PKGCONFIG" != "no" ; then
  1875. LIB_SSH2=`$PKGCONFIG --libs libssh2`
  1876. LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
  1877. CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
  1878. version=`$PKGCONFIG --modversion libssh2`
  1879. DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'`
  1880. fi
  1881. ;;
  1882. off)
  1883. dnl no --with-libssh2 option given, just check default places
  1884. ;;
  1885. *)
  1886. dnl use the given --with-libssh2 spot
  1887. PREFIX_SSH2=$OPT_LIBSSH2
  1888. ;;
  1889. esac
  1890. dnl if given with a prefix, we set -L and -I based on that
  1891. if test -n "$PREFIX_SSH2"; then
  1892. LIB_SSH2="-lssh2"
  1893. LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
  1894. CPP_SSH2=-I${PREFIX_SSH2}/include
  1895. DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
  1896. fi
  1897. LDFLAGS="$LDFLAGS $LD_SSH2"
  1898. CPPFLAGS="$CPPFLAGS $CPP_SSH2"
  1899. LIBS="$LIB_SSH2 $LIBS"
  1900. dnl check for function added in libssh2 version 1.0
  1901. AC_CHECK_LIB(ssh2, libssh2_session_block_directions)
  1902. AC_CHECK_HEADERS(libssh2.h,
  1903. curl_ssh_msg="enabled (libSSH2)"
  1904. LIBSSH2_ENABLED=1
  1905. AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
  1906. AC_SUBST(USE_LIBSSH2, [1])
  1907. )
  1908. if test X"$OPT_LIBSSH2" != Xoff &&
  1909. test "$LIBSSH2_ENABLED" != "1"; then
  1910. AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
  1911. fi
  1912. if test "$LIBSSH2_ENABLED" = "1"; then
  1913. if test -n "$DIR_SSH2"; then
  1914. dnl when the libssh2 shared libs were found in a path that the run-time
  1915. dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
  1916. dnl to prevent further configure tests to fail due to this
  1917. if test "x$cross_compiling" != "xyes"; then
  1918. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
  1919. export CURL_LIBRARY_PATH
  1920. AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
  1921. fi
  1922. fi
  1923. else
  1924. dnl no libssh2, revert back to clean variables
  1925. LDFLAGS=$CLEANLDFLAGS
  1926. CPPFLAGS=$CLEANCPPFLAGS
  1927. LIBS=$CLEANLIBS
  1928. fi
  1929. elif test X"$OPT_LIBSSH" != Xno; then
  1930. dnl backup the pre-libssh variables
  1931. CLEANLDFLAGS="$LDFLAGS"
  1932. CLEANCPPFLAGS="$CPPFLAGS"
  1933. CLEANLIBS="$LIBS"
  1934. case "$OPT_LIBSSH" in
  1935. yes)
  1936. dnl --with-libssh (without path) used
  1937. CURL_CHECK_PKGCONFIG(libssh)
  1938. if test "$PKGCONFIG" != "no" ; then
  1939. LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
  1940. LD_SSH=`$PKGCONFIG --libs-only-L libssh`
  1941. CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
  1942. version=`$PKGCONFIG --modversion libssh`
  1943. DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'`
  1944. fi
  1945. ;;
  1946. off)
  1947. dnl no --with-libssh option given, just check default places
  1948. ;;
  1949. *)
  1950. dnl use the given --with-libssh spot
  1951. PREFIX_SSH=$OPT_LIBSSH
  1952. ;;
  1953. esac
  1954. dnl if given with a prefix, we set -L and -I based on that
  1955. if test -n "$PREFIX_SSH"; then
  1956. LIB_SSH="-lssh"
  1957. LD_SSH=-L${PREFIX_SSH}/lib$libsuff
  1958. CPP_SSH=-I${PREFIX_SSH}/include
  1959. DIR_SSH=${PREFIX_SSH}/lib$libsuff
  1960. fi
  1961. LDFLAGS="$LDFLAGS $LD_SSH"
  1962. CPPFLAGS="$CPPFLAGS $CPP_SSH"
  1963. LIBS="$LIB_SSH $LIBS"
  1964. AC_CHECK_LIB(ssh, ssh_new)
  1965. AC_CHECK_HEADERS(libssh/libssh.h,
  1966. curl_ssh_msg="enabled (libSSH)"
  1967. LIBSSH_ENABLED=1
  1968. AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
  1969. AC_SUBST(USE_LIBSSH, [1])
  1970. )
  1971. if test X"$OPT_LIBSSH" != Xoff &&
  1972. test "$LIBSSH_ENABLED" != "1"; then
  1973. AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
  1974. fi
  1975. if test "$LIBSSH_ENABLED" = "1"; then
  1976. if test -n "$DIR_SSH"; then
  1977. dnl when the libssh shared libs were found in a path that the run-time
  1978. dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
  1979. dnl to prevent further configure tests to fail due to this
  1980. if test "x$cross_compiling" != "xyes"; then
  1981. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
  1982. export CURL_LIBRARY_PATH
  1983. AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
  1984. fi
  1985. fi
  1986. else
  1987. dnl no libssh, revert back to clean variables
  1988. LDFLAGS=$CLEANLDFLAGS
  1989. CPPFLAGS=$CLEANCPPFLAGS
  1990. LIBS=$CLEANLIBS
  1991. fi
  1992. elif test X"$OPT_WOLFSSH" != Xno; then
  1993. dnl backup the pre-wolfssh variables
  1994. CLEANLDFLAGS="$LDFLAGS"
  1995. CLEANCPPFLAGS="$CPPFLAGS"
  1996. CLEANLIBS="$LIBS"
  1997. if test "$OPT_WOLFSSH" != yes; then
  1998. WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config"
  1999. LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`"
  2000. CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`"
  2001. fi
  2002. AC_CHECK_LIB(wolfssh, wolfSSH_Init)
  2003. AC_CHECK_HEADERS(wolfssh/ssh.h,
  2004. curl_ssh_msg="enabled (wolfSSH)"
  2005. WOLFSSH_ENABLED=1
  2006. AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use])
  2007. AC_SUBST(USE_WOLFSSH, [1])
  2008. )
  2009. fi
  2010. dnl **********************************************************************
  2011. dnl Check for the presence of LIBRTMP libraries and headers
  2012. dnl **********************************************************************
  2013. dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
  2014. OPT_LIBRTMP=off
  2015. AC_ARG_WITH(librtmp,dnl
  2016. AS_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  2017. AS_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
  2018. OPT_LIBRTMP=$withval)
  2019. if test X"$OPT_LIBRTMP" != Xno; then
  2020. dnl backup the pre-librtmp variables
  2021. CLEANLDFLAGS="$LDFLAGS"
  2022. CLEANCPPFLAGS="$CPPFLAGS"
  2023. CLEANLIBS="$LIBS"
  2024. case "$OPT_LIBRTMP" in
  2025. yes)
  2026. dnl --with-librtmp (without path) used
  2027. CURL_CHECK_PKGCONFIG(librtmp)
  2028. if test "$PKGCONFIG" != "no" ; then
  2029. LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
  2030. LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
  2031. CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
  2032. version=`$PKGCONFIG --modversion librtmp`
  2033. DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'`
  2034. else
  2035. dnl To avoid link errors, we do not allow --librtmp without
  2036. dnl a pkgconfig file
  2037. AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
  2038. fi
  2039. ;;
  2040. off)
  2041. dnl no --with-librtmp option given, just check default places
  2042. LIB_RTMP="-lrtmp"
  2043. ;;
  2044. *)
  2045. dnl use the given --with-librtmp spot
  2046. LIB_RTMP="-lrtmp"
  2047. PREFIX_RTMP=$OPT_LIBRTMP
  2048. ;;
  2049. esac
  2050. dnl if given with a prefix, we set -L and -I based on that
  2051. if test -n "$PREFIX_RTMP"; then
  2052. LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
  2053. CPP_RTMP=-I${PREFIX_RTMP}/include
  2054. DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
  2055. fi
  2056. LDFLAGS="$LDFLAGS $LD_RTMP"
  2057. CPPFLAGS="$CPPFLAGS $CPP_RTMP"
  2058. LIBS="$LIB_RTMP $LIBS"
  2059. AC_CHECK_LIB(rtmp, RTMP_Init,
  2060. [
  2061. AC_CHECK_HEADERS(librtmp/rtmp.h,
  2062. curl_rtmp_msg="enabled (librtmp)"
  2063. LIBRTMP_ENABLED=1
  2064. AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
  2065. AC_SUBST(USE_LIBRTMP, [1])
  2066. )
  2067. ],
  2068. dnl not found, revert back to clean variables
  2069. LDFLAGS=$CLEANLDFLAGS
  2070. CPPFLAGS=$CLEANCPPFLAGS
  2071. LIBS=$CLEANLIBS
  2072. )
  2073. if test X"$OPT_LIBRTMP" != Xoff &&
  2074. test "$LIBRTMP_ENABLED" != "1"; then
  2075. AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
  2076. fi
  2077. fi
  2078. dnl **********************************************************************
  2079. dnl Check for linker switch for versioned symbols
  2080. dnl **********************************************************************
  2081. versioned_symbols_flavour=
  2082. AC_MSG_CHECKING([whether versioned symbols are wanted])
  2083. AC_ARG_ENABLE(versioned-symbols,
  2084. AS_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
  2085. AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
  2086. [ case "$enableval" in
  2087. yes) AC_MSG_RESULT(yes)
  2088. AC_MSG_CHECKING([if libraries can be versioned])
  2089. GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
  2090. if test -z "$GLD"; then
  2091. AC_MSG_RESULT(no)
  2092. AC_MSG_WARN([You need an ld version supporting the --version-script option])
  2093. else
  2094. AC_MSG_RESULT(yes)
  2095. if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
  2096. versioned_symbols_flavour="MULTISSL_"
  2097. elif test "x$OPENSSL_ENABLED" = "x1"; then
  2098. versioned_symbols_flavour="OPENSSL_"
  2099. elif test "x$GNUTLS_ENABLED" = "x1"; then
  2100. versioned_symbols_flavour="GNUTLS_"
  2101. elif test "x$NSS_ENABLED" = "x1"; then
  2102. versioned_symbols_flavour="NSS_"
  2103. elif test "x$WOLFSSL_ENABLED" = "x1"; then
  2104. versioned_symbols_flavour="WOLFSSL_"
  2105. elif test "x$SCHANNEL_ENABLED" = "x1"; then
  2106. versioned_symbols_flavour="SCHANNEL_"
  2107. elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then
  2108. versioned_symbols_flavour="SECURE_TRANSPORT_"
  2109. else
  2110. versioned_symbols_flavour=""
  2111. fi
  2112. versioned_symbols="yes"
  2113. fi
  2114. ;;
  2115. *) AC_MSG_RESULT(no)
  2116. ;;
  2117. esac
  2118. ], [
  2119. AC_MSG_RESULT(no)
  2120. ]
  2121. )
  2122. AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
  2123. ["$versioned_symbols_flavour"])
  2124. AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
  2125. [test "x$versioned_symbols" = 'xyes'])
  2126. dnl Update .plist file with current version
  2127. AC_SUBST([CURL_PLIST_VERSION],
  2128. ["$CURLVERSION"])
  2129. dnl -------------------------------------------------
  2130. dnl check winidn option before other IDN libraries
  2131. dnl -------------------------------------------------
  2132. AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
  2133. OPT_WINIDN="default"
  2134. AC_ARG_WITH(winidn,
  2135. AS_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
  2136. AS_HELP_STRING([--without-winidn], [disable Windows native IDN]),
  2137. OPT_WINIDN=$withval)
  2138. case "$OPT_WINIDN" in
  2139. no|default)
  2140. dnl --without-winidn option used or configure option not specified
  2141. want_winidn="no"
  2142. AC_MSG_RESULT([no])
  2143. ;;
  2144. yes)
  2145. dnl --with-winidn option used without path
  2146. want_winidn="yes"
  2147. want_winidn_path="default"
  2148. AC_MSG_RESULT([yes])
  2149. ;;
  2150. *)
  2151. dnl --with-winidn option used with path
  2152. want_winidn="yes"
  2153. want_winidn_path="$withval"
  2154. AC_MSG_RESULT([yes ($withval)])
  2155. ;;
  2156. esac
  2157. if test "$want_winidn" = "yes"; then
  2158. dnl winidn library support has been requested
  2159. clean_CFLAGS="$CFLAGS"
  2160. clean_CPPFLAGS="$CPPFLAGS"
  2161. clean_LDFLAGS="$LDFLAGS"
  2162. clean_LIBS="$LIBS"
  2163. WINIDN_LIBS="-lnormaliz"
  2164. WINIDN_CPPFLAGS=""
  2165. #
  2166. if test "$want_winidn_path" != "default"; then
  2167. dnl path has been specified
  2168. dnl pkg-config not available or provides no info
  2169. WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
  2170. WINIDN_CPPFLAGS="-I$want_winidn_path/include"
  2171. WINIDN_DIR="$want_winidn_path/lib$libsuff"
  2172. fi
  2173. #
  2174. dnl WinIDN requires a minimum supported OS version of at least Vista (0x0600)
  2175. AC_COMPILE_IFELSE([
  2176. AC_LANG_PROGRAM([[
  2177. #include <windows.h>
  2178. ]],[[
  2179. #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
  2180. #error
  2181. #endif
  2182. ]])
  2183. ],[
  2184. ],[
  2185. CFLAGS=`echo $CFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
  2186. CFLAGS=`echo $CFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
  2187. CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
  2188. CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
  2189. WINIDN_CPPFLAGS="$WINIDN_CPPFLAGS -DWINVER=0x0600"
  2190. ])
  2191. #
  2192. CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
  2193. LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
  2194. LIBS="$WINIDN_LIBS $LIBS"
  2195. #
  2196. AC_MSG_CHECKING([if IdnToUnicode can be linked])
  2197. AC_LINK_IFELSE([
  2198. AC_LANG_PROGRAM([[
  2199. #include <windows.h>
  2200. ]],[[
  2201. IdnToUnicode(0, NULL, 0, NULL, 0);
  2202. ]])
  2203. ],[
  2204. AC_MSG_RESULT([yes])
  2205. tst_links_winidn="yes"
  2206. ],[
  2207. AC_MSG_RESULT([no])
  2208. tst_links_winidn="no"
  2209. ])
  2210. #
  2211. if test "$tst_links_winidn" = "yes"; then
  2212. AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
  2213. AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.])
  2214. AC_SUBST([IDN_ENABLED], [1])
  2215. curl_idn_msg="enabled (Windows-native)"
  2216. else
  2217. AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
  2218. CFLAGS="$clean_CFLAGS"
  2219. CPPFLAGS="$clean_CPPFLAGS"
  2220. LDFLAGS="$clean_LDFLAGS"
  2221. LIBS="$clean_LIBS"
  2222. fi
  2223. fi
  2224. dnl **********************************************************************
  2225. dnl Check for the presence of IDN libraries and headers
  2226. dnl **********************************************************************
  2227. AC_MSG_CHECKING([whether to build with libidn2])
  2228. OPT_IDN="default"
  2229. AC_ARG_WITH(libidn2,
  2230. AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
  2231. AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
  2232. [OPT_IDN=$withval])
  2233. if test "x$tst_links_winidn" = "xyes"; then
  2234. want_idn="no"
  2235. AC_MSG_RESULT([no (using winidn instead)])
  2236. else
  2237. case "$OPT_IDN" in
  2238. no)
  2239. dnl --without-libidn2 option used
  2240. want_idn="no"
  2241. AC_MSG_RESULT([no])
  2242. ;;
  2243. default)
  2244. dnl configure option not specified
  2245. want_idn="yes"
  2246. want_idn_path="default"
  2247. AC_MSG_RESULT([(assumed) yes])
  2248. ;;
  2249. yes)
  2250. dnl --with-libidn2 option used without path
  2251. want_idn="yes"
  2252. want_idn_path="default"
  2253. AC_MSG_RESULT([yes])
  2254. ;;
  2255. *)
  2256. dnl --with-libidn2 option used with path
  2257. want_idn="yes"
  2258. want_idn_path="$withval"
  2259. AC_MSG_RESULT([yes ($withval)])
  2260. ;;
  2261. esac
  2262. fi
  2263. if test "$want_idn" = "yes"; then
  2264. dnl idn library support has been requested
  2265. clean_CPPFLAGS="$CPPFLAGS"
  2266. clean_LDFLAGS="$LDFLAGS"
  2267. clean_LIBS="$LIBS"
  2268. PKGCONFIG="no"
  2269. #
  2270. if test "$want_idn_path" != "default"; then
  2271. dnl path has been specified
  2272. IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
  2273. CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
  2274. if test "$PKGCONFIG" != "no"; then
  2275. IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2276. $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
  2277. IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2278. $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
  2279. IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2280. $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
  2281. IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
  2282. else
  2283. dnl pkg-config not available or provides no info
  2284. IDN_LIBS="-lidn2"
  2285. IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
  2286. IDN_CPPFLAGS="-I$want_idn_path/include"
  2287. IDN_DIR="$want_idn_path/lib$libsuff"
  2288. fi
  2289. else
  2290. dnl path not specified
  2291. CURL_CHECK_PKGCONFIG(libidn2)
  2292. if test "$PKGCONFIG" != "no"; then
  2293. IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
  2294. IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
  2295. IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
  2296. IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
  2297. else
  2298. dnl pkg-config not available or provides no info
  2299. IDN_LIBS="-lidn2"
  2300. fi
  2301. fi
  2302. #
  2303. if test "$PKGCONFIG" != "no"; then
  2304. AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
  2305. AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
  2306. AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
  2307. AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
  2308. else
  2309. AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
  2310. AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
  2311. AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
  2312. AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
  2313. fi
  2314. #
  2315. CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
  2316. LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
  2317. LIBS="$IDN_LIBS $LIBS"
  2318. #
  2319. AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
  2320. AC_LINK_IFELSE([
  2321. AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
  2322. ],[
  2323. AC_MSG_RESULT([yes])
  2324. tst_links_libidn="yes"
  2325. ],[
  2326. AC_MSG_RESULT([no])
  2327. tst_links_libidn="no"
  2328. ])
  2329. #
  2330. AC_CHECK_HEADERS( idn2.h )
  2331. if test "$tst_links_libidn" = "yes"; then
  2332. AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
  2333. dnl different versions of libidn have different setups of these:
  2334. AC_SUBST([IDN_ENABLED], [1])
  2335. curl_idn_msg="enabled (libidn2)"
  2336. if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
  2337. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
  2338. export CURL_LIBRARY_PATH
  2339. AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
  2340. fi
  2341. else
  2342. AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
  2343. CPPFLAGS="$clean_CPPFLAGS"
  2344. LDFLAGS="$clean_LDFLAGS"
  2345. LIBS="$clean_LIBS"
  2346. fi
  2347. fi
  2348. dnl **********************************************************************
  2349. dnl Check for nghttp2
  2350. dnl **********************************************************************
  2351. OPT_H2="yes"
  2352. if test "x$disable_http" = "xyes" -o X"$want_hyper" != Xno; then
  2353. # without HTTP or with Hyper, nghttp2 is no use
  2354. OPT_H2="no"
  2355. fi
  2356. AC_ARG_WITH(nghttp2,
  2357. AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
  2358. AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
  2359. [OPT_H2=$withval])
  2360. case "$OPT_H2" in
  2361. no)
  2362. dnl --without-nghttp2 option used
  2363. want_nghttp2="no"
  2364. ;;
  2365. yes)
  2366. dnl --with-nghttp2 option used without path
  2367. want_nghttp2="default"
  2368. want_nghttp2_path=""
  2369. want_nghttp2_pkg_config_path=""
  2370. ;;
  2371. *)
  2372. dnl --with-nghttp2 option used with path
  2373. want_nghttp2="yes"
  2374. want_nghttp2_path="$withval"
  2375. want_nghttp2_pkg_config_path="$withval/lib/pkgconfig"
  2376. ;;
  2377. esac
  2378. if test X"$want_nghttp2" != Xno; then
  2379. dnl backup the pre-nghttp2 variables
  2380. CLEANLDFLAGS="$LDFLAGS"
  2381. CLEANCPPFLAGS="$CPPFLAGS"
  2382. CLEANLIBS="$LIBS"
  2383. CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_pkg_config_path)
  2384. if test "$PKGCONFIG" != "no" ; then
  2385. LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
  2386. $PKGCONFIG --libs-only-l libnghttp2`
  2387. AC_MSG_NOTICE([-l is $LIB_H2])
  2388. CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) dnl
  2389. $PKGCONFIG --cflags-only-I libnghttp2`
  2390. AC_MSG_NOTICE([-I is $CPP_H2])
  2391. LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
  2392. $PKGCONFIG --libs-only-L libnghttp2`
  2393. AC_MSG_NOTICE([-L is $LD_H2])
  2394. DIR_H2=`echo $LD_H2 | $SED -e 's/^-L//'`
  2395. elif test x"$want_nghttp2_path" != x; then
  2396. LIB_H2="-lnghttp2"
  2397. LD_H2=-L${want_nghttp2_path}/lib$libsuff
  2398. CPP_H2=-I${want_nghttp2_path}/include
  2399. DIR_H2=${want_nghttp2_path}/lib$libsuff
  2400. elif test X"$want_nghttp2" != Xdefault; then
  2401. dnl no nghttp2 pkg-config found and no custom directory specified,
  2402. dnl deal with it
  2403. AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
  2404. fi
  2405. LDFLAGS="$LDFLAGS $LD_H2"
  2406. CPPFLAGS="$CPPFLAGS $CPP_H2"
  2407. LIBS="$LIB_H2 $LIBS"
  2408. # use nghttp2_session_set_local_window_size to require nghttp2
  2409. # >= 1.12.0
  2410. AC_CHECK_LIB(nghttp2, nghttp2_session_set_local_window_size,
  2411. [
  2412. AC_CHECK_HEADERS(nghttp2/nghttp2.h,
  2413. curl_h2_msg="enabled (nghttp2)"
  2414. NGHTTP2_ENABLED=1
  2415. AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
  2416. AC_SUBST(USE_NGHTTP2, [1])
  2417. )
  2418. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2"
  2419. export CURL_LIBRARY_PATH
  2420. AC_MSG_NOTICE([Added $DIR_H2 to CURL_LIBRARY_PATH])
  2421. ],
  2422. dnl not found, revert back to clean variables
  2423. LDFLAGS=$CLEANLDFLAGS
  2424. CPPFLAGS=$CLEANCPPFLAGS
  2425. LIBS=$CLEANLIBS
  2426. )
  2427. fi
  2428. dnl **********************************************************************
  2429. dnl Check for ngtcp2 (QUIC)
  2430. dnl **********************************************************************
  2431. OPT_TCP2="yes"
  2432. if test "x$disable_http" = "xyes"; then
  2433. # without HTTP, ngtcp2 is no use
  2434. OPT_TCP2="no"
  2435. fi
  2436. AC_ARG_WITH(ngtcp2,
  2437. AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
  2438. AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
  2439. [OPT_TCP2=$withval])
  2440. case "$OPT_TCP2" in
  2441. no)
  2442. dnl --without-ngtcp2 option used
  2443. want_tcp2="no"
  2444. ;;
  2445. yes)
  2446. dnl --with-ngtcp2 option used without path
  2447. want_tcp2="default"
  2448. want_tcp2_path=""
  2449. ;;
  2450. *)
  2451. dnl --with-ngtcp2 option used with path
  2452. want_tcp2="yes"
  2453. want_tcp2_path="$withval/lib/pkgconfig"
  2454. ;;
  2455. esac
  2456. curl_tcp2_msg="no (--with-ngtcp2)"
  2457. if test X"$want_tcp2" != Xno; then
  2458. dnl backup the pre-ngtcp2 variables
  2459. CLEANLDFLAGS="$LDFLAGS"
  2460. CLEANCPPFLAGS="$CPPFLAGS"
  2461. CLEANLIBS="$LIBS"
  2462. CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
  2463. if test "$PKGCONFIG" != "no" ; then
  2464. LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2465. $PKGCONFIG --libs-only-l libngtcp2`
  2466. AC_MSG_NOTICE([-l is $LIB_TCP2])
  2467. CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
  2468. $PKGCONFIG --cflags-only-I libngtcp2`
  2469. AC_MSG_NOTICE([-I is $CPP_TCP2])
  2470. LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2471. $PKGCONFIG --libs-only-L libngtcp2`
  2472. AC_MSG_NOTICE([-L is $LD_TCP2])
  2473. LDFLAGS="$LDFLAGS $LD_TCP2"
  2474. CPPFLAGS="$CPPFLAGS $CPP_TCP2"
  2475. LIBS="$LIB_TCP2 $LIBS"
  2476. if test "x$cross_compiling" != "xyes"; then
  2477. DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
  2478. fi
  2479. AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned,
  2480. [
  2481. AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
  2482. NGTCP2_ENABLED=1
  2483. AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
  2484. AC_SUBST(USE_NGTCP2, [1])
  2485. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
  2486. export CURL_LIBRARY_PATH
  2487. AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
  2488. )
  2489. ],
  2490. dnl not found, revert back to clean variables
  2491. LDFLAGS=$CLEANLDFLAGS
  2492. CPPFLAGS=$CLEANCPPFLAGS
  2493. LIBS=$CLEANLIBS
  2494. )
  2495. else
  2496. dnl no ngtcp2 pkg-config found, deal with it
  2497. if test X"$want_tcp2" != Xdefault; then
  2498. dnl To avoid link errors, we do not allow --with-ngtcp2 without
  2499. dnl a pkgconfig file
  2500. AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
  2501. fi
  2502. fi
  2503. fi
  2504. if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
  2505. dnl backup the pre-ngtcp2_crypto_openssl variables
  2506. CLEANLDFLAGS="$LDFLAGS"
  2507. CLEANCPPFLAGS="$CPPFLAGS"
  2508. CLEANLIBS="$LIBS"
  2509. CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
  2510. if test "$PKGCONFIG" != "no" ; then
  2511. LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2512. $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
  2513. AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
  2514. CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
  2515. $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
  2516. AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
  2517. LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2518. $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
  2519. AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
  2520. LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
  2521. CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
  2522. LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
  2523. if test "x$cross_compiling" != "xyes"; then
  2524. DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
  2525. fi
  2526. AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_recv_client_initial_cb,
  2527. [
  2528. AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
  2529. NGTCP2_ENABLED=1
  2530. AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
  2531. AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
  2532. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
  2533. export CURL_LIBRARY_PATH
  2534. AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
  2535. )
  2536. ],
  2537. dnl not found, revert back to clean variables
  2538. LDFLAGS=$CLEANLDFLAGS
  2539. CPPFLAGS=$CLEANCPPFLAGS
  2540. LIBS=$CLEANLIBS
  2541. )
  2542. else
  2543. dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
  2544. if test X"$want_tcp2" != Xdefault; then
  2545. dnl To avoid link errors, we do not allow --with-ngtcp2 without
  2546. dnl a pkgconfig file
  2547. AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
  2548. fi
  2549. fi
  2550. fi
  2551. if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
  2552. dnl backup the pre-ngtcp2_crypto_gnutls variables
  2553. CLEANLDFLAGS="$LDFLAGS"
  2554. CLEANCPPFLAGS="$CPPFLAGS"
  2555. CLEANLIBS="$LIBS"
  2556. CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
  2557. if test "$PKGCONFIG" != "no" ; then
  2558. LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2559. $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
  2560. AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
  2561. CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
  2562. $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
  2563. AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
  2564. LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2565. $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
  2566. AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
  2567. LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
  2568. CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
  2569. LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
  2570. if test "x$cross_compiling" != "xyes"; then
  2571. DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
  2572. fi
  2573. AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_recv_client_initial_cb,
  2574. [
  2575. AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
  2576. NGTCP2_ENABLED=1
  2577. AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
  2578. AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
  2579. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
  2580. export CURL_LIBRARY_PATH
  2581. AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
  2582. )
  2583. ],
  2584. dnl not found, revert back to clean variables
  2585. LDFLAGS=$CLEANLDFLAGS
  2586. CPPFLAGS=$CLEANCPPFLAGS
  2587. LIBS=$CLEANLIBS
  2588. )
  2589. else
  2590. dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
  2591. if test X"$want_tcp2" != Xdefault; then
  2592. dnl To avoid link errors, we do not allow --with-ngtcp2 without
  2593. dnl a pkgconfig file
  2594. AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
  2595. fi
  2596. fi
  2597. fi
  2598. if test "x$NGTCP2_ENABLED" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then
  2599. dnl backup the pre-ngtcp2_crypto_wolfssl variables
  2600. CLEANLDFLAGS="$LDFLAGS"
  2601. CLEANCPPFLAGS="$CPPFLAGS"
  2602. CLEANLIBS="$LIBS"
  2603. CURL_CHECK_PKGCONFIG(libngtcp2_crypto_wolfssl, $want_tcp2_path)
  2604. if test "$PKGCONFIG" != "no" ; then
  2605. LIB_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2606. $PKGCONFIG --libs-only-l libngtcp2_crypto_wolfssl`
  2607. AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_WOLFSSL])
  2608. CPP_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
  2609. $PKGCONFIG --cflags-only-I libngtcp2_crypto_wolfssl`
  2610. AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_WOLFSSL])
  2611. LD_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2612. $PKGCONFIG --libs-only-L libngtcp2_crypto_wolfssl`
  2613. AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_WOLFSSL])
  2614. LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_WOLFSSL"
  2615. CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_WOLFSSL"
  2616. LIBS="$LIB_NGTCP2_CRYPTO_WOLFSSL $LIBS"
  2617. if test "x$cross_compiling" != "xyes"; then
  2618. DIR_NGTCP2_CRYPTO_WOLFSSL=`echo $LD_NGTCP2_CRYPTO_WOLFSSL | $SED -e 's/^-L//'`
  2619. fi
  2620. AC_CHECK_LIB(ngtcp2_crypto_wolfssl, ngtcp2_crypto_recv_client_initial_cb,
  2621. [
  2622. AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
  2623. NGTCP2_ENABLED=1
  2624. AC_DEFINE(USE_NGTCP2_CRYPTO_WOLFSSL, 1, [if ngtcp2_crypto_wolfssl is in use])
  2625. AC_SUBST(USE_NGTCP2_CRYPTO_WOLFSSL, [1])
  2626. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_WOLFSSL"
  2627. export CURL_LIBRARY_PATH
  2628. AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH])
  2629. )
  2630. ],
  2631. dnl not found, revert back to clean variables
  2632. LDFLAGS=$CLEANLDFLAGS
  2633. CPPFLAGS=$CLEANCPPFLAGS
  2634. LIBS=$CLEANLIBS
  2635. )
  2636. else
  2637. dnl no ngtcp2_crypto_wolfssl pkg-config found, deal with it
  2638. if test X"$want_tcp2" != Xdefault; then
  2639. dnl To avoid link errors, we do not allow --with-ngtcp2 without
  2640. dnl a pkgconfig file
  2641. AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_wolfssl pkg-config file.])
  2642. fi
  2643. fi
  2644. fi
  2645. dnl **********************************************************************
  2646. dnl Check for nghttp3 (HTTP/3 with ngtcp2)
  2647. dnl **********************************************************************
  2648. OPT_NGHTTP3="yes"
  2649. if test "x$NGTCP2_ENABLED" = "x"; then
  2650. # without ngtcp2, nghttp3 is of no use for us
  2651. OPT_NGHTTP3="no"
  2652. fi
  2653. AC_ARG_WITH(nghttp3,
  2654. AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
  2655. AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
  2656. [OPT_NGHTTP3=$withval])
  2657. case "$OPT_NGHTTP3" in
  2658. no)
  2659. dnl --without-nghttp3 option used
  2660. want_nghttp3="no"
  2661. ;;
  2662. yes)
  2663. dnl --with-nghttp3 option used without path
  2664. want_nghttp3="default"
  2665. want_nghttp3_path=""
  2666. ;;
  2667. *)
  2668. dnl --with-nghttp3 option used with path
  2669. want_nghttp3="yes"
  2670. want_nghttp3_path="$withval/lib/pkgconfig"
  2671. ;;
  2672. esac
  2673. curl_http3_msg="no (--with-nghttp3)"
  2674. if test X"$want_nghttp3" != Xno; then
  2675. dnl backup the pre-nghttp3 variables
  2676. CLEANLDFLAGS="$LDFLAGS"
  2677. CLEANCPPFLAGS="$CPPFLAGS"
  2678. CLEANLIBS="$LIBS"
  2679. CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
  2680. if test "$PKGCONFIG" != "no" ; then
  2681. LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
  2682. $PKGCONFIG --libs-only-l libnghttp3`
  2683. AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
  2684. CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
  2685. $PKGCONFIG --cflags-only-I libnghttp3`
  2686. AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
  2687. LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
  2688. $PKGCONFIG --libs-only-L libnghttp3`
  2689. AC_MSG_NOTICE([-L is $LD_NGHTTP3])
  2690. LDFLAGS="$LDFLAGS $LD_NGHTTP3"
  2691. CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
  2692. LIBS="$LIB_NGHTTP3 $LIBS"
  2693. if test "x$cross_compiling" != "xyes"; then
  2694. DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
  2695. fi
  2696. AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned,
  2697. [
  2698. AC_CHECK_HEADERS(nghttp3/nghttp3.h,
  2699. curl_h3_msg="enabled (ngtcp2 + nghttp3)"
  2700. NGHTTP3_ENABLED=1
  2701. AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
  2702. AC_SUBST(USE_NGHTTP3, [1])
  2703. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
  2704. export CURL_LIBRARY_PATH
  2705. AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
  2706. experimental="$experimental HTTP3"
  2707. )
  2708. ],
  2709. dnl not found, revert back to clean variables
  2710. LDFLAGS=$CLEANLDFLAGS
  2711. CPPFLAGS=$CLEANCPPFLAGS
  2712. LIBS=$CLEANLIBS
  2713. )
  2714. else
  2715. dnl no nghttp3 pkg-config found, deal with it
  2716. if test X"$want_nghttp3" != Xdefault; then
  2717. dnl To avoid link errors, we do not allow --with-nghttp3 without
  2718. dnl a pkgconfig file
  2719. AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
  2720. fi
  2721. fi
  2722. fi
  2723. dnl **********************************************************************
  2724. dnl Check for quiche (QUIC)
  2725. dnl **********************************************************************
  2726. OPT_QUICHE="no"
  2727. if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
  2728. # without HTTP or with ngtcp2, quiche is no use
  2729. OPT_QUICHE="no"
  2730. fi
  2731. AC_ARG_WITH(quiche,
  2732. AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
  2733. AS_HELP_STRING([--without-quiche],[Disable quiche usage]),
  2734. [OPT_QUICHE=$withval])
  2735. case "$OPT_QUICHE" in
  2736. no)
  2737. dnl --without-quiche option used
  2738. want_quiche="no"
  2739. ;;
  2740. yes)
  2741. dnl --with-quiche option used without path
  2742. want_quiche="default"
  2743. want_quiche_path=""
  2744. ;;
  2745. *)
  2746. dnl --with-quiche option used with path
  2747. want_quiche="yes"
  2748. want_quiche_path="$withval"
  2749. ;;
  2750. esac
  2751. if test X"$want_quiche" != Xno; then
  2752. if test "$NGHTTP3_ENABLED" = 1; then
  2753. AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive])
  2754. fi
  2755. dnl backup the pre-quiche variables
  2756. CLEANLDFLAGS="$LDFLAGS"
  2757. CLEANCPPFLAGS="$CPPFLAGS"
  2758. CLEANLIBS="$LIBS"
  2759. CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
  2760. if test "$PKGCONFIG" != "no" ; then
  2761. LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
  2762. $PKGCONFIG --libs-only-l quiche`
  2763. AC_MSG_NOTICE([-l is $LIB_QUICHE])
  2764. CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
  2765. $PKGCONFIG --cflags-only-I quiche`
  2766. AC_MSG_NOTICE([-I is $CPP_QUICHE])
  2767. LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
  2768. $PKGCONFIG --libs-only-L quiche`
  2769. AC_MSG_NOTICE([-L is $LD_QUICHE])
  2770. LDFLAGS="$LDFLAGS $LD_QUICHE"
  2771. CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
  2772. LIBS="$LIB_QUICHE $LIBS"
  2773. if test "x$cross_compiling" != "xyes"; then
  2774. DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
  2775. fi
  2776. AC_CHECK_LIB(quiche, quiche_connect,
  2777. [
  2778. AC_CHECK_HEADERS(quiche.h,
  2779. experimental="$experimental HTTP3"
  2780. AC_MSG_NOTICE([HTTP3 support is experimental])
  2781. curl_h3_msg="enabled (quiche)"
  2782. QUICHE_ENABLED=1
  2783. AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
  2784. AC_SUBST(USE_QUICHE, [1])
  2785. AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
  2786. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
  2787. export CURL_LIBRARY_PATH
  2788. AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
  2789. [],
  2790. [
  2791. AC_INCLUDES_DEFAULT
  2792. #include <sys/socket.h>
  2793. ]
  2794. )
  2795. ],
  2796. dnl not found, revert back to clean variables
  2797. AC_MSG_ERROR([couldn't use quiche])
  2798. )
  2799. else
  2800. dnl no quiche pkg-config found, deal with it
  2801. if test X"$want_quiche" != Xdefault; then
  2802. dnl To avoid link errors, we do not allow --with-quiche without
  2803. dnl a pkgconfig file
  2804. AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
  2805. fi
  2806. fi
  2807. fi
  2808. dnl **********************************************************************
  2809. dnl Check for msh3 (QUIC)
  2810. dnl **********************************************************************
  2811. OPT_MSH3="no"
  2812. if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
  2813. # without HTTP or with ngtcp2, msh3 is no use
  2814. OPT_MSH3="no"
  2815. fi
  2816. AC_ARG_WITH(msh3,
  2817. AS_HELP_STRING([--with-msh3=PATH],[Enable msh3 usage])
  2818. AS_HELP_STRING([--without-msh3],[Disable msh3 usage]),
  2819. [OPT_MSH3=$withval])
  2820. case "$OPT_MSH3" in
  2821. no)
  2822. dnl --without-msh3 option used
  2823. want_msh3="no"
  2824. ;;
  2825. yes)
  2826. dnl --with-msh3 option used without path
  2827. want_msh3="default"
  2828. want_msh3_path=""
  2829. ;;
  2830. *)
  2831. dnl --with-msh3 option used with path
  2832. want_msh3="yes"
  2833. want_msh3_path="$withval"
  2834. ;;
  2835. esac
  2836. if test X"$want_msh3" != Xno; then
  2837. if test "$NGHTTP3_ENABLED" = 1; then
  2838. AC_MSG_ERROR([--with-msh3 and --with-ngtcp2 are mutually exclusive])
  2839. fi
  2840. dnl backup the pre-msh3 variables
  2841. CLEANLDFLAGS="$LDFLAGS"
  2842. CLEANCPPFLAGS="$CPPFLAGS"
  2843. CLEANLIBS="$LIBS"
  2844. if test -n "$want_msh3_path"; then
  2845. LD_MSH3="-L$want_msh3_path/lib"
  2846. CPP_MSH3="-I$want_msh3_path/include"
  2847. DIR_MSH3="$want_msh3_path/lib"
  2848. LDFLAGS="$LDFLAGS $LD_MSH3"
  2849. CPPFLAGS="$CPPFLAGS $CPP_MSH3"
  2850. fi
  2851. LIBS="-lmsh3 $LIBS"
  2852. AC_CHECK_LIB(msh3, MsH3ApiOpen,
  2853. [
  2854. AC_CHECK_HEADERS(msh3.h,
  2855. curl_h3_msg="enabled (msh3)"
  2856. MSH3_ENABLED=1
  2857. AC_DEFINE(USE_MSH3, 1, [if msh3 is in use])
  2858. AC_SUBST(USE_MSH3, [1])
  2859. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_MSH3"
  2860. export CURL_LIBRARY_PATH
  2861. AC_MSG_NOTICE([Added $DIR_MSH3 to CURL_LIBRARY_PATH]),
  2862. experimental="$experimental HTTP3"
  2863. )
  2864. ],
  2865. dnl not found, revert back to clean variables
  2866. LDFLAGS=$CLEANLDFLAGS
  2867. CPPFLAGS=$CLEANCPPFLAGS
  2868. LIBS=$CLEANLIBS
  2869. )
  2870. fi
  2871. dnl **********************************************************************
  2872. dnl Check for zsh completion path
  2873. dnl **********************************************************************
  2874. OPT_ZSH_FPATH=default
  2875. AC_ARG_WITH(zsh-functions-dir,
  2876. AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
  2877. AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
  2878. [OPT_ZSH_FPATH=$withval])
  2879. case "$OPT_ZSH_FPATH" in
  2880. no)
  2881. dnl --without-zsh-functions-dir option used
  2882. ;;
  2883. default|yes)
  2884. dnl --with-zsh-functions-dir option used without path
  2885. ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
  2886. AC_SUBST(ZSH_FUNCTIONS_DIR)
  2887. ;;
  2888. *)
  2889. dnl --with-zsh-functions-dir option used with path
  2890. ZSH_FUNCTIONS_DIR="$withval"
  2891. AC_SUBST(ZSH_FUNCTIONS_DIR)
  2892. ;;
  2893. esac
  2894. dnl **********************************************************************
  2895. dnl Check for fish completion path
  2896. dnl **********************************************************************
  2897. OPT_FISH_FPATH=default
  2898. AC_ARG_WITH(fish-functions-dir,
  2899. AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
  2900. AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
  2901. [OPT_FISH_FPATH=$withval])
  2902. case "$OPT_FISH_FPATH" in
  2903. no)
  2904. dnl --without-fish-functions-dir option used
  2905. ;;
  2906. default|yes)
  2907. dnl --with-fish-functions-dir option used without path
  2908. CURL_CHECK_PKGCONFIG(fish)
  2909. if test "$PKGCONFIG" != "no" ; then
  2910. FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
  2911. else
  2912. FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
  2913. fi
  2914. AC_SUBST(FISH_FUNCTIONS_DIR)
  2915. ;;
  2916. *)
  2917. dnl --with-fish-functions-dir option used with path
  2918. FISH_FUNCTIONS_DIR="$withval"
  2919. AC_SUBST(FISH_FUNCTIONS_DIR)
  2920. ;;
  2921. esac
  2922. dnl Now check for the very most basic headers. Then we can use these
  2923. dnl ones as default-headers when checking for the rest!
  2924. AC_CHECK_HEADERS(
  2925. sys/types.h \
  2926. sys/time.h \
  2927. sys/select.h \
  2928. sys/socket.h \
  2929. sys/ioctl.h \
  2930. sys/uio.h \
  2931. assert.h \
  2932. unistd.h \
  2933. stdlib.h \
  2934. arpa/inet.h \
  2935. net/if.h \
  2936. netinet/in.h \
  2937. netinet/in6.h \
  2938. sys/un.h \
  2939. linux/tcp.h \
  2940. netinet/tcp.h \
  2941. netinet/udp.h \
  2942. netdb.h \
  2943. sys/sockio.h \
  2944. sys/stat.h \
  2945. sys/param.h \
  2946. termios.h \
  2947. termio.h \
  2948. fcntl.h \
  2949. io.h \
  2950. pwd.h \
  2951. utime.h \
  2952. sys/utime.h \
  2953. sys/poll.h \
  2954. poll.h \
  2955. socket.h \
  2956. sys/resource.h \
  2957. libgen.h \
  2958. locale.h \
  2959. errno.h \
  2960. stdbool.h \
  2961. arpa/tftp.h \
  2962. sys/filio.h \
  2963. sys/wait.h \
  2964. setjmp.h,
  2965. dnl to do if not found
  2966. [],
  2967. dnl to do if found
  2968. [],
  2969. dnl default includes
  2970. [
  2971. #ifdef HAVE_SYS_TYPES_H
  2972. #include <sys/types.h>
  2973. #endif
  2974. #ifdef HAVE_SYS_TIME_H
  2975. #include <sys/time.h>
  2976. #endif
  2977. #ifdef HAVE_SYS_SELECT_H
  2978. #include <sys/select.h>
  2979. #elif defined(HAVE_UNISTD_H)
  2980. #include <unistd.h>
  2981. #endif
  2982. #ifdef HAVE_SYS_SOCKET_H
  2983. #include <sys/socket.h>
  2984. #endif
  2985. #ifdef HAVE_NETINET_IN_H
  2986. #include <netinet/in.h>
  2987. #endif
  2988. #ifdef HAVE_NETINET_IN6_H
  2989. #include <netinet/in6.h>
  2990. #endif
  2991. #ifdef HAVE_SYS_UN_H
  2992. #include <sys/un.h>
  2993. #endif
  2994. ]
  2995. )
  2996. dnl Checks for typedefs, structures, and compiler characteristics.
  2997. AC_C_CONST
  2998. CURL_CHECK_VARIADIC_MACROS
  2999. AC_TYPE_SIZE_T
  3000. CURL_CHECK_STRUCT_TIMEVAL
  3001. CURL_VERIFY_RUNTIMELIBS
  3002. CURL_SIZEOF(size_t)
  3003. CURL_SIZEOF(long)
  3004. CURL_SIZEOF(int)
  3005. CURL_SIZEOF(time_t)
  3006. CURL_SIZEOF(off_t)
  3007. o=$CPPFLAGS
  3008. CPPFLAGS="-I$srcdir/include $CPPFLAGS"
  3009. CURL_SIZEOF(curl_off_t, [
  3010. #include <curl/system.h>
  3011. ])
  3012. CPPFLAGS=$o
  3013. AC_CHECK_TYPE(long long,
  3014. [AC_DEFINE(HAVE_LONGLONG, 1,
  3015. [Define to 1 if the compiler supports the 'long long' data type.])]
  3016. longlong="yes"
  3017. )
  3018. # check for ssize_t
  3019. AC_CHECK_TYPE(ssize_t, ,
  3020. AC_DEFINE(ssize_t, int, [the signed version of size_t]))
  3021. # check for bool type
  3022. AC_CHECK_TYPE([bool],[
  3023. AC_DEFINE(HAVE_BOOL_T, 1,
  3024. [Define to 1 if bool is an available type.])
  3025. ], ,[
  3026. #ifdef HAVE_SYS_TYPES_H
  3027. #include <sys/types.h>
  3028. #endif
  3029. #ifdef HAVE_STDBOOL_H
  3030. #include <stdbool.h>
  3031. #endif
  3032. ])
  3033. # check for sa_family_t
  3034. AC_CHECK_TYPE(sa_family_t,
  3035. AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
  3036. [
  3037. # The windows name?
  3038. AC_CHECK_TYPE(ADDRESS_FAMILY,
  3039. AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
  3040. AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
  3041. [
  3042. #ifdef HAVE_SYS_SOCKET_H
  3043. #include <sys/socket.h>
  3044. #endif
  3045. ])
  3046. ],
  3047. [
  3048. #ifdef HAVE_SYS_SOCKET_H
  3049. #include <sys/socket.h>
  3050. #endif
  3051. ])
  3052. # check for suseconds_t
  3053. AC_CHECK_TYPE([suseconds_t],[
  3054. AC_DEFINE(HAVE_SUSECONDS_T, 1,
  3055. [Define to 1 if suseconds_t is an available type.])
  3056. ], ,[
  3057. #ifdef HAVE_SYS_TYPES_H
  3058. #include <sys/types.h>
  3059. #endif
  3060. #ifdef HAVE_SYS_TIME_H
  3061. #include <sys/time.h>
  3062. #endif
  3063. ])
  3064. AC_MSG_CHECKING([if time_t is unsigned])
  3065. CURL_RUN_IFELSE(
  3066. [
  3067. #include <time.h>
  3068. #include <limits.h>
  3069. time_t t = -1;
  3070. return (t > 0);
  3071. ],[
  3072. AC_MSG_RESULT([yes])
  3073. AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
  3074. ],[
  3075. AC_MSG_RESULT([no])
  3076. ],[
  3077. dnl cross-compiling, most systems are unsigned
  3078. AC_MSG_RESULT([no])
  3079. ])
  3080. CURL_CONFIGURE_PULL_SYS_POLL
  3081. TYPE_IN_ADDR_T
  3082. TYPE_SOCKADDR_STORAGE
  3083. CURL_CHECK_FUNC_SELECT
  3084. CURL_CHECK_FUNC_RECV
  3085. CURL_CHECK_FUNC_SEND
  3086. CURL_CHECK_MSG_NOSIGNAL
  3087. CURL_CHECK_FUNC_ALARM
  3088. CURL_CHECK_FUNC_BASENAME
  3089. CURL_CHECK_FUNC_CLOSESOCKET
  3090. CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
  3091. CURL_CHECK_FUNC_CONNECT
  3092. CURL_CHECK_FUNC_FCNTL
  3093. CURL_CHECK_FUNC_FREEADDRINFO
  3094. CURL_CHECK_FUNC_FSETXATTR
  3095. CURL_CHECK_FUNC_FTRUNCATE
  3096. CURL_CHECK_FUNC_GETADDRINFO
  3097. CURL_CHECK_FUNC_GETHOSTBYNAME
  3098. CURL_CHECK_FUNC_GETHOSTBYNAME_R
  3099. CURL_CHECK_FUNC_GETHOSTNAME
  3100. CURL_CHECK_FUNC_GETPEERNAME
  3101. CURL_CHECK_FUNC_GETSOCKNAME
  3102. CURL_CHECK_FUNC_IF_NAMETOINDEX
  3103. CURL_CHECK_FUNC_GETIFADDRS
  3104. CURL_CHECK_FUNC_GMTIME_R
  3105. CURL_CHECK_FUNC_INET_NTOP
  3106. CURL_CHECK_FUNC_INET_PTON
  3107. CURL_CHECK_FUNC_IOCTLSOCKET
  3108. CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
  3109. CURL_CHECK_FUNC_MEMRCHR
  3110. CURL_CHECK_FUNC_POLL
  3111. CURL_CHECK_FUNC_SIGACTION
  3112. CURL_CHECK_FUNC_SIGINTERRUPT
  3113. CURL_CHECK_FUNC_SIGNAL
  3114. CURL_CHECK_FUNC_SIGSETJMP
  3115. CURL_CHECK_FUNC_SOCKET
  3116. CURL_CHECK_FUNC_SOCKETPAIR
  3117. CURL_CHECK_FUNC_STRCASECMP
  3118. CURL_CHECK_FUNC_STRCMPI
  3119. CURL_CHECK_FUNC_STRDUP
  3120. CURL_CHECK_FUNC_STRERROR_R
  3121. CURL_CHECK_FUNC_STRICMP
  3122. CURL_CHECK_FUNC_STRTOK_R
  3123. CURL_CHECK_FUNC_STRTOLL
  3124. case $host in
  3125. *msdosdjgpp)
  3126. ac_cv_func_pipe=no
  3127. skipcheck_pipe=yes
  3128. AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
  3129. ;;
  3130. esac
  3131. AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
  3132. [[#include <pwd.h>
  3133. #include <sys/types.h>]])
  3134. AC_CHECK_FUNCS([fnmatch \
  3135. fchmod \
  3136. geteuid \
  3137. getpass_r \
  3138. getppid \
  3139. getpwuid \
  3140. getpwuid_r \
  3141. getrlimit \
  3142. gettimeofday \
  3143. if_nametoindex \
  3144. mach_absolute_time \
  3145. pipe \
  3146. sched_yield \
  3147. sendmsg \
  3148. setlocale \
  3149. setmode \
  3150. setrlimit \
  3151. utime \
  3152. utimes
  3153. ],[
  3154. ],[
  3155. func="$ac_func"
  3156. eval skipcheck=\$skipcheck_$func
  3157. if test "x$skipcheck" != "xyes"; then
  3158. AC_MSG_CHECKING([deeper for $func])
  3159. AC_LINK_IFELSE([
  3160. AC_LANG_PROGRAM([[
  3161. ]],[[
  3162. $func ();
  3163. ]])
  3164. ],[
  3165. AC_MSG_RESULT([yes])
  3166. eval "ac_cv_func_$func=yes"
  3167. AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
  3168. [Define to 1 if you have the $func function.])
  3169. ],[
  3170. AC_MSG_RESULT([but still no])
  3171. ])
  3172. fi
  3173. ])
  3174. CURL_CHECK_NONBLOCKING_SOCKET
  3175. dnl ************************************************************
  3176. dnl nroff tool stuff
  3177. dnl
  3178. AC_PATH_PROG( PERL, perl, ,
  3179. $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
  3180. AC_SUBST(PERL)
  3181. AC_PATH_PROGS( NROFF, gnroff nroff, ,
  3182. $PATH:/usr/bin/:/usr/local/bin )
  3183. AC_SUBST(NROFF)
  3184. if test -n "$NROFF"; then
  3185. dnl only check for nroff options if an nroff command was found
  3186. AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
  3187. MANOPT="-man"
  3188. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  3189. if test -z "$mancheck"; then
  3190. MANOPT="-mandoc"
  3191. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  3192. if test -z "$mancheck"; then
  3193. MANOPT=""
  3194. AC_MSG_RESULT([failed])
  3195. AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
  3196. else
  3197. AC_MSG_RESULT([$MANOPT])
  3198. fi
  3199. else
  3200. AC_MSG_RESULT([$MANOPT])
  3201. fi
  3202. AC_SUBST(MANOPT)
  3203. fi
  3204. if test -z "$MANOPT"
  3205. then
  3206. dnl if no nroff tool was found, or no option that could convert man pages
  3207. dnl was found, then disable the built-in manual stuff
  3208. AC_MSG_WARN([disabling built-in manual])
  3209. USE_MANUAL="no";
  3210. fi
  3211. dnl *************************************************************************
  3212. dnl If the manual variable still is set, then we go with providing a built-in
  3213. dnl manual
  3214. if test "$USE_MANUAL" = "1"; then
  3215. AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
  3216. curl_manual_msg="enabled"
  3217. fi
  3218. dnl set variable for use in automakefile(s)
  3219. AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
  3220. CURL_CHECK_LIB_ARES
  3221. if test "x$curl_cv_native_windows" != "xyes" &&
  3222. test "x$enable_shared" = "xyes"; then
  3223. build_libhostname=yes
  3224. else
  3225. build_libhostname=no
  3226. fi
  3227. AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
  3228. if test "x$want_ares" != xyes; then
  3229. CURL_CHECK_OPTION_THREADED_RESOLVER
  3230. fi
  3231. dnl ************************************************************
  3232. dnl disable POSIX threads
  3233. dnl
  3234. AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
  3235. AC_ARG_ENABLE(pthreads,
  3236. AS_HELP_STRING([--enable-pthreads],
  3237. [Enable POSIX threads (default for threaded resolver)])
  3238. AS_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
  3239. [ case "$enableval" in
  3240. no) AC_MSG_RESULT(no)
  3241. want_pthreads=no
  3242. ;;
  3243. *) AC_MSG_RESULT(yes)
  3244. want_pthreads=yes
  3245. ;;
  3246. esac ], [
  3247. AC_MSG_RESULT(auto)
  3248. want_pthreads=auto
  3249. ]
  3250. )
  3251. dnl turn off pthreads if rt is disabled
  3252. if test "$want_pthreads" != "no"; then
  3253. if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
  3254. AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
  3255. fi
  3256. if test "$dontwant_rt" != "no"; then
  3257. dnl if --enable-pthreads was explicit then warn it's being ignored
  3258. if test "$want_pthreads" = "yes"; then
  3259. AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
  3260. fi
  3261. want_pthreads=no
  3262. fi
  3263. fi
  3264. dnl turn off pthreads if no threaded resolver
  3265. if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
  3266. want_pthreads=no
  3267. fi
  3268. dnl detect pthreads
  3269. if test "$want_pthreads" != "no"; then
  3270. AC_CHECK_HEADER(pthread.h,
  3271. [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
  3272. save_CFLAGS="$CFLAGS"
  3273. dnl When statically linking against boringssl, -lpthread is added to LIBS.
  3274. dnl Make sure to that this does not pass the check below, we really want
  3275. dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
  3276. dnl lib1541 and lib1565 tests are built with these options. Otherwise
  3277. dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
  3278. save_LIBS="$LIBS"
  3279. LIBS=
  3280. dnl Check for libc variants without a separate pthread lib like bionic
  3281. AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
  3282. LIBS="$save_LIBS"
  3283. dnl on HPUX, life is more complicated...
  3284. case $host in
  3285. *-hp-hpux*)
  3286. dnl it doesn't actually work without -lpthread
  3287. USE_THREADS_POSIX=""
  3288. ;;
  3289. *)
  3290. ;;
  3291. esac
  3292. dnl if it wasn't found without lib, search for it in pthread lib
  3293. if test "$USE_THREADS_POSIX" != "1"
  3294. then
  3295. # assign PTHREAD for pkg-config use
  3296. PTHREAD=" -pthread"
  3297. case $host in
  3298. *-ibm-aix*)
  3299. dnl Check if compiler is xlC
  3300. COMPILER_VERSION=`"$CC" -qversion 2>/dev/null`
  3301. if test x"$COMPILER_VERSION" = "x"; then
  3302. CFLAGS="$CFLAGS -pthread"
  3303. else
  3304. CFLAGS="$CFLAGS -qthreaded"
  3305. fi
  3306. ;;
  3307. powerpc-*amigaos*)
  3308. dnl No -pthread option, but link with -lpthread
  3309. PTHREAD=" -lpthread"
  3310. ;;
  3311. *)
  3312. CFLAGS="$CFLAGS -pthread"
  3313. ;;
  3314. esac
  3315. AC_CHECK_LIB(pthread, pthread_create,
  3316. [USE_THREADS_POSIX=1],
  3317. [ CFLAGS="$save_CFLAGS"])
  3318. fi
  3319. if test "x$USE_THREADS_POSIX" = "x1"
  3320. then
  3321. AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
  3322. curl_res_msg="POSIX threaded"
  3323. fi
  3324. ])
  3325. fi
  3326. dnl threaded resolver check
  3327. if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
  3328. if test "$want_pthreads" = "yes"; then
  3329. AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
  3330. fi
  3331. dnl If native Windows fallback on Win32 threads since no POSIX threads
  3332. if test "$curl_cv_native_windows" = "yes"; then
  3333. USE_THREADS_WIN32=1
  3334. AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
  3335. curl_res_msg="Win32 threaded"
  3336. else
  3337. AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
  3338. fi
  3339. fi
  3340. CURL_CONVERT_INCLUDE_TO_ISYSTEM
  3341. dnl ************************************************************
  3342. dnl disable verbose text strings
  3343. dnl
  3344. AC_MSG_CHECKING([whether to enable verbose strings])
  3345. AC_ARG_ENABLE(verbose,
  3346. AS_HELP_STRING([--enable-verbose],[Enable verbose strings])
  3347. AS_HELP_STRING([--disable-verbose],[Disable verbose strings]),
  3348. [ case "$enableval" in
  3349. no)
  3350. AC_MSG_RESULT(no)
  3351. AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
  3352. curl_verbose_msg="no"
  3353. ;;
  3354. *) AC_MSG_RESULT(yes)
  3355. ;;
  3356. esac ],
  3357. AC_MSG_RESULT(yes)
  3358. )
  3359. dnl ************************************************************
  3360. dnl enable SSPI support
  3361. dnl
  3362. AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
  3363. AC_ARG_ENABLE(sspi,
  3364. AS_HELP_STRING([--enable-sspi],[Enable SSPI])
  3365. AS_HELP_STRING([--disable-sspi],[Disable SSPI]),
  3366. [ case "$enableval" in
  3367. yes)
  3368. if test "$curl_cv_native_windows" = "yes"; then
  3369. AC_MSG_RESULT(yes)
  3370. AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
  3371. AC_SUBST(USE_WINDOWS_SSPI, [1])
  3372. curl_sspi_msg="enabled"
  3373. else
  3374. AC_MSG_RESULT(no)
  3375. AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
  3376. fi
  3377. ;;
  3378. *)
  3379. if test "x$SCHANNEL_ENABLED" = "x1"; then
  3380. # --with-schannel implies --enable-sspi
  3381. AC_MSG_RESULT(yes)
  3382. else
  3383. AC_MSG_RESULT(no)
  3384. fi
  3385. ;;
  3386. esac ],
  3387. if test "x$SCHANNEL_ENABLED" = "x1"; then
  3388. # --with-schannel implies --enable-sspi
  3389. AC_MSG_RESULT(yes)
  3390. else
  3391. AC_MSG_RESULT(no)
  3392. fi
  3393. )
  3394. dnl ************************************************************
  3395. dnl disable cryptographic authentication
  3396. dnl
  3397. AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
  3398. AC_ARG_ENABLE(crypto-auth,
  3399. AS_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
  3400. AS_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
  3401. [ case "$enableval" in
  3402. no)
  3403. AC_MSG_RESULT(no)
  3404. AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
  3405. CURL_DISABLE_CRYPTO_AUTH=1
  3406. ;;
  3407. *) AC_MSG_RESULT(yes)
  3408. ;;
  3409. esac ],
  3410. AC_MSG_RESULT(yes)
  3411. )
  3412. dnl ************************************************************
  3413. dnl disable NTLM support
  3414. dnl
  3415. AC_MSG_CHECKING([whether to support NTLM])
  3416. AC_ARG_ENABLE(ntlm,
  3417. AS_HELP_STRING([--enable-ntlm],[Enable NTLM support])
  3418. AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]),
  3419. [ case "$enableval" in
  3420. no)
  3421. AC_MSG_RESULT(no)
  3422. AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support])
  3423. CURL_DISABLE_NTLM=1
  3424. ;;
  3425. *) AC_MSG_RESULT(yes)
  3426. ;;
  3427. esac ],
  3428. AC_MSG_RESULT(yes)
  3429. )
  3430. CURL_CHECK_OPTION_NTLM_WB
  3431. CURL_CHECK_NTLM_WB
  3432. dnl ************************************************************
  3433. dnl disable TLS-SRP authentication
  3434. dnl
  3435. AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
  3436. AC_ARG_ENABLE(tls-srp,
  3437. AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
  3438. AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
  3439. [ case "$enableval" in
  3440. no)
  3441. AC_MSG_RESULT(no)
  3442. want_tls_srp=no
  3443. ;;
  3444. *) AC_MSG_RESULT(yes)
  3445. want_tls_srp=yes
  3446. ;;
  3447. esac ],
  3448. AC_MSG_RESULT(yes)
  3449. want_tls_srp=yes
  3450. )
  3451. if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
  3452. AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
  3453. USE_TLS_SRP=1
  3454. curl_tls_srp_msg="enabled"
  3455. fi
  3456. dnl ************************************************************
  3457. dnl disable Unix domain sockets support
  3458. dnl
  3459. AC_MSG_CHECKING([whether to enable Unix domain sockets])
  3460. AC_ARG_ENABLE(unix-sockets,
  3461. AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
  3462. AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
  3463. [ case "$enableval" in
  3464. no) AC_MSG_RESULT(no)
  3465. want_unix_sockets=no
  3466. ;;
  3467. *) AC_MSG_RESULT(yes)
  3468. want_unix_sockets=yes
  3469. ;;
  3470. esac ], [
  3471. AC_MSG_RESULT(auto)
  3472. want_unix_sockets=auto
  3473. ]
  3474. )
  3475. if test "x$want_unix_sockets" != "xno"; then
  3476. AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
  3477. AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
  3478. AC_SUBST(USE_UNIX_SOCKETS, [1])
  3479. curl_unix_sockets_msg="enabled"
  3480. ], [
  3481. if test "x$want_unix_sockets" = "xyes"; then
  3482. AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
  3483. fi
  3484. ], [
  3485. #include <sys/un.h>
  3486. ])
  3487. fi
  3488. dnl ************************************************************
  3489. dnl disable cookies support
  3490. dnl
  3491. AC_MSG_CHECKING([whether to support cookies])
  3492. AC_ARG_ENABLE(cookies,
  3493. AS_HELP_STRING([--enable-cookies],[Enable cookies support])
  3494. AS_HELP_STRING([--disable-cookies],[Disable cookies support]),
  3495. [ case "$enableval" in
  3496. no)
  3497. AC_MSG_RESULT(no)
  3498. AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
  3499. ;;
  3500. *) AC_MSG_RESULT(yes)
  3501. ;;
  3502. esac ],
  3503. AC_MSG_RESULT(yes)
  3504. )
  3505. dnl ************************************************************
  3506. dnl disable socketpair
  3507. dnl
  3508. AC_MSG_CHECKING([whether to support socketpair])
  3509. AC_ARG_ENABLE(socketpair,
  3510. AS_HELP_STRING([--enable-socketpair],[Enable socketpair support])
  3511. AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
  3512. [ case "$enableval" in
  3513. no)
  3514. AC_MSG_RESULT(no)
  3515. AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
  3516. ;;
  3517. *) AC_MSG_RESULT(yes)
  3518. ;;
  3519. esac ],
  3520. AC_MSG_RESULT(yes)
  3521. )
  3522. dnl ************************************************************
  3523. dnl disable HTTP authentication support
  3524. dnl
  3525. AC_MSG_CHECKING([whether to support HTTP authentication])
  3526. AC_ARG_ENABLE(http-auth,
  3527. AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
  3528. AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
  3529. [ case "$enableval" in
  3530. no)
  3531. AC_MSG_RESULT(no)
  3532. AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
  3533. ;;
  3534. *) AC_MSG_RESULT(yes)
  3535. ;;
  3536. esac ],
  3537. AC_MSG_RESULT(yes)
  3538. )
  3539. dnl ************************************************************
  3540. dnl disable DoH support
  3541. dnl
  3542. AC_MSG_CHECKING([whether to support DoH])
  3543. AC_ARG_ENABLE(doh,
  3544. AS_HELP_STRING([--enable-doh],[Enable DoH support])
  3545. AS_HELP_STRING([--disable-doh],[Disable DoH support]),
  3546. [ case "$enableval" in
  3547. no)
  3548. AC_MSG_RESULT(no)
  3549. AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
  3550. ;;
  3551. *) AC_MSG_RESULT(yes)
  3552. ;;
  3553. esac ],
  3554. AC_MSG_RESULT(yes)
  3555. )
  3556. dnl ************************************************************
  3557. dnl disable mime API support
  3558. dnl
  3559. AC_MSG_CHECKING([whether to support the MIME API])
  3560. AC_ARG_ENABLE(mime,
  3561. AS_HELP_STRING([--enable-mime],[Enable mime API support])
  3562. AS_HELP_STRING([--disable-mime],[Disable mime API support]),
  3563. [ case "$enableval" in
  3564. no)
  3565. AC_MSG_RESULT(no)
  3566. AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
  3567. ;;
  3568. *) AC_MSG_RESULT(yes)
  3569. ;;
  3570. esac ],
  3571. AC_MSG_RESULT(yes)
  3572. )
  3573. dnl ************************************************************
  3574. dnl disable date parsing
  3575. dnl
  3576. AC_MSG_CHECKING([whether to support date parsing])
  3577. AC_ARG_ENABLE(dateparse,
  3578. AS_HELP_STRING([--enable-dateparse],[Enable date parsing])
  3579. AS_HELP_STRING([--disable-dateparse],[Disable date parsing]),
  3580. [ case "$enableval" in
  3581. no)
  3582. AC_MSG_RESULT(no)
  3583. AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
  3584. ;;
  3585. *) AC_MSG_RESULT(yes)
  3586. ;;
  3587. esac ],
  3588. AC_MSG_RESULT(yes)
  3589. )
  3590. dnl ************************************************************
  3591. dnl disable netrc
  3592. dnl
  3593. AC_MSG_CHECKING([whether to support netrc parsing])
  3594. AC_ARG_ENABLE(netrc,
  3595. AS_HELP_STRING([--enable-netrc],[Enable netrc parsing])
  3596. AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
  3597. [ case "$enableval" in
  3598. no)
  3599. AC_MSG_RESULT(no)
  3600. AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
  3601. ;;
  3602. *) AC_MSG_RESULT(yes)
  3603. ;;
  3604. esac ],
  3605. AC_MSG_RESULT(yes)
  3606. )
  3607. dnl ************************************************************
  3608. dnl disable progress-meter
  3609. dnl
  3610. AC_MSG_CHECKING([whether to support progress-meter])
  3611. AC_ARG_ENABLE(progress-meter,
  3612. AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
  3613. AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
  3614. [ case "$enableval" in
  3615. no)
  3616. AC_MSG_RESULT(no)
  3617. AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
  3618. ;;
  3619. *) AC_MSG_RESULT(yes)
  3620. ;;
  3621. esac ],
  3622. AC_MSG_RESULT(yes)
  3623. )
  3624. dnl ************************************************************
  3625. dnl disable shuffle DNS support
  3626. dnl
  3627. AC_MSG_CHECKING([whether to support DNS shuffling])
  3628. AC_ARG_ENABLE(dnsshuffle,
  3629. AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
  3630. AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
  3631. [ case "$enableval" in
  3632. no)
  3633. AC_MSG_RESULT(no)
  3634. AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
  3635. ;;
  3636. *) AC_MSG_RESULT(yes)
  3637. ;;
  3638. esac ],
  3639. AC_MSG_RESULT(yes)
  3640. )
  3641. dnl ************************************************************
  3642. dnl disable the curl_easy_options API
  3643. dnl
  3644. AC_MSG_CHECKING([whether to support curl_easy_option*])
  3645. AC_ARG_ENABLE(get-easy-options,
  3646. AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
  3647. AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
  3648. [ case "$enableval" in
  3649. no)
  3650. AC_MSG_RESULT(no)
  3651. AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
  3652. ;;
  3653. *) AC_MSG_RESULT(yes)
  3654. ;;
  3655. esac ],
  3656. AC_MSG_RESULT(yes)
  3657. )
  3658. dnl ************************************************************
  3659. dnl switch on/off alt-svc
  3660. dnl
  3661. AC_MSG_CHECKING([whether to support alt-svc])
  3662. AC_ARG_ENABLE(alt-svc,
  3663. AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
  3664. AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
  3665. [ case "$enableval" in
  3666. no)
  3667. AC_MSG_RESULT(no)
  3668. AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
  3669. curl_altsvc_msg="no";
  3670. enable_altsvc="no"
  3671. ;;
  3672. *) AC_MSG_RESULT(yes)
  3673. ;;
  3674. esac ],
  3675. AC_MSG_RESULT(yes)
  3676. )
  3677. dnl ************************************************************
  3678. dnl switch on/off headers-api
  3679. dnl
  3680. AC_MSG_CHECKING([whether to support headers-api])
  3681. AC_ARG_ENABLE(headers-api,
  3682. AS_HELP_STRING([--enable-headers-api],[Enable headers-api support])
  3683. AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]),
  3684. [ case "$enableval" in
  3685. no) AC_MSG_RESULT(no)
  3686. curl_headers_msg="no (--enable-headers-api)"
  3687. AC_DEFINE(CURL_DISABLE_HEADERS_API, 1, [disable headers-api])
  3688. ;;
  3689. *)
  3690. AC_MSG_RESULT(yes)
  3691. ;;
  3692. esac ],
  3693. AC_MSG_RESULT(yes)
  3694. )
  3695. dnl only check for HSTS if there's SSL present
  3696. if test -n "$SSL_ENABLED"; then
  3697. dnl ************************************************************
  3698. dnl switch on/off hsts
  3699. dnl
  3700. AC_MSG_CHECKING([whether to support HSTS])
  3701. AC_ARG_ENABLE(hsts,
  3702. AS_HELP_STRING([--enable-hsts],[Enable HSTS support])
  3703. AS_HELP_STRING([--disable-hsts],[Disable HSTS support]),
  3704. [ case "$enableval" in
  3705. no)
  3706. AC_MSG_RESULT(no)
  3707. hsts="no"
  3708. ;;
  3709. *) AC_MSG_RESULT(yes)
  3710. ;;
  3711. esac ],
  3712. AC_MSG_RESULT($hsts)
  3713. )
  3714. else
  3715. AC_MSG_NOTICE([disables HSTS due to lack of SSL])
  3716. hsts="no"
  3717. fi
  3718. if test "x$hsts" != "xyes"; then
  3719. curl_hsts_msg="no (--enable-hsts)";
  3720. AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc])
  3721. fi
  3722. dnl *************************************************************
  3723. dnl check whether ECH support, if desired, is actually available
  3724. dnl
  3725. if test "x$want_ech" != "xno"; then
  3726. AC_MSG_CHECKING([whether ECH support is available])
  3727. dnl assume NOT and look for sufficient condition
  3728. ECH_ENABLED=0
  3729. ECH_SUPPORT=''
  3730. dnl OpenSSL with a chosen ECH function should be enough
  3731. dnl so more exhaustive checking seems unnecessary for now
  3732. if test "x$OPENSSL_ENABLED" = "x1"; then
  3733. AC_CHECK_FUNCS(SSL_get_ech_status,
  3734. ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
  3735. ECH_ENABLED=1)
  3736. dnl add 'elif' chain here for additional implementations
  3737. fi
  3738. dnl now deal with whatever we found
  3739. if test "x$ECH_ENABLED" = "x1"; then
  3740. AC_DEFINE(USE_ECH, 1, [if ECH support is available])
  3741. AC_MSG_RESULT($ECH_SUPPORT)
  3742. experimental="$experimental ECH"
  3743. else
  3744. AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
  3745. fi
  3746. fi
  3747. dnl ************************************************************
  3748. dnl hiding of library internal symbols
  3749. dnl
  3750. CURL_CONFIGURE_SYMBOL_HIDING
  3751. dnl
  3752. dnl All the library dependencies put into $LIB apply to libcurl only.
  3753. dnl
  3754. LIBCURL_LIBS="$LIBS$PTHREAD"
  3755. AC_SUBST(LIBCURL_LIBS)
  3756. AC_SUBST(CURL_NETWORK_LIBS)
  3757. AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
  3758. dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
  3759. dnl LIBS variable used in generated makefile at makefile processing
  3760. dnl time. Doing this functionally prevents LIBS from being used for
  3761. dnl all link targets in given makefile.
  3762. BLANK_AT_MAKETIME=
  3763. AC_SUBST(BLANK_AT_MAKETIME)
  3764. AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
  3765. dnl yes or no
  3766. ENABLE_SHARED="$enable_shared"
  3767. AC_SUBST(ENABLE_SHARED)
  3768. dnl to let curl-config output the static libraries correctly
  3769. ENABLE_STATIC="$enable_static"
  3770. AC_SUBST(ENABLE_STATIC)
  3771. dnl merge the pkg-config Libs.private field into Libs when static-only
  3772. if test "x$enable_shared" = "xno"; then
  3773. LIBCURL_NO_SHARED=$LIBCURL_LIBS
  3774. else
  3775. LIBCURL_NO_SHARED=
  3776. fi
  3777. AC_SUBST(LIBCURL_NO_SHARED)
  3778. dnl
  3779. dnl For keeping supported features and protocols also in pkg-config file
  3780. dnl since it is more cross-compile friendly than curl-config
  3781. dnl
  3782. if test "x$OPENSSL_ENABLED" = "x1"; then
  3783. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  3784. elif test -n "$SSL_ENABLED"; then
  3785. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  3786. fi
  3787. if test "x$IPV6_ENABLED" = "x1"; then
  3788. SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
  3789. fi
  3790. if test "x$USE_UNIX_SOCKETS" = "x1"; then
  3791. SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
  3792. fi
  3793. if test "x$HAVE_LIBZ" = "x1"; then
  3794. SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
  3795. fi
  3796. if test "x$HAVE_BROTLI" = "x1"; then
  3797. SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
  3798. fi
  3799. if test "x$HAVE_ZSTD" = "x1"; then
  3800. SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
  3801. fi
  3802. if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
  3803. -o "x$USE_THREADS_WIN32" = "x1"; then
  3804. SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
  3805. fi
  3806. if test "x$IDN_ENABLED" = "x1"; then
  3807. SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
  3808. fi
  3809. if test "x$USE_WINDOWS_SSPI" = "x1"; then
  3810. SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
  3811. fi
  3812. if test "x$HAVE_GSSAPI" = "x1"; then
  3813. SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
  3814. fi
  3815. if test "x$curl_psl_msg" = "xenabled"; then
  3816. SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
  3817. fi
  3818. if test "x$curl_gsasl_msg" = "xenabled"; then
  3819. SUPPORT_FEATURES="$SUPPORT_FEATURES GSASL"
  3820. fi
  3821. if test "x$enable_altsvc" = "xyes"; then
  3822. SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
  3823. fi
  3824. if test "x$hsts" = "xyes"; then
  3825. SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS"
  3826. fi
  3827. if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
  3828. \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
  3829. SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
  3830. fi
  3831. if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
  3832. \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
  3833. SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
  3834. fi
  3835. use_curl_ntlm_core=no
  3836. if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
  3837. "x$CURL_DISABLE_NTLM" != "x1"; then
  3838. if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
  3839. -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
  3840. -o "x$SECURETRANSPORT_ENABLED" = "x1" \
  3841. -o "x$USE_WIN32_CRYPTO" = "x1" \
  3842. -o "x$WOLFSSL_NTLM" = "x1"; then
  3843. use_curl_ntlm_core=yes
  3844. fi
  3845. if test "x$use_curl_ntlm_core" = "xyes" \
  3846. -o "x$USE_WINDOWS_SSPI" = "x1"; then
  3847. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
  3848. if test "x$CURL_DISABLE_HTTP" != "x1" -a \
  3849. "x$NTLM_WB_ENABLED" = "x1"; then
  3850. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
  3851. fi
  3852. fi
  3853. fi
  3854. if test "x$USE_TLS_SRP" = "x1"; then
  3855. SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
  3856. fi
  3857. if test "x$USE_NGHTTP2" = "x1" -o "x$USE_HYPER" = "x1"; then
  3858. SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
  3859. fi
  3860. if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1" \
  3861. -o "x$USE_MSH3" = "x1"; then
  3862. SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
  3863. fi
  3864. if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
  3865. SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
  3866. fi
  3867. dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends
  3868. if test "x$https_proxy" != "xno"; then
  3869. if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
  3870. -o "x$NSS_ENABLED" = "x1"; then
  3871. SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
  3872. fi
  3873. fi
  3874. if test "x$ECH_ENABLED" = "x1"; then
  3875. SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
  3876. fi
  3877. if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
  3878. if test ${ac_cv_sizeof_off_t} -gt 4 -o \
  3879. "$curl_win32_file_api" = "win32_large_files"; then
  3880. SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile"
  3881. fi
  3882. fi
  3883. if test "$tst_atomic" = "yes"; then
  3884. SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
  3885. else
  3886. AC_COMPILE_IFELSE([
  3887. AC_LANG_PROGRAM([[
  3888. #include <windows.h>
  3889. ]],[[
  3890. #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
  3891. #error
  3892. #endif
  3893. ]])
  3894. ],[
  3895. SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
  3896. ],[
  3897. ])
  3898. fi
  3899. dnl replace spaces with newlines
  3900. dnl sort the lines
  3901. dnl replace the newlines back to spaces
  3902. SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
  3903. AC_SUBST(SUPPORT_FEATURES)
  3904. dnl For supported protocols in pkg-config file
  3905. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  3906. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
  3907. if test "x$SSL_ENABLED" = "x1"; then
  3908. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
  3909. fi
  3910. fi
  3911. if test "x$CURL_DISABLE_FTP" != "x1"; then
  3912. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
  3913. if test "x$SSL_ENABLED" = "x1"; then
  3914. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
  3915. fi
  3916. fi
  3917. if test "x$CURL_DISABLE_FILE" != "x1"; then
  3918. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
  3919. fi
  3920. if test "x$CURL_DISABLE_TELNET" != "x1"; then
  3921. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
  3922. fi
  3923. if test "x$CURL_DISABLE_LDAP" != "x1"; then
  3924. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
  3925. if test "x$CURL_DISABLE_LDAPS" != "x1"; then
  3926. if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
  3927. (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
  3928. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
  3929. fi
  3930. fi
  3931. fi
  3932. if test "x$CURL_DISABLE_DICT" != "x1"; then
  3933. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
  3934. fi
  3935. if test "x$CURL_DISABLE_TFTP" != "x1"; then
  3936. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
  3937. fi
  3938. if test "x$CURL_DISABLE_GOPHER" != "x1"; then
  3939. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
  3940. if test "x$SSL_ENABLED" = "x1"; then
  3941. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS"
  3942. fi
  3943. fi
  3944. if test "x$CURL_DISABLE_MQTT" != "x1"; then
  3945. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
  3946. fi
  3947. if test "x$CURL_DISABLE_POP3" != "x1"; then
  3948. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
  3949. if test "x$SSL_ENABLED" = "x1"; then
  3950. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
  3951. fi
  3952. fi
  3953. if test "x$CURL_DISABLE_IMAP" != "x1"; then
  3954. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
  3955. if test "x$SSL_ENABLED" = "x1"; then
  3956. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
  3957. fi
  3958. fi
  3959. if test "x$CURL_DISABLE_SMB" != "x1" \
  3960. -a "x$use_curl_ntlm_core" = "xyes"; then
  3961. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
  3962. if test "x$SSL_ENABLED" = "x1"; then
  3963. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
  3964. fi
  3965. fi
  3966. if test "x$CURL_DISABLE_SMTP" != "x1"; then
  3967. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
  3968. if test "x$SSL_ENABLED" = "x1"; then
  3969. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
  3970. fi
  3971. fi
  3972. if test "x$USE_LIBSSH2" = "x1"; then
  3973. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
  3974. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  3975. fi
  3976. if test "x$USE_LIBSSH" = "x1"; then
  3977. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
  3978. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  3979. fi
  3980. if test "x$USE_WOLFSSH" = "x1"; then
  3981. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  3982. fi
  3983. if test "x$CURL_DISABLE_RTSP" != "x1"; then
  3984. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
  3985. fi
  3986. if test "x$USE_LIBRTMP" = "x1"; then
  3987. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
  3988. fi
  3989. dnl replace spaces with newlines
  3990. dnl sort the lines
  3991. dnl replace the newlines back to spaces
  3992. SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
  3993. AC_SUBST(SUPPORT_PROTOCOLS)
  3994. dnl squeeze whitespace out of some variables
  3995. squeeze CFLAGS
  3996. squeeze CPPFLAGS
  3997. squeeze DEFS
  3998. squeeze LDFLAGS
  3999. squeeze LIBS
  4000. squeeze LIBCURL_LIBS
  4001. squeeze CURL_NETWORK_LIBS
  4002. squeeze CURL_NETWORK_AND_TIME_LIBS
  4003. squeeze SUPPORT_FEATURES
  4004. squeeze SUPPORT_PROTOCOLS
  4005. XC_CHECK_BUILD_FLAGS
  4006. SSL_BACKENDS=${ssl_backends}
  4007. AC_SUBST(SSL_BACKENDS)
  4008. if test "x$want_curldebug_assumed" = "xyes" &&
  4009. test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
  4010. ac_configure_args="$ac_configure_args --enable-curldebug"
  4011. fi
  4012. AC_CONFIG_FILES([Makefile \
  4013. docs/Makefile \
  4014. docs/examples/Makefile \
  4015. docs/libcurl/Makefile \
  4016. docs/libcurl/opts/Makefile \
  4017. docs/cmdline-opts/Makefile \
  4018. include/Makefile \
  4019. include/curl/Makefile \
  4020. src/Makefile \
  4021. lib/Makefile \
  4022. scripts/Makefile \
  4023. lib/libcurl.vers \
  4024. lib/libcurl.plist \
  4025. tests/Makefile \
  4026. tests/certs/Makefile \
  4027. tests/certs/scripts/Makefile \
  4028. tests/data/Makefile \
  4029. tests/server/Makefile \
  4030. tests/libtest/Makefile \
  4031. tests/unit/Makefile \
  4032. packages/Makefile \
  4033. packages/vms/Makefile \
  4034. curl-config \
  4035. libcurl.pc
  4036. ])
  4037. AC_OUTPUT
  4038. CURL_GENERATE_CONFIGUREHELP_PM
  4039. XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
  4040. AC_MSG_NOTICE([Configured to build curl/libcurl:
  4041. Host setup: ${host}
  4042. Install prefix: ${prefix}
  4043. Compiler: ${CC}
  4044. CFLAGS: ${CFLAGS}
  4045. CPPFLAGS: ${CPPFLAGS}
  4046. LDFLAGS: ${LDFLAGS}
  4047. LIBS: ${LIBS}
  4048. curl version: ${CURLVERSION}
  4049. SSL: ${curl_ssl_msg}
  4050. SSH: ${curl_ssh_msg}
  4051. zlib: ${curl_zlib_msg}
  4052. brotli: ${curl_brotli_msg}
  4053. zstd: ${curl_zstd_msg}
  4054. GSS-API: ${curl_gss_msg}
  4055. GSASL: ${curl_gsasl_msg}
  4056. TLS-SRP: ${curl_tls_srp_msg}
  4057. resolver: ${curl_res_msg}
  4058. IPv6: ${curl_ipv6_msg}
  4059. Unix sockets: ${curl_unix_sockets_msg}
  4060. IDN: ${curl_idn_msg}
  4061. Build libcurl: Shared=${enable_shared}, Static=${enable_static}
  4062. Built-in manual: ${curl_manual_msg}
  4063. --libcurl option: ${curl_libcurl_msg}
  4064. Verbose errors: ${curl_verbose_msg}
  4065. Code coverage: ${curl_coverage_msg}
  4066. SSPI: ${curl_sspi_msg}
  4067. ca cert bundle: ${ca}${ca_warning}
  4068. ca cert path: ${capath}${capath_warning}
  4069. ca fallback: ${with_ca_fallback}
  4070. LDAP: ${curl_ldap_msg}
  4071. LDAPS: ${curl_ldaps_msg}
  4072. RTSP: ${curl_rtsp_msg}
  4073. RTMP: ${curl_rtmp_msg}
  4074. PSL: ${curl_psl_msg}
  4075. Alt-svc: ${curl_altsvc_msg}
  4076. Headers API: ${curl_headers_msg}
  4077. HSTS: ${curl_hsts_msg}
  4078. HTTP1: ${curl_h1_msg}
  4079. HTTP2: ${curl_h2_msg}
  4080. HTTP3: ${curl_h3_msg}
  4081. ECH: ${curl_ech_msg}
  4082. Protocols: ${SUPPORT_PROTOCOLS}
  4083. Features: ${SUPPORT_FEATURES}
  4084. ])
  4085. if test -n "$experimental"; then
  4086. cat >&2 << _EOF
  4087. WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!
  4088. _EOF
  4089. fi