configure.ac 147 KB

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