configure.ac 158 KB

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