2
0

configure.ac 146 KB

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