configure.ac 140 KB

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