configure.ac 128 KB

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