configure.ac 124 KB

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