configure.ac 137 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776
  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 no longer works!]))
  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 **********************************************************************
  1216. dnl The preceding library checks are all potentially useful for test
  1217. dnl servers and libtest cases which require networking and clock_gettime
  1218. dnl support. Save the list of required libraries at this point for use
  1219. dnl while linking those test servers and programs.
  1220. dnl **********************************************************************
  1221. CURL_NETWORK_AND_TIME_LIBS=$LIBS
  1222. dnl **********************************************************************
  1223. dnl Check for the presence of ZLIB libraries and headers
  1224. dnl **********************************************************************
  1225. dnl Check for & handle argument to --with-zlib.
  1226. clean_CPPFLAGS=$CPPFLAGS
  1227. clean_LDFLAGS=$LDFLAGS
  1228. clean_LIBS=$LIBS
  1229. ZLIB_LIBS=""
  1230. AC_ARG_WITH(zlib,
  1231. AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
  1232. AS_HELP_STRING([--without-zlib],[disable use of zlib]),
  1233. [OPT_ZLIB="$withval"])
  1234. if test "$OPT_ZLIB" = "no" ; then
  1235. AC_MSG_WARN([zlib disabled])
  1236. else
  1237. if test "$OPT_ZLIB" = "yes" ; then
  1238. OPT_ZLIB=""
  1239. fi
  1240. if test -z "$OPT_ZLIB" ; then
  1241. CURL_CHECK_PKGCONFIG(zlib)
  1242. if test "$PKGCONFIG" != "no" ; then
  1243. LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS"
  1244. LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
  1245. CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`"
  1246. OPT_ZLIB=""
  1247. HAVE_LIBZ="1"
  1248. fi
  1249. if test -z "$HAVE_LIBZ"; then
  1250. dnl Check for the lib without setting any new path, since many
  1251. dnl people have it in the default path
  1252. AC_CHECK_LIB(z, inflateEnd,
  1253. dnl libz found, set the variable
  1254. [HAVE_LIBZ="1"
  1255. LIBS="-lz $LIBS"],
  1256. dnl if no lib found, try /usr/local
  1257. [OPT_ZLIB="/usr/local"])
  1258. fi
  1259. fi
  1260. dnl Add a nonempty path to the compiler flags
  1261. if test -n "$OPT_ZLIB"; then
  1262. CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
  1263. LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
  1264. fi
  1265. AC_CHECK_HEADER(zlib.h,
  1266. [
  1267. dnl zlib.h was found
  1268. HAVE_ZLIB_H="1"
  1269. dnl if the lib wasn't found already, try again with the new paths
  1270. if test "$HAVE_LIBZ" != "1"; then
  1271. AC_CHECK_LIB(z, gzread,
  1272. [
  1273. dnl the lib was found!
  1274. HAVE_LIBZ="1"
  1275. LIBS="-lz $LIBS"
  1276. ],
  1277. [ CPPFLAGS=$clean_CPPFLAGS
  1278. LDFLAGS=$clean_LDFLAGS])
  1279. fi
  1280. ],
  1281. [
  1282. dnl zlib.h was not found, restore the flags
  1283. CPPFLAGS=$clean_CPPFLAGS
  1284. LDFLAGS=$clean_LDFLAGS]
  1285. )
  1286. if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
  1287. then
  1288. AC_MSG_WARN([configure found only the libz lib, not the header file!])
  1289. HAVE_LIBZ=""
  1290. CPPFLAGS=$clean_CPPFLAGS
  1291. LDFLAGS=$clean_LDFLAGS
  1292. LIBS=$clean_LIBS
  1293. elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
  1294. then
  1295. AC_MSG_WARN([configure found only the libz header file, not the lib!])
  1296. CPPFLAGS=$clean_CPPFLAGS
  1297. LDFLAGS=$clean_LDFLAGS
  1298. LIBS=$clean_LIBS
  1299. elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
  1300. then
  1301. dnl both header and lib were found!
  1302. AC_SUBST(HAVE_LIBZ)
  1303. AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
  1304. ZLIB_LIBS="-lz"
  1305. LIBS="-lz $clean_LIBS"
  1306. dnl replace 'HAVE_LIBZ' in the automake makefile.ams
  1307. AMFIXLIB="1"
  1308. AC_MSG_NOTICE([found both libz and libz.h header])
  1309. curl_zlib_msg="enabled"
  1310. fi
  1311. fi
  1312. dnl set variable for use in automakefile(s)
  1313. AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
  1314. AC_SUBST(ZLIB_LIBS)
  1315. dnl **********************************************************************
  1316. dnl Check for the presence of BROTLI decoder libraries and headers
  1317. dnl **********************************************************************
  1318. dnl Brotli project home page: https://github.com/google/brotli
  1319. dnl Default to compiler & linker defaults for BROTLI files & libraries.
  1320. OPT_BROTLI=off
  1321. AC_ARG_WITH(brotli,dnl
  1322. 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])
  1323. AS_HELP_STRING([--without-brotli], [disable BROTLI]),
  1324. OPT_BROTLI=$withval)
  1325. if test X"$OPT_BROTLI" != Xno; then
  1326. dnl backup the pre-brotli variables
  1327. CLEANLDFLAGS="$LDFLAGS"
  1328. CLEANCPPFLAGS="$CPPFLAGS"
  1329. CLEANLIBS="$LIBS"
  1330. case "$OPT_BROTLI" in
  1331. yes)
  1332. dnl --with-brotli (without path) used
  1333. CURL_CHECK_PKGCONFIG(libbrotlidec)
  1334. if test "$PKGCONFIG" != "no" ; then
  1335. LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
  1336. LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
  1337. CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
  1338. version=`$PKGCONFIG --modversion libbrotlidec`
  1339. DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`
  1340. fi
  1341. ;;
  1342. off)
  1343. dnl no --with-brotli option given, just check default places
  1344. ;;
  1345. *)
  1346. dnl use the given --with-brotli spot
  1347. PREFIX_BROTLI=$OPT_BROTLI
  1348. ;;
  1349. esac
  1350. dnl if given with a prefix, we set -L and -I based on that
  1351. if test -n "$PREFIX_BROTLI"; then
  1352. LIB_BROTLI="-lbrotlidec"
  1353. LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
  1354. CPP_BROTLI=-I${PREFIX_BROTLI}/include
  1355. DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
  1356. fi
  1357. LDFLAGS="$LDFLAGS $LD_BROTLI"
  1358. CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
  1359. LIBS="$LIB_BROTLI $LIBS"
  1360. AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
  1361. AC_CHECK_HEADERS(brotli/decode.h,
  1362. curl_brotli_msg="enabled (libbrotlidec)"
  1363. HAVE_BROTLI=1
  1364. AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
  1365. AC_SUBST(HAVE_BROTLI, [1])
  1366. )
  1367. if test X"$OPT_BROTLI" != Xoff &&
  1368. test "$HAVE_BROTLI" != "1"; then
  1369. AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
  1370. fi
  1371. if test "$HAVE_BROTLI" = "1"; then
  1372. if test -n "$DIR_BROTLI"; then
  1373. dnl when the brotli shared libs were found in a path that the run-time
  1374. dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
  1375. dnl to prevent further configure tests to fail due to this
  1376. if test "x$cross_compiling" != "xyes"; then
  1377. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
  1378. export CURL_LIBRARY_PATH
  1379. AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
  1380. fi
  1381. fi
  1382. else
  1383. dnl no brotli, revert back to clean variables
  1384. LDFLAGS=$CLEANLDFLAGS
  1385. CPPFLAGS=$CLEANCPPFLAGS
  1386. LIBS=$CLEANLIBS
  1387. fi
  1388. fi
  1389. dnl **********************************************************************
  1390. dnl Check for libzstd
  1391. dnl **********************************************************************
  1392. dnl Default to compiler & linker defaults for libzstd
  1393. OPT_ZSTD=off
  1394. AC_ARG_WITH(zstd,dnl
  1395. 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])
  1396. AS_HELP_STRING([--without-zstd], [disable libzstd]),
  1397. OPT_ZSTD=$withval)
  1398. if test X"$OPT_ZSTD" != Xno; then
  1399. dnl backup the pre-zstd variables
  1400. CLEANLDFLAGS="$LDFLAGS"
  1401. CLEANCPPFLAGS="$CPPFLAGS"
  1402. CLEANLIBS="$LIBS"
  1403. case "$OPT_ZSTD" in
  1404. yes)
  1405. dnl --with-zstd (without path) used
  1406. CURL_CHECK_PKGCONFIG(libzstd)
  1407. if test "$PKGCONFIG" != "no" ; then
  1408. LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd`
  1409. LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd`
  1410. CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd`
  1411. version=`$PKGCONFIG --modversion libzstd`
  1412. DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'`
  1413. fi
  1414. ;;
  1415. off)
  1416. dnl no --with-zstd option given, just check default places
  1417. ;;
  1418. *)
  1419. dnl use the given --with-zstd spot
  1420. PREFIX_ZSTD=$OPT_ZSTD
  1421. ;;
  1422. esac
  1423. dnl if given with a prefix, we set -L and -I based on that
  1424. if test -n "$PREFIX_ZSTD"; then
  1425. LIB_ZSTD="-lzstd"
  1426. LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff
  1427. CPP_ZSTD=-I${PREFIX_ZSTD}/include
  1428. DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff
  1429. fi
  1430. LDFLAGS="$LDFLAGS $LD_ZSTD"
  1431. CPPFLAGS="$CPPFLAGS $CPP_ZSTD"
  1432. LIBS="$LIB_ZSTD $LIBS"
  1433. AC_CHECK_LIB(zstd, ZSTD_createDStream)
  1434. AC_CHECK_HEADERS(zstd.h,
  1435. curl_zstd_msg="enabled (libzstd)"
  1436. HAVE_ZSTD=1
  1437. AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use])
  1438. AC_SUBST(HAVE_ZSTD, [1])
  1439. )
  1440. if test X"$OPT_ZSTD" != Xoff &&
  1441. test "$HAVE_ZSTD" != "1"; then
  1442. AC_MSG_ERROR([libzstd was not found where specified!])
  1443. fi
  1444. if test "$HAVE_ZSTD" = "1"; then
  1445. if test -n "$DIR_ZSTD"; then
  1446. dnl when the zstd shared lib were found in a path that the run-time
  1447. dnl linker doesn't search through, we need to add it to
  1448. dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
  1449. dnl this
  1450. if test "x$cross_compiling" != "xyes"; then
  1451. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD"
  1452. export CURL_LIBRARY_PATH
  1453. AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH])
  1454. fi
  1455. fi
  1456. else
  1457. dnl no zstd, revert back to clean variables
  1458. LDFLAGS=$CLEANLDFLAGS
  1459. CPPFLAGS=$CLEANCPPFLAGS
  1460. LIBS=$CLEANLIBS
  1461. fi
  1462. fi
  1463. dnl **********************************************************************
  1464. dnl Check for LDAP
  1465. dnl **********************************************************************
  1466. LDAPLIBNAME=""
  1467. AC_ARG_WITH(ldap-lib,
  1468. AS_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
  1469. [LDAPLIBNAME="$withval"])
  1470. LBERLIBNAME=""
  1471. AC_ARG_WITH(lber-lib,
  1472. AS_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
  1473. [LBERLIBNAME="$withval"])
  1474. if test x$CURL_DISABLE_LDAP != x1 ; then
  1475. CURL_CHECK_HEADER_LBER
  1476. CURL_CHECK_HEADER_LDAP
  1477. CURL_CHECK_HEADER_LDAP_SSL
  1478. if test -z "$LDAPLIBNAME" ; then
  1479. if test "$curl_cv_native_windows" = "yes"; then
  1480. dnl Windows uses a single and unique LDAP library name
  1481. LDAPLIBNAME="wldap32"
  1482. LBERLIBNAME="no"
  1483. fi
  1484. fi
  1485. if test "$LDAPLIBNAME" ; then
  1486. AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
  1487. if test -n "$ldap_askedfor"; then
  1488. AC_MSG_ERROR([couldn't detect the LDAP libraries])
  1489. fi
  1490. AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
  1491. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  1492. AC_SUBST(CURL_DISABLE_LDAP, [1])
  1493. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  1494. AC_SUBST(CURL_DISABLE_LDAPS, [1])])
  1495. else
  1496. dnl Try to find the right ldap libraries for this system
  1497. CURL_CHECK_LIBS_LDAP
  1498. case X-"$curl_cv_ldap_LIBS" in
  1499. X-unknown)
  1500. if test -n "$ldap_askedfor"; then
  1501. AC_MSG_ERROR([couldn't detect the LDAP libraries])
  1502. fi
  1503. AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
  1504. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  1505. AC_SUBST(CURL_DISABLE_LDAP, [1])
  1506. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  1507. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  1508. ;;
  1509. esac
  1510. fi
  1511. fi
  1512. if test x$CURL_DISABLE_LDAP != x1 ; then
  1513. if test "$LBERLIBNAME" ; then
  1514. dnl If name is "no" then don't define this library at all
  1515. dnl (it's only needed if libldap.so's dependencies are broken).
  1516. if test "$LBERLIBNAME" != "no" ; then
  1517. AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
  1518. AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
  1519. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  1520. AC_SUBST(CURL_DISABLE_LDAP, [1])
  1521. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  1522. AC_SUBST(CURL_DISABLE_LDAPS, [1])])
  1523. fi
  1524. fi
  1525. fi
  1526. if test x$CURL_DISABLE_LDAP != x1 ; then
  1527. AC_CHECK_FUNCS([ldap_url_parse])
  1528. if test "$LDAPLIBNAME" = "wldap32"; then
  1529. curl_ldap_msg="enabled (winldap)"
  1530. AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
  1531. else
  1532. curl_ldap_msg="enabled (OpenLDAP)"
  1533. if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
  1534. AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
  1535. AC_SUBST(USE_OPENLDAP, [1])
  1536. fi
  1537. fi
  1538. fi
  1539. if test x$CURL_DISABLE_LDAPS != x1 ; then
  1540. curl_ldaps_msg="enabled"
  1541. fi
  1542. dnl **********************************************************************
  1543. dnl Checks for IPv6
  1544. dnl **********************************************************************
  1545. AC_MSG_CHECKING([whether to enable IPv6])
  1546. AC_ARG_ENABLE(ipv6,
  1547. AS_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
  1548. AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
  1549. [ case "$enableval" in
  1550. no)
  1551. AC_MSG_RESULT(no)
  1552. ipv6=no
  1553. ;;
  1554. *) AC_MSG_RESULT(yes)
  1555. ipv6=yes
  1556. ;;
  1557. esac ],
  1558. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  1559. /* are AF_INET6 and sockaddr_in6 available? */
  1560. #include <sys/types.h>
  1561. #ifdef HAVE_WINSOCK2_H
  1562. #include <winsock2.h>
  1563. #include <ws2tcpip.h>
  1564. #else
  1565. #include <sys/socket.h>
  1566. #include <netinet/in.h>
  1567. #if defined (__TANDEM)
  1568. # include <netinet/in6.h>
  1569. #endif
  1570. #endif
  1571. #include <stdlib.h> /* for exit() */
  1572. main()
  1573. {
  1574. struct sockaddr_in6 s;
  1575. (void)s;
  1576. if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
  1577. exit(1);
  1578. else
  1579. exit(0);
  1580. }
  1581. ]])
  1582. ],
  1583. AC_MSG_RESULT(yes)
  1584. ipv6=yes,
  1585. AC_MSG_RESULT(no)
  1586. ipv6=no,
  1587. AC_MSG_RESULT(yes)
  1588. ipv6=yes
  1589. ))
  1590. if test "$ipv6" = yes; then
  1591. curl_ipv6_msg="enabled"
  1592. AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
  1593. IPV6_ENABLED=1
  1594. AC_SUBST(IPV6_ENABLED)
  1595. AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
  1596. AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
  1597. #include <sys/types.h>
  1598. #ifdef HAVE_WINSOCK2_H
  1599. #include <winsock2.h>
  1600. #include <ws2tcpip.h>
  1601. #else
  1602. #include <netinet/in.h>
  1603. #if defined (__TANDEM)
  1604. # include <netinet/in6.h>
  1605. #endif
  1606. #endif
  1607. ]], [[
  1608. struct sockaddr_in6 s;
  1609. s.sin6_scope_id = 0;
  1610. ]])], [
  1611. AC_MSG_RESULT([yes])
  1612. AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
  1613. ], [
  1614. AC_MSG_RESULT([no])
  1615. ])
  1616. fi
  1617. dnl **********************************************************************
  1618. dnl Check if the operating system allows programs to write to their own argv[]
  1619. dnl **********************************************************************
  1620. AC_MSG_CHECKING([if argv can be written to])
  1621. CURL_RUN_IFELSE([[
  1622. int main(int argc, char **argv)
  1623. {
  1624. #ifdef _WIN32
  1625. /* on Windows, writing to the argv does not hide the argument in
  1626. process lists so it can just be skipped */
  1627. (void)argc;
  1628. (void)argv;
  1629. return 1;
  1630. #else
  1631. (void)argc;
  1632. argv[0][0] = ' ';
  1633. return (argv[0][0] == ' ')?0:1;
  1634. #endif
  1635. }
  1636. ]],[
  1637. curl_cv_writable_argv=yes
  1638. ],[
  1639. curl_cv_writable_argv=no
  1640. ],[
  1641. curl_cv_writable_argv=cross
  1642. ])
  1643. case $curl_cv_writable_argv in
  1644. yes)
  1645. AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
  1646. AC_MSG_RESULT(yes)
  1647. ;;
  1648. no)
  1649. AC_MSG_RESULT(no)
  1650. ;;
  1651. *)
  1652. AC_MSG_RESULT(no)
  1653. AC_MSG_WARN([the previous check could not be made default was used])
  1654. ;;
  1655. esac
  1656. dnl **********************************************************************
  1657. dnl Check for GSS-API libraries
  1658. dnl **********************************************************************
  1659. dnl check for GSS-API stuff in the /usr as default
  1660. GSSAPI_ROOT="/usr"
  1661. AC_ARG_WITH(gssapi-includes,
  1662. AS_HELP_STRING([--with-gssapi-includes=DIR],
  1663. [Specify location of GSS-API headers]),
  1664. [ GSSAPI_INCS="-I$withval"
  1665. want_gss="yes" ]
  1666. )
  1667. AC_ARG_WITH(gssapi-libs,
  1668. AS_HELP_STRING([--with-gssapi-libs=DIR],
  1669. [Specify location of GSS-API libs]),
  1670. [ GSSAPI_LIB_DIR="-L$withval"
  1671. want_gss="yes" ]
  1672. )
  1673. AC_ARG_WITH(gssapi,
  1674. AS_HELP_STRING([--with-gssapi=DIR],
  1675. [Where to look for GSS-API]), [
  1676. GSSAPI_ROOT="$withval"
  1677. if test x"$GSSAPI_ROOT" != xno; then
  1678. want_gss="yes"
  1679. if test x"$GSSAPI_ROOT" = xyes; then
  1680. dnl if yes, then use default root
  1681. GSSAPI_ROOT="/usr"
  1682. fi
  1683. fi
  1684. ])
  1685. : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
  1686. save_CPPFLAGS="$CPPFLAGS"
  1687. AC_MSG_CHECKING([if GSS-API support is requested])
  1688. if test x"$want_gss" = xyes; then
  1689. AC_MSG_RESULT(yes)
  1690. if test $GSSAPI_ROOT != "/usr"; then
  1691. CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
  1692. else
  1693. CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
  1694. fi
  1695. if test -z "$GSSAPI_INCS"; then
  1696. if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
  1697. GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
  1698. elif test "$PKGCONFIG" != "no" ; then
  1699. GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi`
  1700. elif test -f "$KRB5CONFIG"; then
  1701. GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
  1702. elif test "$GSSAPI_ROOT" != "yes"; then
  1703. GSSAPI_INCS="-I$GSSAPI_ROOT/include"
  1704. fi
  1705. fi
  1706. CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
  1707. AC_CHECK_HEADER(gss.h,
  1708. [
  1709. dnl found in the given dirs
  1710. AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
  1711. gnu_gss=yes
  1712. ],
  1713. [
  1714. dnl not found, check Heimdal or MIT
  1715. AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
  1716. AC_CHECK_HEADERS(
  1717. [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
  1718. [],
  1719. [not_mit=1],
  1720. [
  1721. AC_INCLUDES_DEFAULT
  1722. #ifdef HAVE_GSSAPI_GSSAPI_H
  1723. #include <gssapi/gssapi.h>
  1724. #endif
  1725. ])
  1726. if test "x$not_mit" = "x1"; then
  1727. dnl MIT not found, check for Heimdal
  1728. AC_CHECK_HEADER(gssapi.h,
  1729. [
  1730. dnl found
  1731. AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
  1732. ],
  1733. [
  1734. dnl no header found, disabling GSS
  1735. want_gss=no
  1736. AC_MSG_WARN(disabling GSS-API support since no header files were found)
  1737. ]
  1738. )
  1739. else
  1740. dnl MIT found
  1741. AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
  1742. dnl check if we have a really old MIT Kerberos version (<= 1.2)
  1743. AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
  1744. AC_COMPILE_IFELSE([
  1745. AC_LANG_PROGRAM([[
  1746. #include <gssapi/gssapi.h>
  1747. #include <gssapi/gssapi_generic.h>
  1748. #include <gssapi/gssapi_krb5.h>
  1749. ]],[[
  1750. gss_import_name(
  1751. (OM_uint32 *)0,
  1752. (gss_buffer_t)0,
  1753. GSS_C_NT_HOSTBASED_SERVICE,
  1754. (gss_name_t *)0);
  1755. ]])
  1756. ],[
  1757. AC_MSG_RESULT([yes])
  1758. ],[
  1759. AC_MSG_RESULT([no])
  1760. AC_DEFINE(HAVE_OLD_GSSMIT, 1,
  1761. [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
  1762. ])
  1763. fi
  1764. ]
  1765. )
  1766. else
  1767. AC_MSG_RESULT(no)
  1768. fi
  1769. if test x"$want_gss" = xyes; then
  1770. AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
  1771. HAVE_GSSAPI=1
  1772. curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
  1773. if test -n "$gnu_gss"; then
  1774. curl_gss_msg="enabled (GNU GSS)"
  1775. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1776. LIBS="-lgss $LIBS"
  1777. elif test -z "$GSSAPI_LIB_DIR"; then
  1778. case $host in
  1779. *-*-darwin*)
  1780. LIBS="-lgssapi_krb5 -lresolv $LIBS"
  1781. ;;
  1782. *)
  1783. if test $GSSAPI_ROOT != "/usr"; then
  1784. CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
  1785. else
  1786. CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
  1787. fi
  1788. if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
  1789. dnl krb5-config doesn't have --libs-only-L or similar, put everything
  1790. dnl into LIBS
  1791. gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
  1792. LIBS="$gss_libs $LIBS"
  1793. elif test "$PKGCONFIG" != "no" ; then
  1794. gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
  1795. LIBS="$gss_libs $LIBS"
  1796. elif test -f "$KRB5CONFIG"; then
  1797. dnl krb5-config doesn't have --libs-only-L or similar, put everything
  1798. dnl into LIBS
  1799. gss_libs=`$KRB5CONFIG --libs gssapi`
  1800. LIBS="$gss_libs $LIBS"
  1801. else
  1802. case $host in
  1803. *-hp-hpux*)
  1804. gss_libname="gss"
  1805. ;;
  1806. *)
  1807. gss_libname="gssapi"
  1808. ;;
  1809. esac
  1810. if test "$GSSAPI_ROOT" != "yes"; then
  1811. LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
  1812. LIBS="-l$gss_libname $LIBS"
  1813. else
  1814. LIBS="-l$gss_libname $LIBS"
  1815. fi
  1816. fi
  1817. ;;
  1818. esac
  1819. else
  1820. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1821. case $host in
  1822. *-hp-hpux*)
  1823. LIBS="-lgss $LIBS"
  1824. ;;
  1825. *)
  1826. LIBS="-lgssapi $LIBS"
  1827. ;;
  1828. esac
  1829. fi
  1830. else
  1831. CPPFLAGS="$save_CPPFLAGS"
  1832. fi
  1833. if test x"$want_gss" = xyes; then
  1834. AC_MSG_CHECKING([if we can link against GSS-API library])
  1835. AC_LINK_IFELSE([
  1836. AC_LANG_FUNC_LINK_TRY([gss_init_sec_context])
  1837. ],[
  1838. AC_MSG_RESULT([yes])
  1839. ],[
  1840. AC_MSG_RESULT([no])
  1841. AC_MSG_ERROR([--with-gssapi was specified, but a GSS-API library was not found.])
  1842. ])
  1843. fi
  1844. build_libstubgss=no
  1845. if test x"$want_gss" = "xyes"; then
  1846. build_libstubgss=yes
  1847. fi
  1848. AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
  1849. dnl -------------------------------------------------------------
  1850. dnl parse --with-default-ssl-backend so it can be validated below
  1851. dnl -------------------------------------------------------------
  1852. DEFAULT_SSL_BACKEND=no
  1853. VALID_DEFAULT_SSL_BACKEND=
  1854. AC_ARG_WITH(default-ssl-backend,
  1855. AS_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
  1856. AS_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
  1857. [DEFAULT_SSL_BACKEND=$withval])
  1858. case "$DEFAULT_SSL_BACKEND" in
  1859. no)
  1860. dnl --without-default-ssl-backend option used
  1861. ;;
  1862. default|yes)
  1863. dnl --with-default-ssl-backend option used without name
  1864. AC_MSG_ERROR([The name of the default SSL backend is required.])
  1865. ;;
  1866. *)
  1867. dnl --with-default-ssl-backend option used with name
  1868. AC_SUBST(DEFAULT_SSL_BACKEND)
  1869. dnl needs to be validated below
  1870. VALID_DEFAULT_SSL_BACKEND=no
  1871. ;;
  1872. esac
  1873. CURL_WITH_SCHANNEL
  1874. CURL_WITH_SECURETRANSPORT
  1875. CURL_WITH_AMISSL
  1876. CURL_WITH_OPENSSL
  1877. CURL_WITH_GNUTLS
  1878. CURL_WITH_MBEDTLS
  1879. CURL_WITH_WOLFSSL
  1880. CURL_WITH_BEARSSL
  1881. CURL_WITH_RUSTLS
  1882. CURL_WITH_NSS
  1883. dnl link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL
  1884. if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$USE_SCHANNEL" = "x1"; then
  1885. LIBS="-ladvapi32 -lcrypt32 $LIBS"
  1886. fi
  1887. dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer)
  1888. if test "x$curl_cv_native_windows" = "xyes" &&
  1889. test "x$curl_mingw_original" = "xno"; then
  1890. LIBS="-lbcrypt $LIBS"
  1891. fi
  1892. case "x$SSL_DISABLED$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$BEARSSL_ENABLED$RUSTLS_ENABLED"
  1893. in
  1894. x)
  1895. AC_MSG_ERROR([TLS not detected, you will not be able to use HTTPS, FTPS, NTLM and more.
  1896. 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.])
  1897. ;;
  1898. x1)
  1899. # one SSL backend is enabled
  1900. AC_SUBST(SSL_ENABLED)
  1901. SSL_ENABLED="1"
  1902. AC_MSG_NOTICE([built with one SSL backend])
  1903. ;;
  1904. xD)
  1905. # explicitly built without TLS
  1906. ;;
  1907. xD*)
  1908. AC_MSG_ERROR([--without-ssl has been set together with an explicit option to use an ssl library
  1909. (e.g. --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-nss, --with-schannel, --with-secure-transport, --with-amissl, --with-bearssl, --with-rustls).
  1910. Since these are conflicting parameters, verify which is the desired one and drop the other.])
  1911. ;;
  1912. *)
  1913. # more than one SSL backend is enabled
  1914. AC_SUBST(SSL_ENABLED)
  1915. SSL_ENABLED="1"
  1916. AC_SUBST(CURL_WITH_MULTI_SSL)
  1917. CURL_WITH_MULTI_SSL="1"
  1918. AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
  1919. AC_MSG_NOTICE([built with multiple SSL backends])
  1920. ;;
  1921. esac
  1922. if test -n "$ssl_backends"; then
  1923. curl_ssl_msg="enabled ($ssl_backends)"
  1924. fi
  1925. if test no = "$VALID_DEFAULT_SSL_BACKEND"
  1926. then
  1927. if test -n "$SSL_ENABLED"
  1928. then
  1929. AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
  1930. else
  1931. AC_MSG_ERROR([Default SSL backend requires SSL!])
  1932. fi
  1933. elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
  1934. then
  1935. AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
  1936. fi
  1937. dnl **********************************************************************
  1938. dnl Check for the CA bundle
  1939. dnl **********************************************************************
  1940. if test -n "$check_for_ca_bundle"; then
  1941. CURL_CHECK_CA_BUNDLE
  1942. fi
  1943. dnl **********************************************************************
  1944. dnl Check for libpsl
  1945. dnl **********************************************************************
  1946. AC_ARG_WITH(libpsl,
  1947. AS_HELP_STRING([--without-libpsl],
  1948. [disable support for libpsl cookie checking]),
  1949. with_libpsl=$withval,
  1950. with_libpsl=yes)
  1951. if test $with_libpsl != "no"; then
  1952. AC_SEARCH_LIBS(psl_builtin, psl,
  1953. [curl_psl_msg="enabled";
  1954. AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
  1955. ],
  1956. [curl_psl_msg="no (libpsl not found)";
  1957. AC_MSG_WARN([libpsl was not found])
  1958. ]
  1959. )
  1960. fi
  1961. AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
  1962. dnl **********************************************************************
  1963. dnl Check for libgsasl
  1964. dnl **********************************************************************
  1965. AC_ARG_WITH(libgsasl,
  1966. AS_HELP_STRING([--without-libgsasl],
  1967. [disable libgsasl support for SCRAM]),
  1968. with_libgsasl=$withval,
  1969. with_libgsasl=yes)
  1970. if test $with_libgsasl != "no"; then
  1971. AC_SEARCH_LIBS(gsasl_init, gsasl,
  1972. [curl_gsasl_msg="enabled";
  1973. AC_DEFINE([USE_GSASL], [1], [GSASL support enabled])
  1974. ],
  1975. [curl_gsasl_msg="no (libgsasl not found)";
  1976. AC_MSG_WARN([libgsasl was not found])
  1977. ]
  1978. )
  1979. fi
  1980. AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"])
  1981. AC_ARG_WITH(libmetalink,,
  1982. AC_MSG_ERROR([--with-libmetalink no longer works!]))
  1983. dnl **********************************************************************
  1984. dnl Check for the presence of LIBSSH2 libraries and headers
  1985. dnl **********************************************************************
  1986. dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
  1987. OPT_LIBSSH2=off
  1988. AC_ARG_WITH(libssh2,dnl
  1989. 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])
  1990. AS_HELP_STRING([--with-libssh2], [enable libssh2]),
  1991. OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
  1992. OPT_LIBSSH=off
  1993. AC_ARG_WITH(libssh,dnl
  1994. 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])
  1995. AS_HELP_STRING([--with-libssh], [enable libssh]),
  1996. OPT_LIBSSH=$withval, OPT_LIBSSH=no)
  1997. OPT_WOLFSSH=off
  1998. AC_ARG_WITH(wolfssh,dnl
  1999. 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])
  2000. AS_HELP_STRING([--with-wolfssh], [enable wolfssh]),
  2001. OPT_WOLFSSH=$withval, OPT_WOLFSSH=no)
  2002. if test X"$OPT_LIBSSH2" != Xno; then
  2003. dnl backup the pre-libssh2 variables
  2004. CLEANLDFLAGS="$LDFLAGS"
  2005. CLEANCPPFLAGS="$CPPFLAGS"
  2006. CLEANLIBS="$LIBS"
  2007. case "$OPT_LIBSSH2" in
  2008. yes)
  2009. dnl --with-libssh2 (without path) used
  2010. CURL_CHECK_PKGCONFIG(libssh2)
  2011. if test "$PKGCONFIG" != "no" ; then
  2012. LIB_SSH2=`$PKGCONFIG --libs libssh2`
  2013. LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
  2014. CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
  2015. version=`$PKGCONFIG --modversion libssh2`
  2016. DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'`
  2017. fi
  2018. ;;
  2019. off)
  2020. dnl no --with-libssh2 option given, just check default places
  2021. ;;
  2022. *)
  2023. dnl use the given --with-libssh2 spot
  2024. PREFIX_SSH2=$OPT_LIBSSH2
  2025. ;;
  2026. esac
  2027. dnl if given with a prefix, we set -L and -I based on that
  2028. if test -n "$PREFIX_SSH2"; then
  2029. LIB_SSH2="-lssh2"
  2030. LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
  2031. CPP_SSH2=-I${PREFIX_SSH2}/include
  2032. DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
  2033. fi
  2034. LDFLAGS="$LDFLAGS $LD_SSH2"
  2035. CPPFLAGS="$CPPFLAGS $CPP_SSH2"
  2036. LIBS="$LIB_SSH2 $LIBS"
  2037. dnl check for function added in libssh2 version 1.0
  2038. AC_CHECK_LIB(ssh2, libssh2_session_block_directions)
  2039. AC_CHECK_HEADER(libssh2.h,
  2040. curl_ssh_msg="enabled (libSSH2)"
  2041. LIBSSH2_ENABLED=1
  2042. AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
  2043. AC_SUBST(USE_LIBSSH2, [1])
  2044. )
  2045. if test X"$OPT_LIBSSH2" != Xoff &&
  2046. test "$LIBSSH2_ENABLED" != "1"; then
  2047. AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
  2048. fi
  2049. if test "$LIBSSH2_ENABLED" = "1"; then
  2050. if test -n "$DIR_SSH2"; then
  2051. dnl when the libssh2 shared libs were found in a path that the run-time
  2052. dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
  2053. dnl to prevent further configure tests to fail due to this
  2054. if test "x$cross_compiling" != "xyes"; then
  2055. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
  2056. export CURL_LIBRARY_PATH
  2057. AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
  2058. fi
  2059. fi
  2060. else
  2061. dnl no libssh2, revert back to clean variables
  2062. LDFLAGS=$CLEANLDFLAGS
  2063. CPPFLAGS=$CLEANCPPFLAGS
  2064. LIBS=$CLEANLIBS
  2065. fi
  2066. elif test X"$OPT_LIBSSH" != Xno; then
  2067. dnl backup the pre-libssh variables
  2068. CLEANLDFLAGS="$LDFLAGS"
  2069. CLEANCPPFLAGS="$CPPFLAGS"
  2070. CLEANLIBS="$LIBS"
  2071. case "$OPT_LIBSSH" in
  2072. yes)
  2073. dnl --with-libssh (without path) used
  2074. CURL_CHECK_PKGCONFIG(libssh)
  2075. if test "$PKGCONFIG" != "no" ; then
  2076. LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
  2077. LD_SSH=`$PKGCONFIG --libs-only-L libssh`
  2078. CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
  2079. version=`$PKGCONFIG --modversion libssh`
  2080. DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'`
  2081. fi
  2082. ;;
  2083. off)
  2084. dnl no --with-libssh option given, just check default places
  2085. ;;
  2086. *)
  2087. dnl use the given --with-libssh spot
  2088. PREFIX_SSH=$OPT_LIBSSH
  2089. ;;
  2090. esac
  2091. dnl if given with a prefix, we set -L and -I based on that
  2092. if test -n "$PREFIX_SSH"; then
  2093. LIB_SSH="-lssh"
  2094. LD_SSH=-L${PREFIX_SSH}/lib$libsuff
  2095. CPP_SSH=-I${PREFIX_SSH}/include
  2096. DIR_SSH=${PREFIX_SSH}/lib$libsuff
  2097. fi
  2098. LDFLAGS="$LDFLAGS $LD_SSH"
  2099. CPPFLAGS="$CPPFLAGS $CPP_SSH"
  2100. LIBS="$LIB_SSH $LIBS"
  2101. AC_CHECK_LIB(ssh, ssh_new)
  2102. AC_CHECK_HEADER(libssh/libssh.h,
  2103. curl_ssh_msg="enabled (libSSH)"
  2104. LIBSSH_ENABLED=1
  2105. AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
  2106. AC_SUBST(USE_LIBSSH, [1])
  2107. )
  2108. if test X"$OPT_LIBSSH" != Xoff &&
  2109. test "$LIBSSH_ENABLED" != "1"; then
  2110. AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
  2111. fi
  2112. if test "$LIBSSH_ENABLED" = "1"; then
  2113. if test -n "$DIR_SSH"; then
  2114. dnl when the libssh shared libs were found in a path that the run-time
  2115. dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
  2116. dnl to prevent further configure tests to fail due to this
  2117. if test "x$cross_compiling" != "xyes"; then
  2118. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
  2119. export CURL_LIBRARY_PATH
  2120. AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
  2121. fi
  2122. fi
  2123. else
  2124. dnl no libssh, revert back to clean variables
  2125. LDFLAGS=$CLEANLDFLAGS
  2126. CPPFLAGS=$CLEANCPPFLAGS
  2127. LIBS=$CLEANLIBS
  2128. fi
  2129. elif test X"$OPT_WOLFSSH" != Xno; then
  2130. dnl backup the pre-wolfssh variables
  2131. CLEANLDFLAGS="$LDFLAGS"
  2132. CLEANCPPFLAGS="$CPPFLAGS"
  2133. CLEANLIBS="$LIBS"
  2134. if test "$OPT_WOLFSSH" != yes; then
  2135. WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config"
  2136. LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`"
  2137. CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`"
  2138. fi
  2139. AC_CHECK_LIB(wolfssh, wolfSSH_Init)
  2140. AC_CHECK_HEADERS(wolfssh/ssh.h,
  2141. curl_ssh_msg="enabled (wolfSSH)"
  2142. WOLFSSH_ENABLED=1
  2143. AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use])
  2144. AC_SUBST(USE_WOLFSSH, [1])
  2145. )
  2146. fi
  2147. dnl **********************************************************************
  2148. dnl Check for the presence of LIBRTMP libraries and headers
  2149. dnl **********************************************************************
  2150. dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
  2151. OPT_LIBRTMP=off
  2152. AC_ARG_WITH(librtmp,dnl
  2153. 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])
  2154. AS_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
  2155. OPT_LIBRTMP=$withval)
  2156. if test X"$OPT_LIBRTMP" != Xno; then
  2157. dnl backup the pre-librtmp variables
  2158. CLEANLDFLAGS="$LDFLAGS"
  2159. CLEANCPPFLAGS="$CPPFLAGS"
  2160. CLEANLIBS="$LIBS"
  2161. case "$OPT_LIBRTMP" in
  2162. yes)
  2163. dnl --with-librtmp (without path) used
  2164. CURL_CHECK_PKGCONFIG(librtmp)
  2165. if test "$PKGCONFIG" != "no" ; then
  2166. LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
  2167. LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
  2168. CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
  2169. version=`$PKGCONFIG --modversion librtmp`
  2170. DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'`
  2171. else
  2172. dnl To avoid link errors, we do not allow --librtmp without
  2173. dnl a pkgconfig file
  2174. AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
  2175. fi
  2176. ;;
  2177. off)
  2178. dnl no --with-librtmp option given, just check default places
  2179. LIB_RTMP="-lrtmp"
  2180. ;;
  2181. *)
  2182. dnl use the given --with-librtmp spot
  2183. LIB_RTMP="-lrtmp"
  2184. PREFIX_RTMP=$OPT_LIBRTMP
  2185. ;;
  2186. esac
  2187. dnl if given with a prefix, we set -L and -I based on that
  2188. if test -n "$PREFIX_RTMP"; then
  2189. LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
  2190. CPP_RTMP=-I${PREFIX_RTMP}/include
  2191. DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
  2192. fi
  2193. LDFLAGS="$LDFLAGS $LD_RTMP"
  2194. CPPFLAGS="$CPPFLAGS $CPP_RTMP"
  2195. LIBS="$LIB_RTMP $LIBS"
  2196. AC_CHECK_LIB(rtmp, RTMP_Init,
  2197. [
  2198. AC_CHECK_HEADERS(librtmp/rtmp.h,
  2199. curl_rtmp_msg="enabled (librtmp)"
  2200. LIBRTMP_ENABLED=1
  2201. AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
  2202. AC_SUBST(USE_LIBRTMP, [1])
  2203. )
  2204. ],
  2205. dnl not found, revert back to clean variables
  2206. LDFLAGS=$CLEANLDFLAGS
  2207. CPPFLAGS=$CLEANCPPFLAGS
  2208. LIBS=$CLEANLIBS
  2209. )
  2210. if test X"$OPT_LIBRTMP" != Xoff &&
  2211. test "$LIBRTMP_ENABLED" != "1"; then
  2212. AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
  2213. fi
  2214. fi
  2215. dnl **********************************************************************
  2216. dnl Check for linker switch for versioned symbols
  2217. dnl **********************************************************************
  2218. versioned_symbols_flavour=
  2219. AC_MSG_CHECKING([whether versioned symbols are wanted])
  2220. AC_ARG_ENABLE(versioned-symbols,
  2221. AS_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
  2222. AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
  2223. [ case "$enableval" in
  2224. yes) AC_MSG_RESULT(yes)
  2225. AC_MSG_CHECKING([if libraries can be versioned])
  2226. GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
  2227. if test -z "$GLD"; then
  2228. AC_MSG_RESULT(no)
  2229. AC_MSG_WARN([You need an ld version supporting the --version-script option])
  2230. else
  2231. AC_MSG_RESULT(yes)
  2232. if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
  2233. versioned_symbols_flavour="MULTISSL_"
  2234. elif test "x$OPENSSL_ENABLED" = "x1"; then
  2235. versioned_symbols_flavour="OPENSSL_"
  2236. elif test "x$GNUTLS_ENABLED" = "x1"; then
  2237. versioned_symbols_flavour="GNUTLS_"
  2238. elif test "x$NSS_ENABLED" = "x1"; then
  2239. versioned_symbols_flavour="NSS_"
  2240. elif test "x$WOLFSSL_ENABLED" = "x1"; then
  2241. versioned_symbols_flavour="WOLFSSL_"
  2242. elif test "x$SCHANNEL_ENABLED" = "x1"; then
  2243. versioned_symbols_flavour="SCHANNEL_"
  2244. elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then
  2245. versioned_symbols_flavour="SECURE_TRANSPORT_"
  2246. else
  2247. versioned_symbols_flavour=""
  2248. fi
  2249. versioned_symbols="yes"
  2250. fi
  2251. ;;
  2252. *) AC_MSG_RESULT(no)
  2253. ;;
  2254. esac
  2255. ], [
  2256. AC_MSG_RESULT(no)
  2257. ]
  2258. )
  2259. AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
  2260. ["$versioned_symbols_flavour"])
  2261. AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
  2262. [test "x$versioned_symbols" = 'xyes'])
  2263. dnl Update .plist file with current version
  2264. AC_SUBST([CURL_PLIST_VERSION],
  2265. ["$CURLVERSION"])
  2266. dnl -------------------------------------------------
  2267. dnl check winidn option before other IDN libraries
  2268. dnl -------------------------------------------------
  2269. AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
  2270. OPT_WINIDN="default"
  2271. AC_ARG_WITH(winidn,
  2272. AS_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
  2273. AS_HELP_STRING([--without-winidn], [disable Windows native IDN]),
  2274. OPT_WINIDN=$withval)
  2275. case "$OPT_WINIDN" in
  2276. no|default)
  2277. dnl --without-winidn option used or configure option not specified
  2278. want_winidn="no"
  2279. AC_MSG_RESULT([no])
  2280. ;;
  2281. yes)
  2282. dnl --with-winidn option used without path
  2283. want_winidn="yes"
  2284. want_winidn_path="default"
  2285. AC_MSG_RESULT([yes])
  2286. ;;
  2287. *)
  2288. dnl --with-winidn option used with path
  2289. want_winidn="yes"
  2290. want_winidn_path="$withval"
  2291. AC_MSG_RESULT([yes ($withval)])
  2292. ;;
  2293. esac
  2294. if test "$want_winidn" = "yes"; then
  2295. dnl winidn library support has been requested
  2296. clean_CFLAGS="$CFLAGS"
  2297. clean_CPPFLAGS="$CPPFLAGS"
  2298. clean_LDFLAGS="$LDFLAGS"
  2299. clean_LIBS="$LIBS"
  2300. WINIDN_LIBS="-lnormaliz"
  2301. WINIDN_CPPFLAGS=""
  2302. #
  2303. if test "$want_winidn_path" != "default"; then
  2304. dnl path has been specified
  2305. dnl pkg-config not available or provides no info
  2306. WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
  2307. WINIDN_CPPFLAGS="-I$want_winidn_path/include"
  2308. WINIDN_DIR="$want_winidn_path/lib$libsuff"
  2309. fi
  2310. #
  2311. dnl WinIDN requires a minimum supported OS version of at least Vista (0x0600)
  2312. AC_COMPILE_IFELSE([
  2313. AC_LANG_PROGRAM([[
  2314. #include <windows.h>
  2315. ]],[[
  2316. #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
  2317. #error
  2318. #endif
  2319. ]])
  2320. ],[
  2321. ],[
  2322. CFLAGS=`echo $CFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
  2323. CFLAGS=`echo $CFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
  2324. CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
  2325. CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
  2326. WINIDN_CPPFLAGS="$WINIDN_CPPFLAGS -DWINVER=0x0600"
  2327. ])
  2328. #
  2329. CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
  2330. LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
  2331. LIBS="$WINIDN_LIBS $LIBS"
  2332. #
  2333. AC_MSG_CHECKING([if IdnToUnicode can be linked])
  2334. AC_LINK_IFELSE([
  2335. AC_LANG_PROGRAM([[
  2336. #include <windows.h>
  2337. ]],[[
  2338. IdnToUnicode(0, NULL, 0, NULL, 0);
  2339. ]])
  2340. ],[
  2341. AC_MSG_RESULT([yes])
  2342. tst_links_winidn="yes"
  2343. ],[
  2344. AC_MSG_RESULT([no])
  2345. tst_links_winidn="no"
  2346. ])
  2347. #
  2348. if test "$tst_links_winidn" = "yes"; then
  2349. AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
  2350. AC_SUBST([IDN_ENABLED], [1])
  2351. curl_idn_msg="enabled (Windows-native)"
  2352. else
  2353. AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
  2354. CFLAGS="$clean_CFLAGS"
  2355. CPPFLAGS="$clean_CPPFLAGS"
  2356. LDFLAGS="$clean_LDFLAGS"
  2357. LIBS="$clean_LIBS"
  2358. fi
  2359. fi
  2360. dnl **********************************************************************
  2361. dnl Check for the presence of IDN libraries and headers
  2362. dnl **********************************************************************
  2363. AC_MSG_CHECKING([whether to build with libidn2])
  2364. OPT_IDN="default"
  2365. AC_ARG_WITH(libidn2,
  2366. AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
  2367. AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
  2368. [OPT_IDN=$withval])
  2369. if test "x$tst_links_winidn" = "xyes"; then
  2370. want_idn="no"
  2371. AC_MSG_RESULT([no (using winidn instead)])
  2372. else
  2373. case "$OPT_IDN" in
  2374. no)
  2375. dnl --without-libidn2 option used
  2376. want_idn="no"
  2377. AC_MSG_RESULT([no])
  2378. ;;
  2379. default)
  2380. dnl configure option not specified
  2381. want_idn="yes"
  2382. want_idn_path="default"
  2383. AC_MSG_RESULT([(assumed) yes])
  2384. ;;
  2385. yes)
  2386. dnl --with-libidn2 option used without path
  2387. want_idn="yes"
  2388. want_idn_path="default"
  2389. AC_MSG_RESULT([yes])
  2390. ;;
  2391. *)
  2392. dnl --with-libidn2 option used with path
  2393. want_idn="yes"
  2394. want_idn_path="$withval"
  2395. AC_MSG_RESULT([yes ($withval)])
  2396. ;;
  2397. esac
  2398. fi
  2399. if test "$want_idn" = "yes"; then
  2400. dnl idn library support has been requested
  2401. clean_CPPFLAGS="$CPPFLAGS"
  2402. clean_LDFLAGS="$LDFLAGS"
  2403. clean_LIBS="$LIBS"
  2404. PKGCONFIG="no"
  2405. #
  2406. if test "$want_idn_path" != "default"; then
  2407. dnl path has been specified
  2408. IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
  2409. CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
  2410. if test "$PKGCONFIG" != "no"; then
  2411. IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2412. $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
  2413. IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2414. $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
  2415. IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2416. $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
  2417. IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
  2418. else
  2419. dnl pkg-config not available or provides no info
  2420. IDN_LIBS="-lidn2"
  2421. IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
  2422. IDN_CPPFLAGS="-I$want_idn_path/include"
  2423. IDN_DIR="$want_idn_path/lib$libsuff"
  2424. fi
  2425. else
  2426. dnl path not specified
  2427. CURL_CHECK_PKGCONFIG(libidn2)
  2428. if test "$PKGCONFIG" != "no"; then
  2429. IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
  2430. IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
  2431. IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
  2432. IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
  2433. else
  2434. dnl pkg-config not available or provides no info
  2435. IDN_LIBS="-lidn2"
  2436. fi
  2437. fi
  2438. #
  2439. if test "$PKGCONFIG" != "no"; then
  2440. AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
  2441. AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
  2442. AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
  2443. AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
  2444. else
  2445. AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
  2446. AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
  2447. AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
  2448. AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
  2449. fi
  2450. #
  2451. CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
  2452. LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
  2453. LIBS="$IDN_LIBS $LIBS"
  2454. #
  2455. AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
  2456. AC_LINK_IFELSE([
  2457. AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
  2458. ],[
  2459. AC_MSG_RESULT([yes])
  2460. tst_links_libidn="yes"
  2461. ],[
  2462. AC_MSG_RESULT([no])
  2463. tst_links_libidn="no"
  2464. ])
  2465. #
  2466. AC_CHECK_HEADERS( idn2.h )
  2467. if test "$tst_links_libidn" = "yes"; then
  2468. AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
  2469. dnl different versions of libidn have different setups of these:
  2470. AC_SUBST([IDN_ENABLED], [1])
  2471. curl_idn_msg="enabled (libidn2)"
  2472. if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
  2473. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
  2474. export CURL_LIBRARY_PATH
  2475. AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
  2476. fi
  2477. else
  2478. AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
  2479. CPPFLAGS="$clean_CPPFLAGS"
  2480. LDFLAGS="$clean_LDFLAGS"
  2481. LIBS="$clean_LIBS"
  2482. fi
  2483. fi
  2484. dnl **********************************************************************
  2485. dnl Check for nghttp2
  2486. dnl **********************************************************************
  2487. OPT_H2="yes"
  2488. if test "x$disable_http" = "xyes" -o X"$want_hyper" != Xno; then
  2489. # without HTTP or with Hyper, nghttp2 is no use
  2490. OPT_H2="no"
  2491. fi
  2492. AC_ARG_WITH(nghttp2,
  2493. AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
  2494. AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
  2495. [OPT_H2=$withval])
  2496. case "$OPT_H2" in
  2497. no)
  2498. dnl --without-nghttp2 option used
  2499. want_nghttp2="no"
  2500. ;;
  2501. yes)
  2502. dnl --with-nghttp2 option used without path
  2503. want_nghttp2="default"
  2504. want_nghttp2_path=""
  2505. want_nghttp2_pkg_config_path=""
  2506. ;;
  2507. *)
  2508. dnl --with-nghttp2 option used with path
  2509. want_nghttp2="yes"
  2510. want_nghttp2_path="$withval"
  2511. want_nghttp2_pkg_config_path="$withval/lib/pkgconfig"
  2512. ;;
  2513. esac
  2514. if test X"$want_nghttp2" != Xno; then
  2515. dnl backup the pre-nghttp2 variables
  2516. CLEANLDFLAGS="$LDFLAGS"
  2517. CLEANCPPFLAGS="$CPPFLAGS"
  2518. CLEANLIBS="$LIBS"
  2519. CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_pkg_config_path)
  2520. if test "$PKGCONFIG" != "no" ; then
  2521. LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
  2522. $PKGCONFIG --libs-only-l libnghttp2`
  2523. AC_MSG_NOTICE([-l is $LIB_H2])
  2524. CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) dnl
  2525. $PKGCONFIG --cflags-only-I libnghttp2`
  2526. AC_MSG_NOTICE([-I is $CPP_H2])
  2527. LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
  2528. $PKGCONFIG --libs-only-L libnghttp2`
  2529. AC_MSG_NOTICE([-L is $LD_H2])
  2530. DIR_H2=`echo $LD_H2 | $SED -e 's/^-L//'`
  2531. elif test x"$want_nghttp2_path" != x; then
  2532. LIB_H2="-lnghttp2"
  2533. LD_H2=-L${want_nghttp2_path}/lib$libsuff
  2534. CPP_H2=-I${want_nghttp2_path}/include
  2535. DIR_H2=${want_nghttp2_path}/lib$libsuff
  2536. elif test X"$want_nghttp2" != Xdefault; then
  2537. dnl no nghttp2 pkg-config found and no custom directory specified,
  2538. dnl deal with it
  2539. AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
  2540. else
  2541. LIB_H2="-lnghttp2"
  2542. fi
  2543. LDFLAGS="$LDFLAGS $LD_H2"
  2544. CPPFLAGS="$CPPFLAGS $CPP_H2"
  2545. LIBS="$LIB_H2 $LIBS"
  2546. # use nghttp2_session_set_local_window_size to require nghttp2
  2547. # >= 1.12.0
  2548. AC_CHECK_LIB(nghttp2, nghttp2_session_set_local_window_size,
  2549. [
  2550. AC_CHECK_HEADERS(nghttp2/nghttp2.h,
  2551. curl_h2_msg="enabled (nghttp2)"
  2552. NGHTTP2_ENABLED=1
  2553. AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
  2554. AC_SUBST(USE_NGHTTP2, [1])
  2555. )
  2556. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2"
  2557. export CURL_LIBRARY_PATH
  2558. AC_MSG_NOTICE([Added $DIR_H2 to CURL_LIBRARY_PATH])
  2559. ],
  2560. dnl not found, revert back to clean variables
  2561. LDFLAGS=$CLEANLDFLAGS
  2562. CPPFLAGS=$CLEANCPPFLAGS
  2563. LIBS=$CLEANLIBS
  2564. )
  2565. fi
  2566. dnl **********************************************************************
  2567. dnl Check for ngtcp2 (QUIC)
  2568. dnl **********************************************************************
  2569. OPT_TCP2="no"
  2570. if test "x$disable_http" = "xyes"; then
  2571. # without HTTP, ngtcp2 is no use
  2572. OPT_TCP2="no"
  2573. fi
  2574. AC_ARG_WITH(ngtcp2,
  2575. AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
  2576. AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
  2577. [OPT_TCP2=$withval])
  2578. case "$OPT_TCP2" in
  2579. no)
  2580. dnl --without-ngtcp2 option used
  2581. want_tcp2="no"
  2582. ;;
  2583. yes)
  2584. dnl --with-ngtcp2 option used without path
  2585. want_tcp2="default"
  2586. want_tcp2_path=""
  2587. ;;
  2588. *)
  2589. dnl --with-ngtcp2 option used with path
  2590. want_tcp2="yes"
  2591. want_tcp2_path="$withval/lib/pkgconfig"
  2592. ;;
  2593. esac
  2594. curl_tcp2_msg="no (--with-ngtcp2)"
  2595. if test X"$want_tcp2" != Xno; then
  2596. dnl backup the pre-ngtcp2 variables
  2597. CLEANLDFLAGS="$LDFLAGS"
  2598. CLEANCPPFLAGS="$CPPFLAGS"
  2599. CLEANLIBS="$LIBS"
  2600. CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
  2601. if test "$PKGCONFIG" != "no" ; then
  2602. LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2603. $PKGCONFIG --libs-only-l libngtcp2`
  2604. AC_MSG_NOTICE([-l is $LIB_TCP2])
  2605. CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
  2606. $PKGCONFIG --cflags-only-I libngtcp2`
  2607. AC_MSG_NOTICE([-I is $CPP_TCP2])
  2608. LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2609. $PKGCONFIG --libs-only-L libngtcp2`
  2610. AC_MSG_NOTICE([-L is $LD_TCP2])
  2611. LDFLAGS="$LDFLAGS $LD_TCP2"
  2612. CPPFLAGS="$CPPFLAGS $CPP_TCP2"
  2613. LIBS="$LIB_TCP2 $LIBS"
  2614. if test "x$cross_compiling" != "xyes"; then
  2615. DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
  2616. fi
  2617. AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned,
  2618. [
  2619. AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
  2620. NGTCP2_ENABLED=1
  2621. AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
  2622. AC_SUBST(USE_NGTCP2, [1])
  2623. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
  2624. export CURL_LIBRARY_PATH
  2625. AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
  2626. )
  2627. ],
  2628. dnl not found, revert back to clean variables
  2629. LDFLAGS=$CLEANLDFLAGS
  2630. CPPFLAGS=$CLEANCPPFLAGS
  2631. LIBS=$CLEANLIBS
  2632. )
  2633. else
  2634. dnl no ngtcp2 pkg-config found, deal with it
  2635. if test X"$want_tcp2" != Xdefault; then
  2636. dnl To avoid link errors, we do not allow --with-ngtcp2 without
  2637. dnl a pkgconfig file
  2638. AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
  2639. fi
  2640. fi
  2641. fi
  2642. if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
  2643. dnl backup the pre-ngtcp2_crypto_openssl variables
  2644. CLEANLDFLAGS="$LDFLAGS"
  2645. CLEANCPPFLAGS="$CPPFLAGS"
  2646. CLEANLIBS="$LIBS"
  2647. CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
  2648. if test "$PKGCONFIG" != "no" ; then
  2649. LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2650. $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
  2651. AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
  2652. CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
  2653. $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
  2654. AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
  2655. LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2656. $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
  2657. AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
  2658. LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
  2659. CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
  2660. LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
  2661. if test "x$cross_compiling" != "xyes"; then
  2662. DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
  2663. fi
  2664. AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_recv_client_initial_cb,
  2665. [
  2666. AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
  2667. NGTCP2_ENABLED=1
  2668. AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
  2669. AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
  2670. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
  2671. export CURL_LIBRARY_PATH
  2672. AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
  2673. )
  2674. ],
  2675. dnl not found, revert back to clean variables
  2676. LDFLAGS=$CLEANLDFLAGS
  2677. CPPFLAGS=$CLEANCPPFLAGS
  2678. LIBS=$CLEANLIBS
  2679. )
  2680. else
  2681. dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
  2682. if test X"$want_tcp2" != Xdefault; then
  2683. dnl To avoid link errors, we do not allow --with-ngtcp2 without
  2684. dnl a pkgconfig file
  2685. AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
  2686. fi
  2687. fi
  2688. fi
  2689. if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
  2690. dnl backup the pre-ngtcp2_crypto_gnutls variables
  2691. CLEANLDFLAGS="$LDFLAGS"
  2692. CLEANCPPFLAGS="$CPPFLAGS"
  2693. CLEANLIBS="$LIBS"
  2694. CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
  2695. if test "$PKGCONFIG" != "no" ; then
  2696. LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2697. $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
  2698. AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
  2699. CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
  2700. $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
  2701. AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
  2702. LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2703. $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
  2704. AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
  2705. LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
  2706. CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
  2707. LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
  2708. if test "x$cross_compiling" != "xyes"; then
  2709. DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
  2710. fi
  2711. AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_recv_client_initial_cb,
  2712. [
  2713. AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
  2714. NGTCP2_ENABLED=1
  2715. AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
  2716. AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
  2717. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
  2718. export CURL_LIBRARY_PATH
  2719. AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
  2720. )
  2721. ],
  2722. dnl not found, revert back to clean variables
  2723. LDFLAGS=$CLEANLDFLAGS
  2724. CPPFLAGS=$CLEANCPPFLAGS
  2725. LIBS=$CLEANLIBS
  2726. )
  2727. else
  2728. dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
  2729. if test X"$want_tcp2" != Xdefault; then
  2730. dnl To avoid link errors, we do not allow --with-ngtcp2 without
  2731. dnl a pkgconfig file
  2732. AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
  2733. fi
  2734. fi
  2735. fi
  2736. if test "x$NGTCP2_ENABLED" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then
  2737. dnl backup the pre-ngtcp2_crypto_wolfssl variables
  2738. CLEANLDFLAGS="$LDFLAGS"
  2739. CLEANCPPFLAGS="$CPPFLAGS"
  2740. CLEANLIBS="$LIBS"
  2741. CURL_CHECK_PKGCONFIG(libngtcp2_crypto_wolfssl, $want_tcp2_path)
  2742. if test "$PKGCONFIG" != "no" ; then
  2743. LIB_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2744. $PKGCONFIG --libs-only-l libngtcp2_crypto_wolfssl`
  2745. AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_WOLFSSL])
  2746. CPP_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
  2747. $PKGCONFIG --cflags-only-I libngtcp2_crypto_wolfssl`
  2748. AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_WOLFSSL])
  2749. LD_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  2750. $PKGCONFIG --libs-only-L libngtcp2_crypto_wolfssl`
  2751. AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_WOLFSSL])
  2752. LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_WOLFSSL"
  2753. CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_WOLFSSL"
  2754. LIBS="$LIB_NGTCP2_CRYPTO_WOLFSSL $LIBS"
  2755. if test "x$cross_compiling" != "xyes"; then
  2756. DIR_NGTCP2_CRYPTO_WOLFSSL=`echo $LD_NGTCP2_CRYPTO_WOLFSSL | $SED -e 's/^-L//'`
  2757. fi
  2758. AC_CHECK_LIB(ngtcp2_crypto_wolfssl, ngtcp2_crypto_recv_client_initial_cb,
  2759. [
  2760. AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
  2761. NGTCP2_ENABLED=1
  2762. AC_DEFINE(USE_NGTCP2_CRYPTO_WOLFSSL, 1, [if ngtcp2_crypto_wolfssl is in use])
  2763. AC_SUBST(USE_NGTCP2_CRYPTO_WOLFSSL, [1])
  2764. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_WOLFSSL"
  2765. export CURL_LIBRARY_PATH
  2766. AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH])
  2767. )
  2768. ],
  2769. dnl not found, revert back to clean variables
  2770. LDFLAGS=$CLEANLDFLAGS
  2771. CPPFLAGS=$CLEANCPPFLAGS
  2772. LIBS=$CLEANLIBS
  2773. )
  2774. else
  2775. dnl no ngtcp2_crypto_wolfssl pkg-config found, deal with it
  2776. if test X"$want_tcp2" != Xdefault; then
  2777. dnl To avoid link errors, we do not allow --with-ngtcp2 without
  2778. dnl a pkgconfig file
  2779. AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_wolfssl pkg-config file.])
  2780. fi
  2781. fi
  2782. fi
  2783. dnl **********************************************************************
  2784. dnl Check for nghttp3 (HTTP/3 with ngtcp2)
  2785. dnl **********************************************************************
  2786. OPT_NGHTTP3="yes"
  2787. if test "x$NGTCP2_ENABLED" = "x"; then
  2788. # without ngtcp2, nghttp3 is of no use for us
  2789. OPT_NGHTTP3="no"
  2790. fi
  2791. AC_ARG_WITH(nghttp3,
  2792. AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
  2793. AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
  2794. [OPT_NGHTTP3=$withval])
  2795. case "$OPT_NGHTTP3" in
  2796. no)
  2797. dnl --without-nghttp3 option used
  2798. want_nghttp3="no"
  2799. ;;
  2800. yes)
  2801. dnl --with-nghttp3 option used without path
  2802. want_nghttp3="default"
  2803. want_nghttp3_path=""
  2804. ;;
  2805. *)
  2806. dnl --with-nghttp3 option used with path
  2807. want_nghttp3="yes"
  2808. want_nghttp3_path="$withval/lib/pkgconfig"
  2809. ;;
  2810. esac
  2811. curl_http3_msg="no (--with-nghttp3)"
  2812. if test X"$want_nghttp3" != Xno; then
  2813. dnl backup the pre-nghttp3 variables
  2814. CLEANLDFLAGS="$LDFLAGS"
  2815. CLEANCPPFLAGS="$CPPFLAGS"
  2816. CLEANLIBS="$LIBS"
  2817. CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
  2818. if test "$PKGCONFIG" != "no" ; then
  2819. LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
  2820. $PKGCONFIG --libs-only-l libnghttp3`
  2821. AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
  2822. CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
  2823. $PKGCONFIG --cflags-only-I libnghttp3`
  2824. AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
  2825. LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
  2826. $PKGCONFIG --libs-only-L libnghttp3`
  2827. AC_MSG_NOTICE([-L is $LD_NGHTTP3])
  2828. LDFLAGS="$LDFLAGS $LD_NGHTTP3"
  2829. CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
  2830. LIBS="$LIB_NGHTTP3 $LIBS"
  2831. if test "x$cross_compiling" != "xyes"; then
  2832. DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
  2833. fi
  2834. AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned,
  2835. [
  2836. AC_CHECK_HEADERS(nghttp3/nghttp3.h,
  2837. curl_h3_msg="enabled (ngtcp2 + nghttp3)"
  2838. NGHTTP3_ENABLED=1
  2839. AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
  2840. AC_SUBST(USE_NGHTTP3, [1])
  2841. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
  2842. export CURL_LIBRARY_PATH
  2843. AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
  2844. experimental="$experimental HTTP3"
  2845. )
  2846. ],
  2847. dnl not found, revert back to clean variables
  2848. LDFLAGS=$CLEANLDFLAGS
  2849. CPPFLAGS=$CLEANCPPFLAGS
  2850. LIBS=$CLEANLIBS
  2851. )
  2852. else
  2853. dnl no nghttp3 pkg-config found, deal with it
  2854. if test X"$want_nghttp3" != Xdefault; then
  2855. dnl To avoid link errors, we do not allow --with-nghttp3 without
  2856. dnl a pkgconfig file
  2857. AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
  2858. fi
  2859. fi
  2860. fi
  2861. dnl **********************************************************************
  2862. dnl Check for quiche (QUIC)
  2863. dnl **********************************************************************
  2864. OPT_QUICHE="no"
  2865. if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
  2866. # without HTTP or with ngtcp2, quiche is no use
  2867. OPT_QUICHE="no"
  2868. fi
  2869. AC_ARG_WITH(quiche,
  2870. AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
  2871. AS_HELP_STRING([--without-quiche],[Disable quiche usage]),
  2872. [OPT_QUICHE=$withval])
  2873. case "$OPT_QUICHE" in
  2874. no)
  2875. dnl --without-quiche option used
  2876. want_quiche="no"
  2877. ;;
  2878. yes)
  2879. dnl --with-quiche option used without path
  2880. want_quiche="default"
  2881. want_quiche_path=""
  2882. ;;
  2883. *)
  2884. dnl --with-quiche option used with path
  2885. want_quiche="yes"
  2886. want_quiche_path="$withval"
  2887. ;;
  2888. esac
  2889. if test X"$want_quiche" != Xno; then
  2890. if test "$NGHTTP3_ENABLED" = 1; then
  2891. AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive])
  2892. fi
  2893. dnl backup the pre-quiche variables
  2894. CLEANLDFLAGS="$LDFLAGS"
  2895. CLEANCPPFLAGS="$CPPFLAGS"
  2896. CLEANLIBS="$LIBS"
  2897. CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
  2898. if test "$PKGCONFIG" != "no" ; then
  2899. LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
  2900. $PKGCONFIG --libs-only-l quiche`
  2901. AC_MSG_NOTICE([-l is $LIB_QUICHE])
  2902. CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
  2903. $PKGCONFIG --cflags-only-I quiche`
  2904. AC_MSG_NOTICE([-I is $CPP_QUICHE])
  2905. LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
  2906. $PKGCONFIG --libs-only-L quiche`
  2907. AC_MSG_NOTICE([-L is $LD_QUICHE])
  2908. LDFLAGS="$LDFLAGS $LD_QUICHE"
  2909. CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
  2910. LIBS="$LIB_QUICHE $LIBS"
  2911. if test "x$cross_compiling" != "xyes"; then
  2912. DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
  2913. fi
  2914. AC_CHECK_LIB(quiche, quiche_conn_send_ack_eliciting,
  2915. [
  2916. AC_CHECK_HEADERS(quiche.h,
  2917. experimental="$experimental HTTP3"
  2918. AC_MSG_NOTICE([HTTP3 support is experimental])
  2919. curl_h3_msg="enabled (quiche)"
  2920. QUICHE_ENABLED=1
  2921. AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
  2922. AC_SUBST(USE_QUICHE, [1])
  2923. AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
  2924. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
  2925. export CURL_LIBRARY_PATH
  2926. AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
  2927. [],
  2928. [
  2929. AC_INCLUDES_DEFAULT
  2930. #include <sys/socket.h>
  2931. ]
  2932. )
  2933. ],
  2934. dnl not found, revert back to clean variables
  2935. AC_MSG_ERROR([couldn't use quiche])
  2936. )
  2937. else
  2938. dnl no quiche pkg-config found, deal with it
  2939. if test X"$want_quiche" != Xdefault; then
  2940. dnl To avoid link errors, we do not allow --with-quiche without
  2941. dnl a pkgconfig file
  2942. AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
  2943. fi
  2944. fi
  2945. fi
  2946. dnl **********************************************************************
  2947. dnl Check for msh3 (QUIC)
  2948. dnl **********************************************************************
  2949. OPT_MSH3="no"
  2950. if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
  2951. # without HTTP or with ngtcp2, msh3 is no use
  2952. OPT_MSH3="no"
  2953. fi
  2954. AC_ARG_WITH(msh3,
  2955. AS_HELP_STRING([--with-msh3=PATH],[Enable msh3 usage])
  2956. AS_HELP_STRING([--without-msh3],[Disable msh3 usage]),
  2957. [OPT_MSH3=$withval])
  2958. case "$OPT_MSH3" in
  2959. no)
  2960. dnl --without-msh3 option used
  2961. want_msh3="no"
  2962. ;;
  2963. yes)
  2964. dnl --with-msh3 option used without path
  2965. want_msh3="default"
  2966. want_msh3_path=""
  2967. ;;
  2968. *)
  2969. dnl --with-msh3 option used with path
  2970. want_msh3="yes"
  2971. want_msh3_path="$withval"
  2972. ;;
  2973. esac
  2974. if test X"$want_msh3" != Xno; then
  2975. if test "$NGHTTP3_ENABLED" = 1; then
  2976. AC_MSG_ERROR([--with-msh3 and --with-ngtcp2 are mutually exclusive])
  2977. fi
  2978. dnl backup the pre-msh3 variables
  2979. CLEANLDFLAGS="$LDFLAGS"
  2980. CLEANCPPFLAGS="$CPPFLAGS"
  2981. CLEANLIBS="$LIBS"
  2982. if test -n "$want_msh3_path"; then
  2983. LD_MSH3="-L$want_msh3_path/lib"
  2984. CPP_MSH3="-I$want_msh3_path/include"
  2985. DIR_MSH3="$want_msh3_path/lib"
  2986. LDFLAGS="$LDFLAGS $LD_MSH3"
  2987. CPPFLAGS="$CPPFLAGS $CPP_MSH3"
  2988. fi
  2989. LIBS="-lmsh3 $LIBS"
  2990. AC_CHECK_LIB(msh3, MsH3ApiOpen,
  2991. [
  2992. AC_CHECK_HEADERS(msh3.h,
  2993. curl_h3_msg="enabled (msh3)"
  2994. MSH3_ENABLED=1
  2995. AC_DEFINE(USE_MSH3, 1, [if msh3 is in use])
  2996. AC_SUBST(USE_MSH3, [1])
  2997. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_MSH3"
  2998. export CURL_LIBRARY_PATH
  2999. AC_MSG_NOTICE([Added $DIR_MSH3 to CURL_LIBRARY_PATH]),
  3000. experimental="$experimental HTTP3"
  3001. )
  3002. ],
  3003. dnl not found, revert back to clean variables
  3004. LDFLAGS=$CLEANLDFLAGS
  3005. CPPFLAGS=$CLEANCPPFLAGS
  3006. LIBS=$CLEANLIBS
  3007. )
  3008. fi
  3009. dnl **********************************************************************
  3010. dnl Check for zsh completion path
  3011. dnl **********************************************************************
  3012. OPT_ZSH_FPATH=default
  3013. AC_ARG_WITH(zsh-functions-dir,
  3014. AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
  3015. AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
  3016. [OPT_ZSH_FPATH=$withval])
  3017. case "$OPT_ZSH_FPATH" in
  3018. no)
  3019. dnl --without-zsh-functions-dir option used
  3020. ;;
  3021. default|yes)
  3022. dnl --with-zsh-functions-dir option used without path
  3023. ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
  3024. AC_SUBST(ZSH_FUNCTIONS_DIR)
  3025. ;;
  3026. *)
  3027. dnl --with-zsh-functions-dir option used with path
  3028. ZSH_FUNCTIONS_DIR="$withval"
  3029. AC_SUBST(ZSH_FUNCTIONS_DIR)
  3030. ;;
  3031. esac
  3032. dnl **********************************************************************
  3033. dnl Check for fish completion path
  3034. dnl **********************************************************************
  3035. OPT_FISH_FPATH=default
  3036. AC_ARG_WITH(fish-functions-dir,
  3037. AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
  3038. AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
  3039. [OPT_FISH_FPATH=$withval])
  3040. case "$OPT_FISH_FPATH" in
  3041. no)
  3042. dnl --without-fish-functions-dir option used
  3043. ;;
  3044. default|yes)
  3045. dnl --with-fish-functions-dir option used without path
  3046. CURL_CHECK_PKGCONFIG(fish)
  3047. if test "$PKGCONFIG" != "no" ; then
  3048. FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
  3049. else
  3050. FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
  3051. fi
  3052. AC_SUBST(FISH_FUNCTIONS_DIR)
  3053. ;;
  3054. *)
  3055. dnl --with-fish-functions-dir option used with path
  3056. FISH_FUNCTIONS_DIR="$withval"
  3057. AC_SUBST(FISH_FUNCTIONS_DIR)
  3058. ;;
  3059. esac
  3060. dnl Now check for the very most basic headers. Then we can use these
  3061. dnl ones as default-headers when checking for the rest!
  3062. AC_CHECK_HEADERS(
  3063. sys/types.h \
  3064. sys/time.h \
  3065. sys/select.h \
  3066. sys/socket.h \
  3067. sys/ioctl.h \
  3068. sys/uio.h \
  3069. unistd.h \
  3070. stdlib.h \
  3071. arpa/inet.h \
  3072. net/if.h \
  3073. netinet/in.h \
  3074. netinet/in6.h \
  3075. sys/un.h \
  3076. linux/tcp.h \
  3077. netinet/tcp.h \
  3078. netinet/udp.h \
  3079. netdb.h \
  3080. sys/sockio.h \
  3081. sys/stat.h \
  3082. sys/param.h \
  3083. termios.h \
  3084. termio.h \
  3085. fcntl.h \
  3086. io.h \
  3087. pwd.h \
  3088. utime.h \
  3089. sys/utime.h \
  3090. sys/poll.h \
  3091. poll.h \
  3092. socket.h \
  3093. sys/resource.h \
  3094. libgen.h \
  3095. locale.h \
  3096. stdbool.h \
  3097. arpa/tftp.h \
  3098. sys/filio.h \
  3099. sys/wait.h \
  3100. setjmp.h,
  3101. dnl to do if not found
  3102. [],
  3103. dnl to do if found
  3104. [],
  3105. dnl default includes
  3106. [
  3107. #ifdef HAVE_SYS_TYPES_H
  3108. #include <sys/types.h>
  3109. #endif
  3110. #ifdef HAVE_SYS_TIME_H
  3111. #include <sys/time.h>
  3112. #endif
  3113. #ifdef HAVE_SYS_SELECT_H
  3114. #include <sys/select.h>
  3115. #elif defined(HAVE_UNISTD_H)
  3116. #include <unistd.h>
  3117. #endif
  3118. #ifdef HAVE_SYS_SOCKET_H
  3119. #include <sys/socket.h>
  3120. #endif
  3121. #ifdef HAVE_NETINET_IN_H
  3122. #include <netinet/in.h>
  3123. #endif
  3124. #ifdef HAVE_NETINET_IN6_H
  3125. #include <netinet/in6.h>
  3126. #endif
  3127. #ifdef HAVE_SYS_UN_H
  3128. #include <sys/un.h>
  3129. #endif
  3130. ]
  3131. )
  3132. dnl Checks for typedefs, structures, and compiler characteristics.
  3133. AC_C_CONST
  3134. CURL_CHECK_VARIADIC_MACROS
  3135. AC_TYPE_SIZE_T
  3136. CURL_CHECK_STRUCT_TIMEVAL
  3137. CURL_VERIFY_RUNTIMELIBS
  3138. CURL_SIZEOF(size_t)
  3139. CURL_SIZEOF(long)
  3140. CURL_SIZEOF(int)
  3141. CURL_SIZEOF(time_t)
  3142. CURL_SIZEOF(off_t)
  3143. o=$CPPFLAGS
  3144. CPPFLAGS="-I$srcdir/include $CPPFLAGS"
  3145. CURL_SIZEOF(curl_off_t, [
  3146. #include <curl/system.h>
  3147. ])
  3148. CURL_SIZEOF(curl_socket_t, [
  3149. #include <curl/curl.h>
  3150. ])
  3151. CPPFLAGS=$o
  3152. AC_CHECK_TYPE(long long,
  3153. [AC_DEFINE(HAVE_LONGLONG, 1,
  3154. [Define to 1 if the compiler supports the 'long long' data type.])]
  3155. longlong="yes"
  3156. )
  3157. if test ${ac_cv_sizeof_curl_off_t} -lt 8; then
  3158. AC_MSG_ERROR([64 bit curl_off_t is required])
  3159. fi
  3160. # check for ssize_t
  3161. AC_CHECK_TYPE(ssize_t, ,
  3162. AC_DEFINE(ssize_t, int, [the signed version of size_t]))
  3163. # check for bool type
  3164. AC_CHECK_TYPE([bool],[
  3165. AC_DEFINE(HAVE_BOOL_T, 1,
  3166. [Define to 1 if bool is an available type.])
  3167. ], ,[
  3168. #ifdef HAVE_SYS_TYPES_H
  3169. #include <sys/types.h>
  3170. #endif
  3171. #ifdef HAVE_STDBOOL_H
  3172. #include <stdbool.h>
  3173. #endif
  3174. ])
  3175. # check for sa_family_t
  3176. AC_CHECK_TYPE(sa_family_t,
  3177. AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
  3178. [
  3179. # The windows name?
  3180. AC_CHECK_TYPE(ADDRESS_FAMILY,
  3181. AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
  3182. AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
  3183. [
  3184. #ifdef HAVE_SYS_SOCKET_H
  3185. #include <sys/socket.h>
  3186. #endif
  3187. ])
  3188. ],
  3189. [
  3190. #ifdef HAVE_SYS_SOCKET_H
  3191. #include <sys/socket.h>
  3192. #endif
  3193. ])
  3194. # check for suseconds_t
  3195. AC_CHECK_TYPE([suseconds_t],[
  3196. AC_DEFINE(HAVE_SUSECONDS_T, 1,
  3197. [Define to 1 if suseconds_t is an available type.])
  3198. ], ,[
  3199. #ifdef HAVE_SYS_TYPES_H
  3200. #include <sys/types.h>
  3201. #endif
  3202. #ifdef HAVE_SYS_TIME_H
  3203. #include <sys/time.h>
  3204. #endif
  3205. ])
  3206. AC_MSG_CHECKING([if time_t is unsigned])
  3207. CURL_RUN_IFELSE(
  3208. [
  3209. #include <time.h>
  3210. #include <limits.h>
  3211. time_t t = -1;
  3212. return (t > 0);
  3213. ],[
  3214. AC_MSG_RESULT([yes])
  3215. AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
  3216. ],[
  3217. AC_MSG_RESULT([no])
  3218. ],[
  3219. dnl cross-compiling, most systems are unsigned
  3220. AC_MSG_RESULT([no])
  3221. ])
  3222. CURL_CONFIGURE_PULL_SYS_POLL
  3223. TYPE_IN_ADDR_T
  3224. TYPE_SOCKADDR_STORAGE
  3225. CURL_CHECK_FUNC_SELECT
  3226. CURL_CHECK_FUNC_RECV
  3227. CURL_CHECK_FUNC_SEND
  3228. CURL_CHECK_MSG_NOSIGNAL
  3229. CURL_CHECK_FUNC_ALARM
  3230. CURL_CHECK_FUNC_BASENAME
  3231. CURL_CHECK_FUNC_CLOSESOCKET
  3232. CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
  3233. CURL_CHECK_FUNC_CONNECT
  3234. CURL_CHECK_FUNC_FCNTL
  3235. CURL_CHECK_FUNC_FREEADDRINFO
  3236. CURL_CHECK_FUNC_FSETXATTR
  3237. CURL_CHECK_FUNC_FTRUNCATE
  3238. CURL_CHECK_FUNC_GETADDRINFO
  3239. CURL_CHECK_FUNC_GETHOSTBYNAME
  3240. CURL_CHECK_FUNC_GETHOSTBYNAME_R
  3241. CURL_CHECK_FUNC_GETHOSTNAME
  3242. CURL_CHECK_FUNC_GETPEERNAME
  3243. CURL_CHECK_FUNC_GETSOCKNAME
  3244. CURL_CHECK_FUNC_IF_NAMETOINDEX
  3245. CURL_CHECK_FUNC_GETIFADDRS
  3246. CURL_CHECK_FUNC_GMTIME_R
  3247. CURL_CHECK_FUNC_INET_NTOP
  3248. CURL_CHECK_FUNC_INET_PTON
  3249. CURL_CHECK_FUNC_IOCTLSOCKET
  3250. CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
  3251. CURL_CHECK_FUNC_MEMRCHR
  3252. CURL_CHECK_FUNC_POLL
  3253. CURL_CHECK_FUNC_SIGACTION
  3254. CURL_CHECK_FUNC_SIGINTERRUPT
  3255. CURL_CHECK_FUNC_SIGNAL
  3256. CURL_CHECK_FUNC_SIGSETJMP
  3257. CURL_CHECK_FUNC_SOCKET
  3258. CURL_CHECK_FUNC_SOCKETPAIR
  3259. CURL_CHECK_FUNC_STRCASECMP
  3260. CURL_CHECK_FUNC_STRCMPI
  3261. CURL_CHECK_FUNC_STRDUP
  3262. CURL_CHECK_FUNC_STRERROR_R
  3263. CURL_CHECK_FUNC_STRICMP
  3264. CURL_CHECK_FUNC_STRTOK_R
  3265. CURL_CHECK_FUNC_STRTOLL
  3266. case $host in
  3267. *msdosdjgpp)
  3268. ac_cv_func_pipe=no
  3269. skipcheck_pipe=yes
  3270. AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
  3271. ;;
  3272. esac
  3273. AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
  3274. [[#include <pwd.h>
  3275. #include <sys/types.h>]])
  3276. AC_CHECK_FUNCS([fnmatch \
  3277. fchmod \
  3278. fork \
  3279. geteuid \
  3280. getpass_r \
  3281. getppid \
  3282. getpwuid \
  3283. getpwuid_r \
  3284. getrlimit \
  3285. gettimeofday \
  3286. if_nametoindex \
  3287. mach_absolute_time \
  3288. pipe \
  3289. sched_yield \
  3290. sendmsg \
  3291. setlocale \
  3292. setmode \
  3293. setrlimit \
  3294. snprintf \
  3295. utime \
  3296. utimes \
  3297. arc4random
  3298. ],[
  3299. ],[
  3300. func="$ac_func"
  3301. eval skipcheck=\$skipcheck_$func
  3302. if test "x$skipcheck" != "xyes"; then
  3303. AC_MSG_CHECKING([deeper for $func])
  3304. AC_LINK_IFELSE([
  3305. AC_LANG_PROGRAM([[
  3306. ]],[[
  3307. $func ();
  3308. ]])
  3309. ],[
  3310. AC_MSG_RESULT([yes])
  3311. eval "ac_cv_func_$func=yes"
  3312. AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
  3313. [Define to 1 if you have the $func function.])
  3314. ],[
  3315. AC_MSG_RESULT([but still no])
  3316. ])
  3317. fi
  3318. ])
  3319. CURL_CHECK_NONBLOCKING_SOCKET
  3320. dnl ************************************************************
  3321. dnl nroff tool stuff
  3322. dnl
  3323. AC_PATH_PROG( PERL, perl, ,
  3324. $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
  3325. AC_SUBST(PERL)
  3326. AC_PATH_PROGS( NROFF, gnroff nroff, ,
  3327. $PATH:/usr/bin/:/usr/local/bin )
  3328. AC_SUBST(NROFF)
  3329. if test -n "$NROFF"; then
  3330. dnl only check for nroff options if an nroff command was found
  3331. AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
  3332. MANOPT="-man"
  3333. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  3334. if test -z "$mancheck"; then
  3335. MANOPT="-mandoc"
  3336. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  3337. if test -z "$mancheck"; then
  3338. MANOPT=""
  3339. AC_MSG_RESULT([failed])
  3340. AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
  3341. else
  3342. AC_MSG_RESULT([$MANOPT])
  3343. fi
  3344. else
  3345. AC_MSG_RESULT([$MANOPT])
  3346. fi
  3347. AC_SUBST(MANOPT)
  3348. fi
  3349. if test -z "$MANOPT"
  3350. then
  3351. dnl if no nroff tool was found, or no option that could convert man pages
  3352. dnl was found, then disable the built-in manual stuff
  3353. AC_MSG_WARN([disabling built-in manual])
  3354. USE_MANUAL="no";
  3355. fi
  3356. dnl *************************************************************************
  3357. dnl If the manual variable still is set, then we go with providing a built-in
  3358. dnl manual
  3359. if test "$USE_MANUAL" = "1"; then
  3360. AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
  3361. curl_manual_msg="enabled"
  3362. fi
  3363. dnl set variable for use in automakefile(s)
  3364. AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
  3365. CURL_CHECK_LIB_ARES
  3366. if test "x$curl_cv_native_windows" != "xyes" &&
  3367. test "x$enable_shared" = "xyes"; then
  3368. build_libhostname=yes
  3369. else
  3370. build_libhostname=no
  3371. fi
  3372. AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
  3373. if test "x$want_ares" != xyes; then
  3374. CURL_CHECK_OPTION_THREADED_RESOLVER
  3375. fi
  3376. dnl ************************************************************
  3377. dnl disable POSIX threads
  3378. dnl
  3379. AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
  3380. AC_ARG_ENABLE(pthreads,
  3381. AS_HELP_STRING([--enable-pthreads],
  3382. [Enable POSIX threads (default for threaded resolver)])
  3383. AS_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
  3384. [ case "$enableval" in
  3385. no) AC_MSG_RESULT(no)
  3386. want_pthreads=no
  3387. ;;
  3388. *) AC_MSG_RESULT(yes)
  3389. want_pthreads=yes
  3390. ;;
  3391. esac ], [
  3392. AC_MSG_RESULT(auto)
  3393. want_pthreads=auto
  3394. ]
  3395. )
  3396. dnl turn off pthreads if rt is disabled
  3397. if test "$want_pthreads" != "no"; then
  3398. if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
  3399. AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
  3400. fi
  3401. if test "$dontwant_rt" != "no"; then
  3402. dnl if --enable-pthreads was explicit then warn it's being ignored
  3403. if test "$want_pthreads" = "yes"; then
  3404. AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
  3405. fi
  3406. want_pthreads=no
  3407. fi
  3408. fi
  3409. dnl turn off pthreads if no threaded resolver
  3410. if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
  3411. want_pthreads=no
  3412. fi
  3413. dnl detect pthreads
  3414. if test "$want_pthreads" != "no"; then
  3415. AC_CHECK_HEADER(pthread.h,
  3416. [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
  3417. save_CFLAGS="$CFLAGS"
  3418. dnl When statically linking against boringssl, -lpthread is added to LIBS.
  3419. dnl Make sure to that this does not pass the check below, we really want
  3420. dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
  3421. dnl lib1541 and lib1565 tests are built with these options. Otherwise
  3422. dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
  3423. save_LIBS="$LIBS"
  3424. LIBS=
  3425. dnl Check for libc variants without a separate pthread lib like bionic
  3426. AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
  3427. LIBS="$save_LIBS"
  3428. dnl on HPUX, life is more complicated...
  3429. case $host in
  3430. *-hp-hpux*)
  3431. dnl it doesn't actually work without -lpthread
  3432. USE_THREADS_POSIX=""
  3433. ;;
  3434. *)
  3435. ;;
  3436. esac
  3437. dnl if it wasn't found without lib, search for it in pthread lib
  3438. if test "$USE_THREADS_POSIX" != "1"
  3439. then
  3440. # assign PTHREAD for pkg-config use
  3441. PTHREAD=" -pthread"
  3442. case $host in
  3443. *-ibm-aix*)
  3444. dnl Check if compiler is xlC
  3445. COMPILER_VERSION=`"$CC" -qversion 2>/dev/null`
  3446. if test x"$COMPILER_VERSION" = "x"; then
  3447. CFLAGS="$CFLAGS -pthread"
  3448. else
  3449. CFLAGS="$CFLAGS -qthreaded"
  3450. fi
  3451. ;;
  3452. powerpc-*amigaos*)
  3453. dnl No -pthread option, but link with -lpthread
  3454. PTHREAD=" -lpthread"
  3455. ;;
  3456. *)
  3457. CFLAGS="$CFLAGS -pthread"
  3458. ;;
  3459. esac
  3460. AC_CHECK_LIB(pthread, pthread_create,
  3461. [USE_THREADS_POSIX=1],
  3462. [ CFLAGS="$save_CFLAGS"])
  3463. fi
  3464. if test "x$USE_THREADS_POSIX" = "x1"
  3465. then
  3466. AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
  3467. curl_res_msg="POSIX threaded"
  3468. fi
  3469. ])
  3470. fi
  3471. dnl threaded resolver check
  3472. if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
  3473. if test "$want_pthreads" = "yes"; then
  3474. AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
  3475. fi
  3476. dnl If native Windows fallback on Win32 threads since no POSIX threads
  3477. if test "$curl_cv_native_windows" = "yes"; then
  3478. USE_THREADS_WIN32=1
  3479. AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
  3480. curl_res_msg="Win32 threaded"
  3481. else
  3482. AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
  3483. fi
  3484. fi
  3485. CURL_CONVERT_INCLUDE_TO_ISYSTEM
  3486. dnl ************************************************************
  3487. dnl disable verbose text strings
  3488. dnl
  3489. AC_MSG_CHECKING([whether to enable verbose strings])
  3490. AC_ARG_ENABLE(verbose,
  3491. AS_HELP_STRING([--enable-verbose],[Enable verbose strings])
  3492. AS_HELP_STRING([--disable-verbose],[Disable verbose strings]),
  3493. [ case "$enableval" in
  3494. no)
  3495. AC_MSG_RESULT(no)
  3496. AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
  3497. curl_verbose_msg="no"
  3498. ;;
  3499. *) AC_MSG_RESULT(yes)
  3500. ;;
  3501. esac ],
  3502. AC_MSG_RESULT(yes)
  3503. )
  3504. dnl ************************************************************
  3505. dnl enable SSPI support
  3506. dnl
  3507. AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
  3508. AC_ARG_ENABLE(sspi,
  3509. AS_HELP_STRING([--enable-sspi],[Enable SSPI])
  3510. AS_HELP_STRING([--disable-sspi],[Disable SSPI]),
  3511. [ case "$enableval" in
  3512. yes)
  3513. if test "$curl_cv_native_windows" = "yes"; then
  3514. AC_MSG_RESULT(yes)
  3515. AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
  3516. AC_SUBST(USE_WINDOWS_SSPI, [1])
  3517. curl_sspi_msg="enabled"
  3518. else
  3519. AC_MSG_RESULT(no)
  3520. AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
  3521. fi
  3522. ;;
  3523. *)
  3524. if test "x$SCHANNEL_ENABLED" = "x1"; then
  3525. # --with-schannel implies --enable-sspi
  3526. AC_MSG_RESULT(yes)
  3527. else
  3528. AC_MSG_RESULT(no)
  3529. fi
  3530. ;;
  3531. esac ],
  3532. if test "x$SCHANNEL_ENABLED" = "x1"; then
  3533. # --with-schannel implies --enable-sspi
  3534. AC_MSG_RESULT(yes)
  3535. else
  3536. AC_MSG_RESULT(no)
  3537. fi
  3538. )
  3539. dnl ************************************************************
  3540. dnl disable cryptographic authentication
  3541. dnl
  3542. AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
  3543. AC_ARG_ENABLE(crypto-auth,
  3544. AS_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
  3545. AS_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
  3546. [ case "$enableval" in
  3547. no)
  3548. AC_MSG_RESULT(no)
  3549. AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
  3550. CURL_DISABLE_CRYPTO_AUTH=1
  3551. ;;
  3552. *) AC_MSG_RESULT(yes)
  3553. ;;
  3554. esac ],
  3555. AC_MSG_RESULT(yes)
  3556. )
  3557. dnl ************************************************************
  3558. dnl disable NTLM support
  3559. dnl
  3560. AC_MSG_CHECKING([whether to support NTLM])
  3561. AC_ARG_ENABLE(ntlm,
  3562. AS_HELP_STRING([--enable-ntlm],[Enable NTLM support])
  3563. AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]),
  3564. [ case "$enableval" in
  3565. no)
  3566. AC_MSG_RESULT(no)
  3567. AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support])
  3568. CURL_DISABLE_NTLM=1
  3569. ;;
  3570. *) AC_MSG_RESULT(yes)
  3571. ;;
  3572. esac ],
  3573. AC_MSG_RESULT(yes)
  3574. )
  3575. CURL_CHECK_OPTION_NTLM_WB
  3576. CURL_CHECK_NTLM_WB
  3577. dnl ************************************************************
  3578. dnl disable TLS-SRP authentication
  3579. dnl
  3580. AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
  3581. AC_ARG_ENABLE(tls-srp,
  3582. AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
  3583. AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
  3584. [ case "$enableval" in
  3585. no)
  3586. AC_MSG_RESULT(no)
  3587. want_tls_srp=no
  3588. ;;
  3589. *) AC_MSG_RESULT(yes)
  3590. want_tls_srp=yes
  3591. ;;
  3592. esac ],
  3593. AC_MSG_RESULT(yes)
  3594. want_tls_srp=yes
  3595. )
  3596. if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
  3597. AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
  3598. USE_TLS_SRP=1
  3599. curl_tls_srp_msg="enabled"
  3600. fi
  3601. dnl ************************************************************
  3602. dnl disable Unix domain sockets support
  3603. dnl
  3604. AC_MSG_CHECKING([whether to enable Unix domain sockets])
  3605. AC_ARG_ENABLE(unix-sockets,
  3606. AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
  3607. AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
  3608. [ case "$enableval" in
  3609. no) AC_MSG_RESULT(no)
  3610. want_unix_sockets=no
  3611. ;;
  3612. *) AC_MSG_RESULT(yes)
  3613. want_unix_sockets=yes
  3614. ;;
  3615. esac ], [
  3616. AC_MSG_RESULT(auto)
  3617. want_unix_sockets=auto
  3618. ]
  3619. )
  3620. if test "x$want_unix_sockets" != "xno"; then
  3621. if test "x$curl_cv_native_windows" = "xyes"; then
  3622. USE_UNIX_SOCKETS=1
  3623. AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
  3624. curl_unix_sockets_msg="enabled"
  3625. else
  3626. AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
  3627. AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
  3628. AC_SUBST(USE_UNIX_SOCKETS, [1])
  3629. curl_unix_sockets_msg="enabled"
  3630. ], [
  3631. if test "x$want_unix_sockets" = "xyes"; then
  3632. AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
  3633. fi
  3634. ], [
  3635. #include <sys/un.h>
  3636. ])
  3637. fi
  3638. fi
  3639. dnl ************************************************************
  3640. dnl disable cookies support
  3641. dnl
  3642. AC_MSG_CHECKING([whether to support cookies])
  3643. AC_ARG_ENABLE(cookies,
  3644. AS_HELP_STRING([--enable-cookies],[Enable cookies support])
  3645. AS_HELP_STRING([--disable-cookies],[Disable cookies support]),
  3646. [ case "$enableval" in
  3647. no)
  3648. AC_MSG_RESULT(no)
  3649. AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
  3650. ;;
  3651. *) AC_MSG_RESULT(yes)
  3652. ;;
  3653. esac ],
  3654. AC_MSG_RESULT(yes)
  3655. )
  3656. dnl ************************************************************
  3657. dnl disable socketpair
  3658. dnl
  3659. AC_MSG_CHECKING([whether to support socketpair])
  3660. AC_ARG_ENABLE(socketpair,
  3661. AS_HELP_STRING([--enable-socketpair],[Enable socketpair support])
  3662. AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
  3663. [ case "$enableval" in
  3664. no)
  3665. AC_MSG_RESULT(no)
  3666. AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
  3667. ;;
  3668. *) AC_MSG_RESULT(yes)
  3669. ;;
  3670. esac ],
  3671. AC_MSG_RESULT(yes)
  3672. )
  3673. dnl ************************************************************
  3674. dnl disable HTTP authentication support
  3675. dnl
  3676. AC_MSG_CHECKING([whether to support HTTP authentication])
  3677. AC_ARG_ENABLE(http-auth,
  3678. AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
  3679. AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
  3680. [ case "$enableval" in
  3681. no)
  3682. AC_MSG_RESULT(no)
  3683. AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
  3684. ;;
  3685. *) AC_MSG_RESULT(yes)
  3686. ;;
  3687. esac ],
  3688. AC_MSG_RESULT(yes)
  3689. )
  3690. dnl ************************************************************
  3691. dnl disable DoH support
  3692. dnl
  3693. AC_MSG_CHECKING([whether to support DoH])
  3694. AC_ARG_ENABLE(doh,
  3695. AS_HELP_STRING([--enable-doh],[Enable DoH support])
  3696. AS_HELP_STRING([--disable-doh],[Disable DoH support]),
  3697. [ case "$enableval" in
  3698. no)
  3699. AC_MSG_RESULT(no)
  3700. AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
  3701. ;;
  3702. *) AC_MSG_RESULT(yes)
  3703. ;;
  3704. esac ],
  3705. AC_MSG_RESULT(yes)
  3706. )
  3707. dnl ************************************************************
  3708. dnl disable mime API support
  3709. dnl
  3710. AC_MSG_CHECKING([whether to support the MIME API])
  3711. AC_ARG_ENABLE(mime,
  3712. AS_HELP_STRING([--enable-mime],[Enable mime API support])
  3713. AS_HELP_STRING([--disable-mime],[Disable mime API support]),
  3714. [ case "$enableval" in
  3715. no)
  3716. AC_MSG_RESULT(no)
  3717. AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
  3718. ;;
  3719. *) AC_MSG_RESULT(yes)
  3720. ;;
  3721. esac ],
  3722. AC_MSG_RESULT(yes)
  3723. )
  3724. dnl ************************************************************
  3725. dnl disable date parsing
  3726. dnl
  3727. AC_MSG_CHECKING([whether to support date parsing])
  3728. AC_ARG_ENABLE(dateparse,
  3729. AS_HELP_STRING([--enable-dateparse],[Enable date parsing])
  3730. AS_HELP_STRING([--disable-dateparse],[Disable date parsing]),
  3731. [ case "$enableval" in
  3732. no)
  3733. AC_MSG_RESULT(no)
  3734. AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
  3735. ;;
  3736. *) AC_MSG_RESULT(yes)
  3737. ;;
  3738. esac ],
  3739. AC_MSG_RESULT(yes)
  3740. )
  3741. dnl ************************************************************
  3742. dnl disable netrc
  3743. dnl
  3744. AC_MSG_CHECKING([whether to support netrc parsing])
  3745. AC_ARG_ENABLE(netrc,
  3746. AS_HELP_STRING([--enable-netrc],[Enable netrc parsing])
  3747. AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
  3748. [ case "$enableval" in
  3749. no)
  3750. AC_MSG_RESULT(no)
  3751. AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
  3752. ;;
  3753. *) AC_MSG_RESULT(yes)
  3754. ;;
  3755. esac ],
  3756. AC_MSG_RESULT(yes)
  3757. )
  3758. dnl ************************************************************
  3759. dnl disable progress-meter
  3760. dnl
  3761. AC_MSG_CHECKING([whether to support progress-meter])
  3762. AC_ARG_ENABLE(progress-meter,
  3763. AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
  3764. AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
  3765. [ case "$enableval" in
  3766. no)
  3767. AC_MSG_RESULT(no)
  3768. AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
  3769. ;;
  3770. *) AC_MSG_RESULT(yes)
  3771. ;;
  3772. esac ],
  3773. AC_MSG_RESULT(yes)
  3774. )
  3775. dnl ************************************************************
  3776. dnl disable shuffle DNS support
  3777. dnl
  3778. AC_MSG_CHECKING([whether to support DNS shuffling])
  3779. AC_ARG_ENABLE(dnsshuffle,
  3780. AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
  3781. AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
  3782. [ case "$enableval" in
  3783. no)
  3784. AC_MSG_RESULT(no)
  3785. AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
  3786. ;;
  3787. *) AC_MSG_RESULT(yes)
  3788. ;;
  3789. esac ],
  3790. AC_MSG_RESULT(yes)
  3791. )
  3792. dnl ************************************************************
  3793. dnl disable the curl_easy_options API
  3794. dnl
  3795. AC_MSG_CHECKING([whether to support curl_easy_option*])
  3796. AC_ARG_ENABLE(get-easy-options,
  3797. AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
  3798. AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
  3799. [ case "$enableval" in
  3800. no)
  3801. AC_MSG_RESULT(no)
  3802. AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
  3803. ;;
  3804. *) AC_MSG_RESULT(yes)
  3805. ;;
  3806. esac ],
  3807. AC_MSG_RESULT(yes)
  3808. )
  3809. dnl ************************************************************
  3810. dnl switch on/off alt-svc
  3811. dnl
  3812. AC_MSG_CHECKING([whether to support alt-svc])
  3813. AC_ARG_ENABLE(alt-svc,
  3814. AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
  3815. AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
  3816. [ case "$enableval" in
  3817. no)
  3818. AC_MSG_RESULT(no)
  3819. AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
  3820. curl_altsvc_msg="no";
  3821. enable_altsvc="no"
  3822. ;;
  3823. *) AC_MSG_RESULT(yes)
  3824. ;;
  3825. esac ],
  3826. AC_MSG_RESULT(yes)
  3827. )
  3828. dnl ************************************************************
  3829. dnl switch on/off headers-api
  3830. dnl
  3831. AC_MSG_CHECKING([whether to support headers-api])
  3832. AC_ARG_ENABLE(headers-api,
  3833. AS_HELP_STRING([--enable-headers-api],[Enable headers-api support])
  3834. AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]),
  3835. [ case "$enableval" in
  3836. no) AC_MSG_RESULT(no)
  3837. curl_headers_msg="no (--enable-headers-api)"
  3838. AC_DEFINE(CURL_DISABLE_HEADERS_API, 1, [disable headers-api])
  3839. ;;
  3840. *)
  3841. AC_MSG_RESULT(yes)
  3842. ;;
  3843. esac ],
  3844. AC_MSG_RESULT(yes)
  3845. )
  3846. dnl only check for HSTS if there's SSL present
  3847. if test -n "$SSL_ENABLED"; then
  3848. dnl ************************************************************
  3849. dnl switch on/off hsts
  3850. dnl
  3851. AC_MSG_CHECKING([whether to support HSTS])
  3852. AC_ARG_ENABLE(hsts,
  3853. AS_HELP_STRING([--enable-hsts],[Enable HSTS support])
  3854. AS_HELP_STRING([--disable-hsts],[Disable HSTS support]),
  3855. [ case "$enableval" in
  3856. no)
  3857. AC_MSG_RESULT(no)
  3858. hsts="no"
  3859. ;;
  3860. *) AC_MSG_RESULT(yes)
  3861. ;;
  3862. esac ],
  3863. AC_MSG_RESULT($hsts)
  3864. )
  3865. else
  3866. AC_MSG_NOTICE([disables HSTS due to lack of SSL])
  3867. hsts="no"
  3868. fi
  3869. if test "x$hsts" != "xyes"; then
  3870. curl_hsts_msg="no (--enable-hsts)";
  3871. AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc])
  3872. fi
  3873. dnl *************************************************************
  3874. dnl check whether ECH support, if desired, is actually available
  3875. dnl
  3876. if test "x$want_ech" != "xno"; then
  3877. AC_MSG_CHECKING([whether ECH support is available])
  3878. dnl assume NOT and look for sufficient condition
  3879. ECH_ENABLED=0
  3880. ECH_SUPPORT=''
  3881. dnl OpenSSL with a chosen ECH function should be enough
  3882. dnl so more exhaustive checking seems unnecessary for now
  3883. if test "x$OPENSSL_ENABLED" = "x1"; then
  3884. AC_CHECK_FUNCS(SSL_get_ech_status,
  3885. ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
  3886. ECH_ENABLED=1)
  3887. dnl add 'elif' chain here for additional implementations
  3888. fi
  3889. dnl now deal with whatever we found
  3890. if test "x$ECH_ENABLED" = "x1"; then
  3891. AC_DEFINE(USE_ECH, 1, [if ECH support is available])
  3892. AC_MSG_RESULT($ECH_SUPPORT)
  3893. experimental="$experimental ECH"
  3894. else
  3895. AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
  3896. fi
  3897. fi
  3898. dnl *************************************************************
  3899. dnl check whether OpenSSL (lookalikes) have SSL_set0_wbio
  3900. dnl
  3901. if test "x$OPENSSL_ENABLED" = "x1"; then
  3902. AC_CHECK_FUNCS([SSL_set0_wbio])
  3903. fi
  3904. dnl *************************************************************
  3905. dnl WebSockets
  3906. dnl
  3907. AC_MSG_CHECKING([whether to support WebSockets])
  3908. AC_ARG_ENABLE(websockets,
  3909. AS_HELP_STRING([--enable-websockets],[Enable WebSockets support])
  3910. AS_HELP_STRING([--disable-websockets],[Disable WebSockets support]),
  3911. [ case "$enableval" in
  3912. no)
  3913. AC_MSG_RESULT(no)
  3914. ;;
  3915. *)
  3916. if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
  3917. AC_MSG_RESULT(yes)
  3918. curl_ws_msg="enabled"
  3919. AC_DEFINE_UNQUOTED(USE_WEBSOCKETS, [1], [enable websockets support])
  3920. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS"
  3921. if test "x$SSL_ENABLED" = "x1"; then
  3922. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WSS"
  3923. fi
  3924. experimental="$experimental Websockets"
  3925. else
  3926. dnl websockets requires >32 bit curl_off_t
  3927. AC_MSG_RESULT(no)
  3928. AC_MSG_WARN([Websockets disabled due to lack of >32 bit curl_off_t])
  3929. fi
  3930. ;;
  3931. esac ],
  3932. AC_MSG_RESULT(no)
  3933. )
  3934. dnl ************************************************************
  3935. dnl hiding of library internal symbols
  3936. dnl
  3937. CURL_CONFIGURE_SYMBOL_HIDING
  3938. dnl
  3939. dnl All the library dependencies put into $LIB apply to libcurl only.
  3940. dnl
  3941. LIBCURL_LIBS="$LIBS$PTHREAD"
  3942. AC_SUBST(LIBCURL_LIBS)
  3943. AC_SUBST(CURL_NETWORK_LIBS)
  3944. AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
  3945. dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
  3946. dnl LIBS variable used in generated makefile at makefile processing
  3947. dnl time. Doing this functionally prevents LIBS from being used for
  3948. dnl all link targets in given makefile.
  3949. BLANK_AT_MAKETIME=
  3950. AC_SUBST(BLANK_AT_MAKETIME)
  3951. AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
  3952. dnl yes or no
  3953. ENABLE_SHARED="$enable_shared"
  3954. AC_SUBST(ENABLE_SHARED)
  3955. dnl to let curl-config output the static libraries correctly
  3956. ENABLE_STATIC="$enable_static"
  3957. AC_SUBST(ENABLE_STATIC)
  3958. dnl merge the pkg-config Libs.private field into Libs when static-only
  3959. if test "x$enable_shared" = "xno"; then
  3960. LIBCURL_NO_SHARED=$LIBCURL_LIBS
  3961. else
  3962. LIBCURL_NO_SHARED=
  3963. fi
  3964. AC_SUBST(LIBCURL_NO_SHARED)
  3965. rm $compilersh
  3966. dnl
  3967. dnl For keeping supported features and protocols also in pkg-config file
  3968. dnl since it is more cross-compile friendly than curl-config
  3969. dnl
  3970. if test "x$OPENSSL_ENABLED" = "x1"; then
  3971. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  3972. elif test -n "$SSL_ENABLED"; then
  3973. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  3974. fi
  3975. if test "x$IPV6_ENABLED" = "x1"; then
  3976. SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
  3977. fi
  3978. if test "x$USE_UNIX_SOCKETS" = "x1"; then
  3979. SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
  3980. fi
  3981. if test "x$HAVE_LIBZ" = "x1"; then
  3982. SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
  3983. fi
  3984. if test "x$HAVE_BROTLI" = "x1"; then
  3985. SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
  3986. fi
  3987. if test "x$HAVE_ZSTD" = "x1"; then
  3988. SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
  3989. fi
  3990. if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
  3991. -o "x$USE_THREADS_WIN32" = "x1"; then
  3992. SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
  3993. fi
  3994. if test "x$IDN_ENABLED" = "x1"; then
  3995. SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
  3996. fi
  3997. if test "x$USE_WINDOWS_SSPI" = "x1"; then
  3998. SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
  3999. fi
  4000. if test "x$HAVE_GSSAPI" = "x1"; then
  4001. SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
  4002. fi
  4003. if test "x$curl_psl_msg" = "xenabled"; then
  4004. SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
  4005. fi
  4006. if test "x$curl_gsasl_msg" = "xenabled"; then
  4007. SUPPORT_FEATURES="$SUPPORT_FEATURES GSASL"
  4008. fi
  4009. if test "x$enable_altsvc" = "xyes"; then
  4010. SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
  4011. fi
  4012. if test "x$hsts" = "xyes"; then
  4013. SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS"
  4014. fi
  4015. if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
  4016. \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
  4017. SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
  4018. fi
  4019. if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
  4020. \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
  4021. SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
  4022. fi
  4023. use_curl_ntlm_core=no
  4024. if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
  4025. "x$CURL_DISABLE_NTLM" != "x1"; then
  4026. if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
  4027. -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
  4028. -o "x$SECURETRANSPORT_ENABLED" = "x1" \
  4029. -o "x$USE_WIN32_CRYPTO" = "x1" \
  4030. -o "x$WOLFSSL_NTLM" = "x1"; then
  4031. use_curl_ntlm_core=yes
  4032. fi
  4033. if test "x$use_curl_ntlm_core" = "xyes" \
  4034. -o "x$USE_WINDOWS_SSPI" = "x1"; then
  4035. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
  4036. if test "x$CURL_DISABLE_HTTP" != "x1" -a \
  4037. "x$NTLM_WB_ENABLED" = "x1"; then
  4038. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
  4039. fi
  4040. fi
  4041. fi
  4042. if test "x$USE_TLS_SRP" = "x1"; then
  4043. SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
  4044. fi
  4045. if test "x$USE_NGHTTP2" = "x1" -o "x$USE_HYPER" = "x1"; then
  4046. SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
  4047. fi
  4048. if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1" \
  4049. -o "x$USE_MSH3" = "x1"; then
  4050. SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
  4051. fi
  4052. if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
  4053. SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
  4054. fi
  4055. dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends
  4056. if test "x$https_proxy" != "xno"; then
  4057. if test "x$OPENSSL_ENABLED" = "x1" \
  4058. -o "x$GNUTLS_ENABLED" = "x1" \
  4059. -o "x$NSS_ENABLED" = "x1" \
  4060. -o "x$SECURETRANSPORT_ENABLED" = "x1" \
  4061. -o "x$RUSTLS_ENABLED" = "x1" \
  4062. -o "x$BEARSSL_ENABLED" = "x1" \
  4063. -o "x$SCHANNEL_ENABLED" = "x1" \
  4064. -o "x$GNUTLS_ENABLED" = "x1" \
  4065. -o "x$MBEDTLS_ENABLED" = "x1"; then
  4066. SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
  4067. elif test "x$WOLFSSL_ENABLED" = "x1" -a "x$WOLFSSL_FULL_BIO" = "x1"; then
  4068. SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
  4069. fi
  4070. fi
  4071. if test "x$ECH_ENABLED" = "x1"; then
  4072. SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
  4073. fi
  4074. if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
  4075. if test ${ac_cv_sizeof_off_t} -gt 4 -o \
  4076. "$curl_win32_file_api" = "win32_large_files"; then
  4077. SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile"
  4078. fi
  4079. fi
  4080. if test "$tst_atomic" = "yes"; then
  4081. SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
  4082. else
  4083. AC_COMPILE_IFELSE([
  4084. AC_LANG_PROGRAM([[
  4085. #include <windows.h>
  4086. ]],[[
  4087. #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
  4088. #error
  4089. #endif
  4090. ]])
  4091. ],[
  4092. SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
  4093. ],[
  4094. ])
  4095. fi
  4096. dnl replace spaces with newlines
  4097. dnl sort the lines
  4098. dnl replace the newlines back to spaces
  4099. SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
  4100. AC_SUBST(SUPPORT_FEATURES)
  4101. dnl For supported protocols in pkg-config file
  4102. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  4103. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
  4104. if test "x$SSL_ENABLED" = "x1"; then
  4105. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
  4106. fi
  4107. fi
  4108. if test "x$CURL_DISABLE_FTP" != "x1"; then
  4109. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
  4110. if test "x$SSL_ENABLED" = "x1"; then
  4111. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
  4112. fi
  4113. fi
  4114. if test "x$CURL_DISABLE_FILE" != "x1"; then
  4115. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
  4116. fi
  4117. if test "x$CURL_DISABLE_TELNET" != "x1"; then
  4118. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
  4119. fi
  4120. if test "x$CURL_DISABLE_LDAP" != "x1"; then
  4121. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
  4122. if test "x$CURL_DISABLE_LDAPS" != "x1"; then
  4123. if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
  4124. (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
  4125. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
  4126. fi
  4127. fi
  4128. fi
  4129. if test "x$CURL_DISABLE_DICT" != "x1"; then
  4130. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
  4131. fi
  4132. if test "x$CURL_DISABLE_TFTP" != "x1"; then
  4133. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
  4134. fi
  4135. if test "x$CURL_DISABLE_GOPHER" != "x1"; then
  4136. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
  4137. if test "x$SSL_ENABLED" = "x1"; then
  4138. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS"
  4139. fi
  4140. fi
  4141. if test "x$CURL_DISABLE_MQTT" != "x1"; then
  4142. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
  4143. fi
  4144. if test "x$CURL_DISABLE_POP3" != "x1"; then
  4145. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
  4146. if test "x$SSL_ENABLED" = "x1"; then
  4147. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
  4148. fi
  4149. fi
  4150. if test "x$CURL_DISABLE_IMAP" != "x1"; then
  4151. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
  4152. if test "x$SSL_ENABLED" = "x1"; then
  4153. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
  4154. fi
  4155. fi
  4156. if test "x$CURL_DISABLE_SMB" != "x1" \
  4157. -a "x$use_curl_ntlm_core" = "xyes"; then
  4158. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
  4159. if test "x$SSL_ENABLED" = "x1"; then
  4160. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
  4161. fi
  4162. fi
  4163. if test "x$CURL_DISABLE_SMTP" != "x1"; then
  4164. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
  4165. if test "x$SSL_ENABLED" = "x1"; then
  4166. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
  4167. fi
  4168. fi
  4169. if test "x$USE_LIBSSH2" = "x1"; then
  4170. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
  4171. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  4172. fi
  4173. if test "x$USE_LIBSSH" = "x1"; then
  4174. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
  4175. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  4176. fi
  4177. if test "x$USE_WOLFSSH" = "x1"; then
  4178. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  4179. fi
  4180. if test "x$CURL_DISABLE_RTSP" != "x1"; then
  4181. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
  4182. fi
  4183. if test "x$USE_LIBRTMP" = "x1"; then
  4184. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
  4185. fi
  4186. dnl replace spaces with newlines
  4187. dnl sort the lines
  4188. dnl replace the newlines back to spaces
  4189. SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
  4190. AC_SUBST(SUPPORT_PROTOCOLS)
  4191. dnl squeeze whitespace out of some variables
  4192. squeeze CFLAGS
  4193. squeeze CPPFLAGS
  4194. squeeze DEFS
  4195. squeeze LDFLAGS
  4196. squeeze LIBS
  4197. squeeze LIBCURL_LIBS
  4198. squeeze CURL_NETWORK_LIBS
  4199. squeeze CURL_NETWORK_AND_TIME_LIBS
  4200. squeeze SUPPORT_FEATURES
  4201. squeeze SUPPORT_PROTOCOLS
  4202. XC_CHECK_BUILD_FLAGS
  4203. SSL_BACKENDS=${ssl_backends}
  4204. AC_SUBST(SSL_BACKENDS)
  4205. if test "x$want_curldebug_assumed" = "xyes" &&
  4206. test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
  4207. ac_configure_args="$ac_configure_args --enable-curldebug"
  4208. fi
  4209. AC_CONFIG_FILES([Makefile \
  4210. docs/Makefile \
  4211. docs/examples/Makefile \
  4212. docs/libcurl/Makefile \
  4213. docs/libcurl/opts/Makefile \
  4214. docs/cmdline-opts/Makefile \
  4215. include/Makefile \
  4216. include/curl/Makefile \
  4217. src/Makefile \
  4218. lib/Makefile \
  4219. scripts/Makefile \
  4220. lib/libcurl.vers \
  4221. lib/libcurl.plist \
  4222. tests/Makefile \
  4223. tests/config \
  4224. tests/certs/Makefile \
  4225. tests/certs/scripts/Makefile \
  4226. tests/data/Makefile \
  4227. tests/server/Makefile \
  4228. tests/libtest/Makefile \
  4229. tests/unit/Makefile \
  4230. tests/http/config.ini \
  4231. tests/http/Makefile \
  4232. tests/http/clients/Makefile \
  4233. packages/Makefile \
  4234. packages/vms/Makefile \
  4235. curl-config \
  4236. libcurl.pc
  4237. ])
  4238. AC_OUTPUT
  4239. CURL_GENERATE_CONFIGUREHELP_PM
  4240. AC_MSG_NOTICE([Configured to build curl/libcurl:
  4241. Host setup: ${host}
  4242. Install prefix: ${prefix}
  4243. Compiler: ${CC}
  4244. CFLAGS: ${CFLAGS}
  4245. CPPFLAGS: ${CPPFLAGS}
  4246. LDFLAGS: ${LDFLAGS}
  4247. LIBS: ${LIBS}
  4248. curl version: ${CURLVERSION}
  4249. SSL: ${curl_ssl_msg}
  4250. SSH: ${curl_ssh_msg}
  4251. zlib: ${curl_zlib_msg}
  4252. brotli: ${curl_brotli_msg}
  4253. zstd: ${curl_zstd_msg}
  4254. GSS-API: ${curl_gss_msg}
  4255. GSASL: ${curl_gsasl_msg}
  4256. TLS-SRP: ${curl_tls_srp_msg}
  4257. resolver: ${curl_res_msg}
  4258. IPv6: ${curl_ipv6_msg}
  4259. Unix sockets: ${curl_unix_sockets_msg}
  4260. IDN: ${curl_idn_msg}
  4261. Build libcurl: Shared=${enable_shared}, Static=${enable_static}
  4262. Built-in manual: ${curl_manual_msg}
  4263. --libcurl option: ${curl_libcurl_msg}
  4264. Verbose errors: ${curl_verbose_msg}
  4265. Code coverage: ${curl_coverage_msg}
  4266. SSPI: ${curl_sspi_msg}
  4267. ca cert bundle: ${ca}${ca_warning}
  4268. ca cert path: ${capath}${capath_warning}
  4269. ca fallback: ${with_ca_fallback}
  4270. LDAP: ${curl_ldap_msg}
  4271. LDAPS: ${curl_ldaps_msg}
  4272. RTSP: ${curl_rtsp_msg}
  4273. RTMP: ${curl_rtmp_msg}
  4274. PSL: ${curl_psl_msg}
  4275. Alt-svc: ${curl_altsvc_msg}
  4276. Headers API: ${curl_headers_msg}
  4277. HSTS: ${curl_hsts_msg}
  4278. HTTP1: ${curl_h1_msg}
  4279. HTTP2: ${curl_h2_msg}
  4280. HTTP3: ${curl_h3_msg}
  4281. ECH: ${curl_ech_msg}
  4282. WebSockets: ${curl_ws_msg}
  4283. Protocols: ${SUPPORT_PROTOCOLS}
  4284. Features: ${SUPPORT_FEATURES}
  4285. ])
  4286. if test -n "$experimental"; then
  4287. cat >&2 << _EOF
  4288. WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!
  4289. _EOF
  4290. fi