configure.ac 136 KB

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