configure.ac 157 KB

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