configure.ac 147 KB

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