configure.ac 132 KB

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