configure.ac 139 KB

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