configure.ac 154 KB

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