configure.ac 148 KB

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