configure.ac 124 KB

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