configure.ac 132 KB

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