2
0

configure.ac 129 KB

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