configure.ac 147 KB

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