2
0

configure.ac 155 KB

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