2
0

configure.ac 161 KB

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