2
0

configure.ac 139 KB

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