configure.ac 133 KB

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