configure.ac 158 KB

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