You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.ac 114KB

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