configure.ac 146 KB

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