configure.ac 141 KB

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