2
0

configure.ac 136 KB

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