configure.ac 123 KB

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