configure.ac 142 KB

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