configure.ac 133 KB

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