2
0

configure.ac 148 KB

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