configure.ac 149 KB

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