configure.ac 161 KB

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