2
0

configure.ac 137 KB

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