configure.ac 157 KB

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