configure.ac 129 KB

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