configure.ac 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2011, 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 http://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: http://curl.haxx.se/mail/])
  26. CURL_OVERRIDE_AUTOCONF
  27. dnl configure script copyright
  28. AC_COPYRIGHT([Copyright (c) 1998 - 2011 Daniel Stenberg, <daniel@haxx.se>
  29. This configure script may be copied, distributed and modified under the
  30. terms of the curl license; see COPYING for more details])
  31. AC_CONFIG_SRCDIR([lib/urldata.h])
  32. AM_CONFIG_HEADER(lib/curl_config.h src/curl_config.h include/curl/curlbuild.h)
  33. AC_CONFIG_MACRO_DIR([m4])
  34. AM_MAINTAINER_MODE
  35. CURL_CHECK_OPTION_DEBUG
  36. CURL_CHECK_OPTION_OPTIMIZE
  37. CURL_CHECK_OPTION_WARNINGS
  38. CURL_CHECK_OPTION_WERROR
  39. CURL_CHECK_OPTION_CURLDEBUG
  40. CURL_CHECK_OPTION_ARES
  41. CURL_CHECK_PATH_SEPARATOR_REQUIRED
  42. #
  43. # save the configure arguments
  44. #
  45. CONFIGURE_OPTIONS="\"$ac_configure_args\""
  46. AC_SUBST(CONFIGURE_OPTIONS)
  47. CURL_CFLAG_EXTRAS=""
  48. if test X"$want_werror" = Xyes; then
  49. CURL_CFLAG_EXTRAS="-Werror"
  50. fi
  51. AC_SUBST(CURL_CFLAG_EXTRAS)
  52. dnl SED is mandatory for configure process and libtool.
  53. dnl Set it now, allowing it to be changed later.
  54. if test -z "$SED"; then
  55. dnl allow it to be overridden
  56. AC_PATH_PROG([SED], [sed], [not_found],
  57. [$PATH:/usr/bin:/usr/local/bin])
  58. if test -z "$SED" || test "$SED" = "not_found"; then
  59. AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
  60. fi
  61. fi
  62. AC_SUBST([SED])
  63. dnl GREP is mandatory for configure process and libtool.
  64. dnl Set it now, allowing it to be changed later.
  65. if test -z "$GREP"; then
  66. dnl allow it to be overridden
  67. AC_PATH_PROG([GREP], [grep], [not_found],
  68. [$PATH:/usr/bin:/usr/local/bin])
  69. if test -z "$GREP" || test "$GREP" = "not_found"; then
  70. AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
  71. fi
  72. fi
  73. AC_SUBST([GREP])
  74. dnl EGREP is mandatory for configure process and libtool.
  75. dnl Set it now, allowing it to be changed later.
  76. if test -z "$EGREP"; then
  77. dnl allow it to be overridden
  78. if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
  79. AC_MSG_CHECKING([for egrep])
  80. EGREP="$GREP -E"
  81. AC_MSG_RESULT([$EGREP])
  82. else
  83. AC_PATH_PROG([EGREP], [egrep], [not_found],
  84. [$PATH:/usr/bin:/usr/local/bin])
  85. fi
  86. fi
  87. if test -z "$EGREP" || test "$EGREP" = "not_found"; then
  88. AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
  89. fi
  90. AC_SUBST([EGREP])
  91. dnl AR is mandatory for configure process and libtool.
  92. dnl This is target dependent, so check it as a tool.
  93. if test -z "$AR"; then
  94. dnl allow it to be overridden
  95. AC_PATH_TOOL([AR], [ar], [not_found],
  96. [$PATH:/usr/bin:/usr/local/bin])
  97. if test -z "$AR" || test "$AR" = "not_found"; then
  98. AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
  99. fi
  100. fi
  101. AC_SUBST([AR])
  102. AC_SUBST(libext)
  103. dnl Remove non-configure distributed curlbuild.h
  104. if test -f ${srcdir}/include/curl/curlbuild.h; then
  105. rm -f ${srcdir}/include/curl/curlbuild.h
  106. fi
  107. dnl figure out the libcurl version
  108. CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
  109. AM_INIT_AUTOMAKE
  110. AC_MSG_CHECKING([curl version])
  111. AC_MSG_RESULT($CURLVERSION)
  112. AC_SUBST(CURLVERSION)
  113. dnl
  114. dnl we extract the numerical version for curl-config only
  115. VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
  116. AC_SUBST(VERSIONNUM)
  117. dnl Solaris pkgadd support definitions
  118. PKGADD_PKG="HAXXcurl"
  119. PKGADD_NAME="cURL - a client that groks URLs"
  120. PKGADD_VENDOR="curl.haxx.se"
  121. AC_SUBST(PKGADD_PKG)
  122. AC_SUBST(PKGADD_NAME)
  123. AC_SUBST(PKGADD_VENDOR)
  124. dnl
  125. dnl initialize all the info variables
  126. curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,cyassl,axtls} )"
  127. curl_ssh_msg="no (--with-libssh2)"
  128. curl_zlib_msg="no (--with-zlib)"
  129. curl_krb4_msg="no (--with-krb4*)"
  130. curl_gss_msg="no (--with-gssapi)"
  131. curl_spnego_msg="no (--with-spnego)"
  132. curl_tls_srp_msg="no (--enable-tls-srp)"
  133. curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
  134. curl_ipv6_msg="no (--enable-ipv6)"
  135. curl_idn_msg="no (--with-libidn)"
  136. curl_manual_msg="no (--enable-manual)"
  137. curl_verbose_msg="enabled (--disable-verbose)"
  138. curl_sspi_msg="no (--enable-sspi)"
  139. curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
  140. curl_ldaps_msg="no (--enable-ldaps)"
  141. curl_rtsp_msg="no (--enable-rtsp)"
  142. curl_rtmp_msg="no (--with-librtmp)"
  143. init_ssl_msg=${curl_ssl_msg}
  144. dnl
  145. dnl Save anything in $LIBS for later
  146. dnl
  147. ALL_LIBS=$LIBS
  148. dnl
  149. dnl Detect the canonical host and target build environment
  150. dnl
  151. AC_CANONICAL_HOST
  152. dnl Get system canonical name
  153. AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
  154. dnl Checks for programs.
  155. CURL_CHECK_PROG_CC
  156. dnl Our curl_off_t internal and external configure settings
  157. CURL_CONFIGURE_CURL_OFF_T
  158. dnl This defines _ALL_SOURCE for AIX
  159. CURL_CHECK_AIX_ALL_SOURCE
  160. dnl Our configure and build reentrant settings
  161. CURL_CONFIGURE_THREAD_SAFE
  162. CURL_CONFIGURE_REENTRANT
  163. dnl check for how to do large files
  164. AC_SYS_LARGEFILE
  165. dnl support building of Windows DLLs
  166. AC_LIBTOOL_WIN32_DLL
  167. dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
  168. AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
  169. case $host in
  170. x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
  171. AC_MSG_RESULT([yes])
  172. with_pic=yes
  173. ;;
  174. *)
  175. AC_MSG_RESULT([no])
  176. ;;
  177. esac
  178. AC_MSG_CHECKING([if compiler is icc (to build with PIC)])
  179. case $CC in
  180. icc | */icc)
  181. AC_MSG_RESULT([yes])
  182. with_pic=yes
  183. ;;
  184. *)
  185. AC_MSG_RESULT([no])
  186. ;;
  187. esac
  188. dnl libtool setup
  189. AC_PROG_LIBTOOL
  190. AC_MSG_CHECKING([if we need -mimpure-text])
  191. mimpure=no
  192. case $host in
  193. *-*-solaris2*)
  194. if test "$GCC" = "yes"; then
  195. mimpure="yes"
  196. fi
  197. ;;
  198. *)
  199. ;;
  200. esac
  201. AC_MSG_RESULT($mimpure)
  202. AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
  203. dnl 'STATICLIB' is, in spite of its name, not generic but only for static-only
  204. dnl builds on Windows
  205. AM_CONDITIONAL(STATICLIB, false)
  206. AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
  207. case $host in
  208. *-*-mingw*)
  209. AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
  210. AC_MSG_RESULT(yes)
  211. AC_MSG_CHECKING([if we need CURL_STATICLIB])
  212. if test "X$enable_shared" = "Xno"
  213. then
  214. AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
  215. AC_MSG_RESULT(yes)
  216. AM_CONDITIONAL(STATICLIB, true)
  217. else
  218. AC_MSG_RESULT(no)
  219. fi
  220. ;;
  221. *)
  222. AC_MSG_RESULT(no)
  223. ;;
  224. esac
  225. # Determine whether all dependent libraries must be specified when linking
  226. if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
  227. then
  228. REQUIRE_LIB_DEPS=no
  229. else
  230. REQUIRE_LIB_DEPS=yes
  231. fi
  232. AC_SUBST(REQUIRE_LIB_DEPS)
  233. dnl The install stuff has already been taken care of by the automake stuff
  234. dnl AC_PROG_INSTALL
  235. AC_PROG_MAKE_SET
  236. dnl check if there's a way to force code inline
  237. AC_C_INLINE
  238. dnl **********************************************************************
  239. dnl platform/compiler/architecture specific checks/flags
  240. dnl **********************************************************************
  241. CURL_CHECK_COMPILER
  242. CURL_SET_COMPILER_BASIC_OPTS
  243. CURL_SET_COMPILER_DEBUG_OPTS
  244. CURL_SET_COMPILER_OPTIMIZE_OPTS
  245. CURL_SET_COMPILER_WARNING_OPTS
  246. if test "$compiler_id" = "INTEL_UNIX_C"; then
  247. #
  248. if test "$compiler_num" -ge "1000"; then
  249. dnl icc 10.X or later
  250. CFLAGS="$CFLAGS -shared-intel"
  251. elif test "$compiler_num" -ge "900"; then
  252. dnl icc 9.X specific
  253. CFLAGS="$CFLAGS -i-dynamic"
  254. fi
  255. #
  256. fi
  257. CURL_CHECK_COMPILER_HALT_ON_ERROR
  258. CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
  259. CURL_CHECK_NO_UNDEFINED
  260. AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
  261. CURL_CHECK_CURLDEBUG
  262. AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
  263. supports_unittests=yes
  264. # cross-compilation of unit tests static library/programs fails when
  265. # libcurl shared library is built. This might be due to a libtool or
  266. # automake issue. In this case we disable unit tests.
  267. if test "x$cross_compiling" != "xno" &&
  268. test "x$enable_shared" != "xno"; then
  269. supports_unittests=no
  270. fi
  271. # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
  272. # a problem related with OpenSSL headers and library versions not matching.
  273. # Disable unit tests while time to further investigate this is found.
  274. case $host in
  275. mips-sgi-irix6.5)
  276. if test "$compiler_id" = "GNU_C"; then
  277. supports_unittests=no
  278. fi
  279. ;;
  280. esac
  281. # All AIX autobuilds fails unit tests linking against unittests library
  282. # due to unittests library being built with no symbols or members. Libtool ?
  283. # Disable unit tests while time to further investigate this is found.
  284. case $host_os in
  285. aix*)
  286. supports_unittests=no
  287. ;;
  288. esac
  289. dnl Build unit tests when option --enable-debug is given.
  290. if test "x$want_debug" = "xyes" &&
  291. test "x$supports_unittests" = "xyes"; then
  292. want_unittests=yes
  293. else
  294. want_unittests=no
  295. fi
  296. AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
  297. dnl **********************************************************************
  298. dnl Compilation based checks should not be done before this point.
  299. dnl **********************************************************************
  300. dnl **********************************************************************
  301. dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
  302. dnl and ws2tcpip.h take precedence over any other further checks which
  303. dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
  304. dnl this specific header files. And do them before its results are used.
  305. dnl **********************************************************************
  306. CURL_CHECK_HEADER_WINDOWS
  307. CURL_CHECK_NATIVE_WINDOWS
  308. case X-"$ac_cv_native_windows" in
  309. X-yes)
  310. CURL_CHECK_HEADER_WINSOCK
  311. CURL_CHECK_HEADER_WINSOCK2
  312. CURL_CHECK_HEADER_WS2TCPIP
  313. CURL_CHECK_HEADER_WINLDAP
  314. CURL_CHECK_HEADER_WINBER
  315. ;;
  316. *)
  317. ac_cv_header_winsock_h="no"
  318. ac_cv_header_winsock2_h="no"
  319. ac_cv_header_ws2tcpip_h="no"
  320. ac_cv_header_winldap_h="no"
  321. ac_cv_header_winber_h="no"
  322. ;;
  323. esac
  324. CURL_CHECK_WIN32_LARGEFILE
  325. dnl ************************************************************
  326. dnl switch off particular protocols
  327. dnl
  328. AC_MSG_CHECKING([whether to support http])
  329. AC_ARG_ENABLE(http,
  330. AC_HELP_STRING([--enable-http],[Enable HTTP support])
  331. AC_HELP_STRING([--disable-http],[Disable HTTP support]),
  332. [ case "$enableval" in
  333. no)
  334. AC_MSG_RESULT(no)
  335. AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
  336. AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
  337. AC_SUBST(CURL_DISABLE_HTTP, [1])
  338. AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
  339. AC_SUBST(CURL_DISABLE_RTSP, [1])
  340. ;;
  341. *) AC_MSG_RESULT(yes)
  342. ;;
  343. esac ],
  344. AC_MSG_RESULT(yes)
  345. )
  346. AC_MSG_CHECKING([whether to support ftp])
  347. AC_ARG_ENABLE(ftp,
  348. AC_HELP_STRING([--enable-ftp],[Enable FTP support])
  349. AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
  350. [ case "$enableval" in
  351. no)
  352. AC_MSG_RESULT(no)
  353. AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
  354. AC_SUBST(CURL_DISABLE_FTP, [1])
  355. ;;
  356. *) AC_MSG_RESULT(yes)
  357. ;;
  358. esac ],
  359. AC_MSG_RESULT(yes)
  360. )
  361. AC_MSG_CHECKING([whether to support file])
  362. AC_ARG_ENABLE(file,
  363. AC_HELP_STRING([--enable-file],[Enable FILE support])
  364. AC_HELP_STRING([--disable-file],[Disable FILE support]),
  365. [ case "$enableval" in
  366. no)
  367. AC_MSG_RESULT(no)
  368. AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
  369. AC_SUBST(CURL_DISABLE_FILE, [1])
  370. ;;
  371. *) AC_MSG_RESULT(yes)
  372. ;;
  373. esac ],
  374. AC_MSG_RESULT(yes)
  375. )
  376. AC_MSG_CHECKING([whether to support ldap])
  377. AC_ARG_ENABLE(ldap,
  378. AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
  379. AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
  380. [ case "$enableval" in
  381. no)
  382. AC_MSG_RESULT(no)
  383. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  384. AC_SUBST(CURL_DISABLE_LDAP, [1])
  385. ;;
  386. *)
  387. AC_MSG_RESULT(yes)
  388. ;;
  389. esac ],[
  390. AC_MSG_RESULT(yes) ]
  391. )
  392. AC_MSG_CHECKING([whether to support ldaps])
  393. AC_ARG_ENABLE(ldaps,
  394. AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
  395. AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
  396. [ case "$enableval" in
  397. no)
  398. AC_MSG_RESULT(no)
  399. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  400. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  401. ;;
  402. *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
  403. AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
  404. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  405. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  406. else
  407. AC_MSG_RESULT(yes)
  408. AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
  409. AC_SUBST(HAVE_LDAP_SSL, [1])
  410. fi
  411. ;;
  412. esac ],[
  413. if test "x$CURL_DISABLE_LDAP" = "x1" ; then
  414. AC_MSG_RESULT(no)
  415. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  416. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  417. else
  418. AC_MSG_RESULT(yes)
  419. AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
  420. AC_SUBST(HAVE_LDAP_SSL, [1])
  421. fi ]
  422. )
  423. AC_MSG_CHECKING([whether to support rtsp])
  424. AC_ARG_ENABLE(rtsp,
  425. AC_HELP_STRING([--enable-rtsp],[Enable RTSP support])
  426. AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
  427. [ case "$enableval" in
  428. no)
  429. AC_MSG_RESULT(no)
  430. AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
  431. AC_SUBST(CURL_DISABLE_RTSP, [1])
  432. ;;
  433. *) if test x$CURL_DISABLE_HTTP = x1 ; then
  434. AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
  435. else
  436. AC_MSG_RESULT(yes)
  437. curl_rtsp_msg="enabled"
  438. fi
  439. ;;
  440. esac ],
  441. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  442. AC_MSG_RESULT(yes)
  443. curl_rtsp_msg="enabled"
  444. else
  445. AC_MSG_RESULT(no)
  446. fi
  447. )
  448. AC_MSG_CHECKING([whether to support proxies])
  449. AC_ARG_ENABLE(proxy,
  450. AC_HELP_STRING([--enable-proxy],[Enable proxy support])
  451. AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
  452. [ case "$enableval" in
  453. no)
  454. AC_MSG_RESULT(no)
  455. AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
  456. AC_SUBST(CURL_DISABLE_PROXY, [1])
  457. ;;
  458. *) AC_MSG_RESULT(yes)
  459. ;;
  460. esac ],
  461. AC_MSG_RESULT(yes)
  462. )
  463. AC_MSG_CHECKING([whether to support dict])
  464. AC_ARG_ENABLE(dict,
  465. AC_HELP_STRING([--enable-dict],[Enable DICT support])
  466. AC_HELP_STRING([--disable-dict],[Disable DICT support]),
  467. [ case "$enableval" in
  468. no)
  469. AC_MSG_RESULT(no)
  470. AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
  471. AC_SUBST(CURL_DISABLE_DICT, [1])
  472. ;;
  473. *) AC_MSG_RESULT(yes)
  474. ;;
  475. esac ],
  476. AC_MSG_RESULT(yes)
  477. )
  478. AC_MSG_CHECKING([whether to support telnet])
  479. AC_ARG_ENABLE(telnet,
  480. AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
  481. AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
  482. [ case "$enableval" in
  483. no)
  484. AC_MSG_RESULT(no)
  485. AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
  486. AC_SUBST(CURL_DISABLE_TELNET, [1])
  487. ;;
  488. *) AC_MSG_RESULT(yes)
  489. ;;
  490. esac ],
  491. AC_MSG_RESULT(yes)
  492. )
  493. AC_MSG_CHECKING([whether to support tftp])
  494. AC_ARG_ENABLE(tftp,
  495. AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
  496. AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
  497. [ case "$enableval" in
  498. no)
  499. AC_MSG_RESULT(no)
  500. AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
  501. AC_SUBST(CURL_DISABLE_TFTP, [1])
  502. ;;
  503. *) AC_MSG_RESULT(yes)
  504. ;;
  505. esac ],
  506. AC_MSG_RESULT(yes)
  507. )
  508. AC_MSG_CHECKING([whether to support pop3])
  509. AC_ARG_ENABLE(pop3,
  510. AC_HELP_STRING([--enable-pop3],[Enable POP3 support])
  511. AC_HELP_STRING([--disable-pop3],[Disable POP3 support]),
  512. [ case "$enableval" in
  513. no)
  514. AC_MSG_RESULT(no)
  515. AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
  516. AC_SUBST(CURL_DISABLE_POP3, [1])
  517. ;;
  518. *) AC_MSG_RESULT(yes)
  519. ;;
  520. esac ],
  521. AC_MSG_RESULT(yes)
  522. )
  523. AC_MSG_CHECKING([whether to support imap])
  524. AC_ARG_ENABLE(imap,
  525. AC_HELP_STRING([--enable-imap],[Enable IMAP support])
  526. AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
  527. [ case "$enableval" in
  528. no)
  529. AC_MSG_RESULT(no)
  530. AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
  531. AC_SUBST(CURL_DISABLE_IMAP, [1])
  532. ;;
  533. *) AC_MSG_RESULT(yes)
  534. ;;
  535. esac ],
  536. AC_MSG_RESULT(yes)
  537. )
  538. AC_MSG_CHECKING([whether to support smtp])
  539. AC_ARG_ENABLE(smtp,
  540. AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
  541. AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
  542. [ case "$enableval" in
  543. no)
  544. AC_MSG_RESULT(no)
  545. AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
  546. AC_SUBST(CURL_DISABLE_SMTP, [1])
  547. ;;
  548. *) AC_MSG_RESULT(yes)
  549. ;;
  550. esac ],
  551. AC_MSG_RESULT(yes)
  552. )
  553. AC_MSG_CHECKING([whether to support gopher])
  554. AC_ARG_ENABLE(gopher,
  555. AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
  556. AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
  557. [ case "$enableval" in
  558. no)
  559. AC_MSG_RESULT(no)
  560. AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
  561. AC_SUBST(CURL_DISABLE_GOPHER, [1])
  562. ;;
  563. *) AC_MSG_RESULT(yes)
  564. ;;
  565. esac ],
  566. AC_MSG_RESULT(yes)
  567. )
  568. dnl **********************************************************************
  569. dnl Check for built-in manual
  570. dnl **********************************************************************
  571. AC_MSG_CHECKING([whether to provide built-in manual])
  572. AC_ARG_ENABLE(manual,
  573. AC_HELP_STRING([--enable-manual],[Enable built-in manual])
  574. AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
  575. [ case "$enableval" in
  576. no)
  577. AC_MSG_RESULT(no)
  578. ;;
  579. *) AC_MSG_RESULT(yes)
  580. USE_MANUAL="1"
  581. ;;
  582. esac ],
  583. AC_MSG_RESULT(yes)
  584. USE_MANUAL="1"
  585. )
  586. dnl The actual use of the USE_MANUAL variable is done much later in this
  587. dnl script to allow other actions to disable it as well.
  588. dnl **********************************************************************
  589. dnl Checks for libraries.
  590. dnl **********************************************************************
  591. CURL_CHECK_LIB_XNET
  592. dnl gethostbyname without lib or in the nsl lib?
  593. AC_CHECK_FUNC(gethostbyname,
  594. [HAVE_GETHOSTBYNAME="1"
  595. ],
  596. [ AC_CHECK_LIB(nsl, gethostbyname,
  597. [HAVE_GETHOSTBYNAME="1"
  598. LIBS="$LIBS -lnsl"
  599. ])
  600. ])
  601. if test "$HAVE_GETHOSTBYNAME" != "1"
  602. then
  603. dnl gethostbyname in the socket lib?
  604. AC_CHECK_LIB(socket, gethostbyname,
  605. [HAVE_GETHOSTBYNAME="1"
  606. LIBS="$LIBS -lsocket"
  607. ])
  608. fi
  609. dnl At least one system has been identified to require BOTH nsl and socket
  610. dnl libs at the same time to link properly.
  611. if test "$HAVE_GETHOSTBYNAME" != "1"
  612. then
  613. AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
  614. my_ac_save_LIBS=$LIBS
  615. LIBS="-lnsl -lsocket $LIBS"
  616. AC_LINK_IFELSE([
  617. AC_LANG_PROGRAM([[
  618. ]],[[
  619. gethostbyname();
  620. ]])
  621. ],[
  622. AC_MSG_RESULT([yes])
  623. HAVE_GETHOSTBYNAME="1"
  624. ],[
  625. AC_MSG_RESULT([no])
  626. LIBS=$my_ac_save_LIBS
  627. ])
  628. fi
  629. if test "$HAVE_GETHOSTBYNAME" != "1"
  630. then
  631. dnl This is for winsock systems
  632. if test "$ac_cv_header_windows_h" = "yes"; then
  633. if test "$ac_cv_header_winsock_h" = "yes"; then
  634. case $host in
  635. *-*-mingw32ce*)
  636. winsock_LIB="-lwinsock"
  637. ;;
  638. *)
  639. winsock_LIB="-lwsock32"
  640. ;;
  641. esac
  642. fi
  643. if test "$ac_cv_header_winsock2_h" = "yes"; then
  644. winsock_LIB="-lws2_32"
  645. fi
  646. if test ! -z "$winsock_LIB"; then
  647. my_ac_save_LIBS=$LIBS
  648. LIBS="$winsock_LIB $LIBS"
  649. AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
  650. AC_LINK_IFELSE([
  651. AC_LANG_PROGRAM([[
  652. #ifdef HAVE_WINDOWS_H
  653. #ifndef WIN32_LEAN_AND_MEAN
  654. #define WIN32_LEAN_AND_MEAN
  655. #endif
  656. #include <windows.h>
  657. #ifdef HAVE_WINSOCK2_H
  658. #include <winsock2.h>
  659. #else
  660. #ifdef HAVE_WINSOCK_H
  661. #include <winsock.h>
  662. #endif
  663. #endif
  664. #endif
  665. ]],[[
  666. gethostbyname("www.dummysite.com");
  667. ]])
  668. ],[
  669. AC_MSG_RESULT([yes])
  670. HAVE_GETHOSTBYNAME="1"
  671. ],[
  672. AC_MSG_RESULT([no])
  673. winsock_LIB=""
  674. LIBS=$my_ac_save_LIBS
  675. ])
  676. fi
  677. fi
  678. fi
  679. if test "$HAVE_GETHOSTBYNAME" != "1"
  680. then
  681. dnl This is for Minix 3.1
  682. AC_MSG_CHECKING([for gethostbyname for Minix 3])
  683. AC_LINK_IFELSE([
  684. AC_LANG_PROGRAM([[
  685. /* Older Minix versions may need <net/gen/netdb.h> here instead */
  686. #include <netdb.h>
  687. ]],[[
  688. gethostbyname("www.dummysite.com");
  689. ]])
  690. ],[
  691. AC_MSG_RESULT([yes])
  692. HAVE_GETHOSTBYNAME="1"
  693. ],[
  694. AC_MSG_RESULT([no])
  695. ])
  696. fi
  697. if test "$HAVE_GETHOSTBYNAME" != "1"
  698. then
  699. dnl This is for eCos with a stubbed DNS implementation
  700. AC_MSG_CHECKING([for gethostbyname for eCos])
  701. AC_LINK_IFELSE([
  702. AC_LANG_PROGRAM([[
  703. #include <stdio.h>
  704. #include <netdb.h>
  705. ]],[[
  706. gethostbyname("www.dummysite.com");
  707. ]])
  708. ],[
  709. AC_MSG_RESULT([yes])
  710. HAVE_GETHOSTBYNAME="1"
  711. ],[
  712. AC_MSG_RESULT([no])
  713. ])
  714. fi
  715. if test "$HAVE_GETHOSTBYNAME" != "1"
  716. then
  717. dnl gethostbyname in the network lib - for Haiku OS
  718. AC_CHECK_LIB(network, gethostbyname,
  719. [HAVE_GETHOSTBYNAME="1"
  720. LIBS="$LIBS -lnetwork"
  721. ])
  722. fi
  723. if test "$HAVE_GETHOSTBYNAME" != "1"
  724. then
  725. dnl gethostbyname in the net lib - for BeOS
  726. AC_CHECK_LIB(net, gethostbyname,
  727. [HAVE_GETHOSTBYNAME="1"
  728. LIBS="$LIBS -lnet"
  729. ])
  730. fi
  731. if test "$HAVE_GETHOSTBYNAME" != "1"; then
  732. AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
  733. fi
  734. dnl resolve lib?
  735. AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
  736. if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
  737. AC_CHECK_LIB(resolve, strcasecmp,
  738. [LIBS="-lresolve $LIBS"],
  739. ,
  740. -lnsl)
  741. fi
  742. ac_cv_func_strcasecmp="no"
  743. CURL_CHECK_LIBS_CONNECT
  744. CURL_NETWORK_LIBS=$LIBS
  745. dnl **********************************************************************
  746. dnl In case that function clock_gettime with monotonic timer is available,
  747. dnl check for additional required libraries.
  748. dnl **********************************************************************
  749. CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
  750. dnl **********************************************************************
  751. dnl The preceding library checks are all potentially useful for test
  752. dnl servers (for providing networking support). Save the list of required
  753. dnl libraries at this point for use while linking those test servers.
  754. dnl **********************************************************************
  755. TEST_SERVER_LIBS=$LIBS
  756. dnl **********************************************************************
  757. AC_MSG_CHECKING([whether to use libgcc])
  758. AC_ARG_ENABLE(libgcc,
  759. AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
  760. [ case "$enableval" in
  761. yes)
  762. ALL_LIBS="$ALL_LIBS -lgcc"
  763. AC_MSG_RESULT(yes)
  764. ;;
  765. *) AC_MSG_RESULT(no)
  766. ;;
  767. esac ],
  768. AC_MSG_RESULT(no)
  769. )
  770. dnl **********************************************************************
  771. dnl Check for LDAP
  772. dnl **********************************************************************
  773. LDAPLIBNAME=""
  774. AC_ARG_WITH(ldap-lib,
  775. AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
  776. [LDAPLIBNAME="$withval"])
  777. LBERLIBNAME=""
  778. AC_ARG_WITH(lber-lib,
  779. AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
  780. [LBERLIBNAME="$withval"])
  781. if test x$CURL_DISABLE_LDAP != x1 ; then
  782. CURL_CHECK_HEADER_LBER
  783. CURL_CHECK_HEADER_LDAP
  784. CURL_CHECK_HEADER_LDAPSSL
  785. CURL_CHECK_HEADER_LDAP_SSL
  786. if test -z "$LDAPLIBNAME" ; then
  787. if test "$ac_cv_native_windows" = "yes"; then
  788. dnl Windows uses a single and unique LDAP library name
  789. LDAPLIBNAME="wldap32"
  790. LBERLIBNAME="no"
  791. fi
  792. fi
  793. if test "$LDAPLIBNAME" ; then
  794. AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
  795. AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
  796. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  797. AC_SUBST(CURL_DISABLE_LDAP, [1])])
  798. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  799. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  800. else
  801. dnl Try to find the right ldap libraries for this system
  802. CURL_CHECK_LIBS_LDAP
  803. case X-"$curl_cv_ldap_LIBS" in
  804. X-unknown)
  805. AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
  806. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  807. AC_SUBST(CURL_DISABLE_LDAP, [1])
  808. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  809. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  810. ;;
  811. esac
  812. fi
  813. fi
  814. if test x$CURL_DISABLE_LDAP != x1 ; then
  815. if test "$LBERLIBNAME" ; then
  816. dnl If name is "no" then don't define this library at all
  817. dnl (it's only needed if libldap.so's dependencies are broken).
  818. if test "$LBERLIBNAME" != "no" ; then
  819. AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
  820. AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
  821. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  822. AC_SUBST(CURL_DISABLE_LDAP, [1])])
  823. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  824. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  825. fi
  826. fi
  827. fi
  828. if test x$CURL_DISABLE_LDAP != x1 ; then
  829. AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
  830. if test "$LDAPLIBNAME" = "wldap32"; then
  831. curl_ldap_msg="enabled (winldap)"
  832. AC_DEFINE(CURL_LDAP_WIN, 1, [Use Windows LDAP implementation])
  833. else
  834. curl_ldap_msg="enabled (OpenLDAP)"
  835. if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
  836. AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
  837. AC_SUBST(USE_OPENLDAP, [1])
  838. fi
  839. fi
  840. fi
  841. if test x$CURL_DISABLE_LDAPS != x1 ; then
  842. curl_ldaps_msg="enabled"
  843. fi
  844. dnl **********************************************************************
  845. dnl Checks for IPv6
  846. dnl **********************************************************************
  847. AC_MSG_CHECKING([whether to enable ipv6])
  848. AC_ARG_ENABLE(ipv6,
  849. AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
  850. AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
  851. [ case "$enableval" in
  852. no)
  853. AC_MSG_RESULT(no)
  854. ipv6=no
  855. ;;
  856. *) AC_MSG_RESULT(yes)
  857. ipv6=yes
  858. ;;
  859. esac ],
  860. AC_TRY_RUN([ /* is AF_INET6 available? */
  861. #include <sys/types.h>
  862. #include <sys/socket.h>
  863. main()
  864. {
  865. if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
  866. exit(1);
  867. else
  868. exit(0);
  869. }
  870. ],
  871. AC_MSG_RESULT(yes)
  872. ipv6=yes,
  873. AC_MSG_RESULT(no)
  874. ipv6=no,
  875. AC_MSG_RESULT(no)
  876. ipv6=no
  877. ))
  878. if test "$ipv6" = "yes"; then
  879. curl_ipv6_msg="enabled"
  880. fi
  881. # Check if struct sockaddr_in6 have sin6_scope_id member
  882. if test "$ipv6" = yes; then
  883. AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
  884. AC_TRY_COMPILE([
  885. #include <sys/types.h>
  886. #include <netinet/in.h>] ,
  887. struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
  888. if test "$have_sin6_scope_id" = yes; then
  889. AC_MSG_RESULT([yes])
  890. AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
  891. else
  892. AC_MSG_RESULT([no])
  893. fi
  894. fi
  895. dnl **********************************************************************
  896. dnl Check if the operating system allows programs to write to their own argv[]
  897. dnl **********************************************************************
  898. AC_MSG_CHECKING([if argv can be written to])
  899. AC_RUN_IFELSE([
  900. AC_LANG_SOURCE([[
  901. int main(int argc, char ** argv) {
  902. argv[0][0] = ' ';
  903. return (argv[0][0] == ' ')?0:1;
  904. }
  905. ]])
  906. ],[
  907. curl_cv_writable_argv=yes
  908. ],[
  909. curl_cv_writable_argv=no
  910. ],[
  911. curl_cv_writable_argv=cross
  912. ])
  913. case $curl_cv_writable_argv in
  914. yes)
  915. AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
  916. AC_MSG_RESULT(yes)
  917. ;;
  918. no)
  919. AC_MSG_RESULT(no)
  920. ;;
  921. *)
  922. AC_MSG_RESULT(no)
  923. AC_MSG_WARN([the previous check could not be made default was used])
  924. ;;
  925. esac
  926. dnl **********************************************************************
  927. dnl Check for the presence of Kerberos4 libraries and headers
  928. dnl **********************************************************************
  929. AC_ARG_WITH(krb4-includes,
  930. AC_HELP_STRING([--with-krb4-includes=DIR],
  931. [Specify location of kerberos4 headers]),[
  932. CPPFLAGS="$CPPFLAGS -I$withval"
  933. KRB4INC="$withval"
  934. want_krb4=yes
  935. ])
  936. AC_ARG_WITH(krb4-libs,
  937. AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
  938. LDFLAGS="$LDFLAGS -L$withval"
  939. KRB4LIB="$withval"
  940. want_krb4=yes
  941. ])
  942. OPT_KRB4=off
  943. AC_ARG_WITH(krb4,dnl
  944. AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
  945. OPT_KRB4="$withval"
  946. if test X"$OPT_KRB4" != Xno; then
  947. want_krb4="yes"
  948. if test X"$OPT_KRB4" != Xyes; then
  949. LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
  950. KRB4LIB="$OPT_KRB4/lib$libsuff"
  951. CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
  952. KRB4INC="$OPT_KRB4/include"
  953. fi
  954. fi
  955. ])
  956. AC_MSG_CHECKING([if Kerberos4 support is requested])
  957. if test "$want_krb4" = yes
  958. then
  959. if test "$ipv6" = "yes"; then
  960. echo krb4 is not compatible with IPv6
  961. exit 1
  962. fi
  963. AC_MSG_RESULT(yes)
  964. dnl Check for & handle argument to --with-krb4
  965. AC_MSG_CHECKING(where to look for Kerberos4)
  966. if test X"$OPT_KRB4" = Xyes
  967. then
  968. AC_MSG_RESULT([defaults])
  969. else
  970. AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
  971. fi
  972. dnl Check for DES library
  973. AC_CHECK_LIB(des, des_pcbc_encrypt,
  974. [
  975. AC_CHECK_HEADERS(des.h)
  976. dnl resolv lib?
  977. AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
  978. dnl Check for the Kerberos4 library
  979. AC_CHECK_LIB(krb, krb_net_read,
  980. [
  981. dnl Check for header files
  982. AC_CHECK_HEADERS(krb.h)
  983. dnl we found the required libraries, add to LIBS
  984. LIBS="-lkrb -lcom_err -ldes $LIBS"
  985. dnl Check for function krb_get_our_ip_for_realm
  986. dnl this is needed for NAT networks
  987. AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
  988. dnl add define KRB4
  989. AC_DEFINE(HAVE_KRB4, 1,
  990. [if you have the Kerberos4 libraries (including -ldes)])
  991. dnl substitute it too!
  992. KRB4_ENABLED=1
  993. AC_SUBST(KRB4_ENABLED)
  994. curl_krb4_msg="enabled"
  995. dnl the krb4 stuff needs a strlcpy()
  996. AC_CHECK_FUNCS(strlcpy)
  997. ])
  998. ])
  999. else
  1000. AC_MSG_RESULT(no)
  1001. fi
  1002. dnl **********************************************************************
  1003. dnl Check for FBopenssl(SPNEGO) libraries
  1004. dnl **********************************************************************
  1005. AC_ARG_WITH(spnego,
  1006. AC_HELP_STRING([--with-spnego=DIR],
  1007. [Specify location of SPNEGO library fbopenssl]), [
  1008. SPNEGO_ROOT="$withval"
  1009. if test x"$SPNEGO_ROOT" != xno; then
  1010. want_spnego="yes"
  1011. fi
  1012. ])
  1013. AC_MSG_CHECKING([if SPNEGO support is requested])
  1014. if test x"$want_spnego" = xyes; then
  1015. if test X"$SPNEGO_ROOT" = Xyes; then
  1016. AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
  1017. AC_MSG_RESULT(no)
  1018. else
  1019. if test -z "$SPNEGO_LIB_DIR"; then
  1020. LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
  1021. else
  1022. LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
  1023. fi
  1024. AC_MSG_RESULT(yes)
  1025. AC_DEFINE(HAVE_SPNEGO, 1,
  1026. [Define this if you have the SPNEGO library fbopenssl])
  1027. curl_spnego_msg="enabled"
  1028. fi
  1029. else
  1030. AC_MSG_RESULT(no)
  1031. fi
  1032. dnl **********************************************************************
  1033. dnl Check for GSS-API libraries
  1034. dnl **********************************************************************
  1035. dnl check for gss stuff in the /usr as default
  1036. GSSAPI_ROOT="/usr"
  1037. AC_ARG_WITH(gssapi-includes,
  1038. AC_HELP_STRING([--with-gssapi-includes=DIR],
  1039. [Specify location of GSSAPI header]),
  1040. [ GSSAPI_INCS="-I$withval"
  1041. want_gss="yes" ]
  1042. )
  1043. AC_ARG_WITH(gssapi-libs,
  1044. AC_HELP_STRING([--with-gssapi-libs=DIR],
  1045. [Specify location of GSSAPI libs]),
  1046. [ GSSAPI_LIB_DIR="-L$withval"
  1047. want_gss="yes" ]
  1048. )
  1049. AC_ARG_WITH(gssapi,
  1050. AC_HELP_STRING([--with-gssapi=DIR],
  1051. [Where to look for GSSAPI]), [
  1052. GSSAPI_ROOT="$withval"
  1053. if test x"$GSSAPI_ROOT" != xno; then
  1054. want_gss="yes"
  1055. if test x"$GSSAPI_ROOT" = xyes; then
  1056. dnl if yes, then use default root
  1057. GSSAPI_ROOT="/usr"
  1058. fi
  1059. fi
  1060. ])
  1061. save_CPPFLAGS="$CPPFLAGS"
  1062. AC_MSG_CHECKING([if GSSAPI support is requested])
  1063. if test x"$want_gss" = xyes; then
  1064. AC_MSG_RESULT(yes)
  1065. if test -z "$GSSAPI_INCS"; then
  1066. if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
  1067. GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
  1068. elif test "$GSSAPI_ROOT" != "yes"; then
  1069. GSSAPI_INCS="-I$GSSAPI_ROOT/include"
  1070. fi
  1071. fi
  1072. CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
  1073. AC_CHECK_HEADER(gss.h,
  1074. [
  1075. dnl found in the given dirs
  1076. AC_DEFINE(HAVE_GSSGNU, 1, [if you have the GNU gssapi libraries])
  1077. gnu_gss=yes
  1078. ],
  1079. [
  1080. dnl not found, check Heimdal or MIT
  1081. AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
  1082. AC_CHECK_HEADERS(
  1083. [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
  1084. [],
  1085. [not_mit=1],
  1086. [
  1087. AC_INCLUDES_DEFAULT
  1088. #ifdef HAVE_GSSAPI_GSSAPI_H
  1089. #include <gssapi/gssapi.h>
  1090. #endif
  1091. ])
  1092. if test "x$not_mit" = "x1"; then
  1093. dnl MIT not found, check for Heimdal
  1094. AC_CHECK_HEADER(gssapi.h,
  1095. [
  1096. dnl found
  1097. AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
  1098. ],
  1099. [
  1100. dnl no header found, disabling GSS
  1101. want_gss=no
  1102. AC_MSG_WARN(disabling GSSAPI since no header files was found)
  1103. ]
  1104. )
  1105. else
  1106. dnl MIT found
  1107. AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
  1108. dnl check if we have a really old MIT kerberos (<= 1.2)
  1109. AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
  1110. AC_COMPILE_IFELSE([
  1111. AC_LANG_PROGRAM([[
  1112. #include <gssapi/gssapi.h>
  1113. #include <gssapi/gssapi_generic.h>
  1114. #include <gssapi/gssapi_krb5.h>
  1115. ]],[[
  1116. gss_import_name(
  1117. (OM_uint32 *)0,
  1118. (gss_buffer_t)0,
  1119. GSS_C_NT_HOSTBASED_SERVICE,
  1120. (gss_name_t *)0);
  1121. ]])
  1122. ],[
  1123. AC_MSG_RESULT([yes])
  1124. ],[
  1125. AC_MSG_RESULT([no])
  1126. AC_DEFINE(HAVE_OLD_GSSMIT, 1,
  1127. [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
  1128. ])
  1129. fi
  1130. ]
  1131. )
  1132. else
  1133. AC_MSG_RESULT(no)
  1134. fi
  1135. if test x"$want_gss" = xyes; then
  1136. AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
  1137. curl_gss_msg="enabled (MIT/Heimdal)"
  1138. if test -n "$gnu_gss"; then
  1139. curl_gss_msg="enabled (GNU GSS)"
  1140. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1141. LIBS="$LIBS -lgss"
  1142. elif test -z "$GSSAPI_LIB_DIR"; then
  1143. case $host in
  1144. *-*-darwin*)
  1145. LIBS="$LIBS -lgssapi_krb5 -lresolv"
  1146. ;;
  1147. *)
  1148. if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
  1149. dnl krb5-config doesn't have --libs-only-L or similar, put everything
  1150. dnl into LIBS
  1151. gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
  1152. LIBS="$LIBS $gss_libs"
  1153. elif test "$GSSAPI_ROOT" != "yes"; then
  1154. LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
  1155. LIBS="$LIBS -lgssapi"
  1156. else
  1157. LIBS="$LIBS -lgssapi"
  1158. fi
  1159. ;;
  1160. esac
  1161. else
  1162. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1163. LIBS="$LIBS -lgssapi"
  1164. fi
  1165. else
  1166. CPPFLAGS="$save_CPPFLAGS"
  1167. fi
  1168. dnl **********************************************************************
  1169. dnl Check for the presence of SSL libraries and headers
  1170. dnl **********************************************************************
  1171. dnl Default to compiler & linker defaults for SSL files & libraries.
  1172. OPT_SSL=off
  1173. dnl Default to no CA bundle
  1174. ca="no"
  1175. AC_ARG_WITH(ssl,dnl
  1176. 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])
  1177. AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
  1178. OPT_SSL=$withval)
  1179. if test X"$OPT_SSL" != Xno; then
  1180. dnl backup the pre-ssl variables
  1181. CLEANLDFLAGS="$LDFLAGS"
  1182. CLEANCPPFLAGS="$CPPFLAGS"
  1183. CLEANLIBS="$LIBS"
  1184. case "$OPT_SSL" in
  1185. yes)
  1186. dnl --with-ssl (without path) used
  1187. if test x$cross_compiling != xyes; then
  1188. dnl only do pkg-config magic when not cross-compiling
  1189. PKGTEST="yes"
  1190. fi
  1191. PREFIX_OPENSSL=/usr/local/ssl
  1192. LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
  1193. ;;
  1194. off)
  1195. dnl no --with-ssl option given, just check default places
  1196. if test x$cross_compiling != xyes; then
  1197. dnl only do pkg-config magic when not cross-compiling
  1198. PKGTEST="yes"
  1199. fi
  1200. PREFIX_OPENSSL=
  1201. ;;
  1202. *)
  1203. dnl check the given --with-ssl spot
  1204. PKGTEST="no"
  1205. PREFIX_OPENSSL=$OPT_SSL
  1206. dnl Try pkg-config even when cross-compiling. Since we
  1207. dnl specify PKG_CONFIG_LIBDIR we're only looking where
  1208. dnl the user told us to look
  1209. OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
  1210. AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
  1211. if test -f "$OPENSSL_PCDIR/openssl.pc"; then
  1212. PKGTEST="yes"
  1213. fi
  1214. dnl in case pkg-config comes up empty, use what we got
  1215. dnl via --with-ssl
  1216. LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
  1217. if test "$PREFIX_OPENSSL" != "/usr" ; then
  1218. SSL_LDFLAGS="-L$LIB_OPENSSL"
  1219. SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
  1220. fi
  1221. SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
  1222. ;;
  1223. esac
  1224. if test "$PKGTEST" = "yes"; then
  1225. CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
  1226. if test "$PKGCONFIG" != "no" ; then
  1227. SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1228. $PKGCONFIG --libs-only-l openssl 2>/dev/null`
  1229. SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1230. $PKGCONFIG --libs-only-L openssl 2>/dev/null`
  1231. SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1232. $PKGCONFIG --cflags-only-I openssl 2>/dev/null`
  1233. AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
  1234. AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
  1235. AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
  1236. LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
  1237. dnl use the values pkg-config reported. This is here
  1238. dnl instead of below with CPPFLAGS and LDFLAGS because we only
  1239. dnl learn about this via pkg-config. If we only have
  1240. dnl the argument to --with-ssl we don't know what
  1241. dnl additional libs may be necessary. Hope that we
  1242. dnl don't need any.
  1243. LIBS="$LIBS $SSL_LIBS"
  1244. fi
  1245. fi
  1246. dnl finally, set flags to use SSL
  1247. CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
  1248. LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
  1249. dnl This is for Msys/Mingw
  1250. case $host in
  1251. *-*-msys* | *-*-mingw*)
  1252. AC_MSG_CHECKING([for gdi32])
  1253. my_ac_save_LIBS=$LIBS
  1254. LIBS="-lgdi32 $LIBS"
  1255. AC_TRY_LINK([#include <windef.h>
  1256. #include <wingdi.h>],
  1257. [GdiFlush();],
  1258. [ dnl worked!
  1259. AC_MSG_RESULT([yes])],
  1260. [ dnl failed, restore LIBS
  1261. LIBS=$my_ac_save_LIBS
  1262. AC_MSG_RESULT(no)]
  1263. )
  1264. ;;
  1265. esac
  1266. AC_CHECK_LIB(crypto, CRYPTO_lock,[
  1267. HAVECRYPTO="yes"
  1268. LIBS="-lcrypto $LIBS"
  1269. ],[
  1270. LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
  1271. CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
  1272. AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
  1273. HAVECRYPTO="yes"
  1274. LIBS="-lcrypto $LIBS"], [
  1275. LDFLAGS="$CLEANLDFLAGS"
  1276. CPPFLAGS="$CLEANCPPFLAGS"
  1277. LIBS="$CLEANLIBS"
  1278. ])
  1279. ])
  1280. if test X"$HAVECRYPTO" = X"yes"; then
  1281. dnl This is only reasonable to do if crypto actually is there: check for
  1282. dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
  1283. AC_CHECK_LIB(ssl, SSL_connect)
  1284. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  1285. dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
  1286. AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
  1287. OLIBS=$LIBS
  1288. LIBS="$LIBS -lRSAglue -lrsaref"
  1289. AC_CHECK_LIB(ssl, SSL_connect)
  1290. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  1291. dnl still no SSL_connect
  1292. AC_MSG_RESULT(no)
  1293. LIBS=$OLIBS
  1294. else
  1295. AC_MSG_RESULT(yes)
  1296. fi
  1297. else
  1298. dnl Have the libraries--check for SSLeay/OpenSSL headers
  1299. AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
  1300. openssl/pem.h openssl/ssl.h openssl/err.h,
  1301. curl_ssl_msg="enabled (OpenSSL)"
  1302. OPENSSL_ENABLED=1
  1303. AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
  1304. if test $ac_cv_header_openssl_x509_h = no; then
  1305. dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
  1306. dnl since 'err.h' might in fact find a krb4 header with the same
  1307. dnl name
  1308. AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
  1309. if test $ac_cv_header_x509_h = yes &&
  1310. test $ac_cv_header_crypto_h = yes &&
  1311. test $ac_cv_header_ssl_h = yes; then
  1312. dnl three matches
  1313. curl_ssl_msg="enabled (OpenSSL)"
  1314. OPENSSL_ENABLED=1
  1315. fi
  1316. fi
  1317. fi
  1318. if test X"$OPENSSL_ENABLED" = X"1"; then
  1319. AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
  1320. dnl is there a pkcs12.h header present?
  1321. AC_CHECK_HEADERS(openssl/pkcs12.h)
  1322. else
  1323. LIBS="$CLEANLIBS"
  1324. fi
  1325. dnl USE_SSLEAY is the historical name for what configure calls
  1326. dnl OPENSSL_ENABLED; the names should really be unified
  1327. USE_SSLEAY="$OPENSSL_ENABLED"
  1328. AC_SUBST(USE_SSLEAY)
  1329. if test X"$OPT_SSL" != Xoff &&
  1330. test "$OPENSSL_ENABLED" != "1"; then
  1331. AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
  1332. fi
  1333. fi
  1334. if test X"$OPENSSL_ENABLED" = X"1"; then
  1335. dnl If the ENGINE library seems to be around, check for the OpenSSL engine
  1336. dnl stuff, it is kind of "separated" from the main SSL check
  1337. AC_CHECK_FUNC(ENGINE_init,
  1338. [
  1339. AC_CHECK_HEADERS(openssl/engine.h)
  1340. AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
  1341. ])
  1342. dnl these can only exist if openssl exists
  1343. dnl yassl doesn't have SSL_get_shutdown
  1344. AC_CHECK_FUNCS( RAND_status \
  1345. RAND_screen \
  1346. RAND_egd \
  1347. ENGINE_cleanup \
  1348. CRYPTO_cleanup_all_ex_data \
  1349. SSL_get_shutdown )
  1350. dnl Make an attempt to detect if this is actually yassl's headers and
  1351. dnl OpenSSL emulation layer. We still leave everything else believing
  1352. dnl and acting like OpenSSL.
  1353. AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
  1354. AC_COMPILE_IFELSE([
  1355. AC_LANG_PROGRAM([[
  1356. #include <openssl/ssl.h>
  1357. ]],[[
  1358. #if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
  1359. int dummy = SSL_ERROR_NONE;
  1360. #else
  1361. Not the yaSSL OpenSSL compatibility header.
  1362. #endif
  1363. ]])
  1364. ],[
  1365. AC_MSG_RESULT([yes])
  1366. AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
  1367. [Define to 1 if using yaSSL in OpenSSL compatibility mode.])
  1368. curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
  1369. ],[
  1370. AC_MSG_RESULT([no])
  1371. ])
  1372. fi
  1373. if test "$OPENSSL_ENABLED" = "1"; then
  1374. if test -n "$LIB_OPENSSL"; then
  1375. dnl when the ssl shared libs were found in a path that the run-time
  1376. dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
  1377. dnl to prevent further configure tests to fail due to this
  1378. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
  1379. export LD_LIBRARY_PATH
  1380. AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
  1381. fi
  1382. CURL_CHECK_OPENSSL_API
  1383. fi
  1384. fi
  1385. dnl **********************************************************************
  1386. dnl Check for the presence of ZLIB libraries and headers
  1387. dnl **********************************************************************
  1388. dnl Check for & handle argument to --with-zlib.
  1389. _cppflags=$CPPFLAGS
  1390. _ldflags=$LDFLAGS
  1391. AC_ARG_WITH(zlib,
  1392. AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
  1393. AC_HELP_STRING([--without-zlib],[disable use of zlib]),
  1394. [OPT_ZLIB="$withval"])
  1395. if test "$OPT_ZLIB" = "no" ; then
  1396. AC_MSG_WARN([zlib disabled])
  1397. else
  1398. if test "$OPT_ZLIB" = "yes" ; then
  1399. OPT_ZLIB=""
  1400. fi
  1401. if test -z "$OPT_ZLIB" ; then
  1402. dnl check for the lib first without setting any new path, since many
  1403. dnl people have it in the default path
  1404. AC_CHECK_LIB(z, inflateEnd,
  1405. dnl libz found, set the variable
  1406. [HAVE_LIBZ="1"],
  1407. dnl if no lib found, try /usr/local
  1408. [OPT_ZLIB="/usr/local"])
  1409. fi
  1410. dnl Add a nonempty path to the compiler flags
  1411. if test -n "$OPT_ZLIB"; then
  1412. CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
  1413. LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
  1414. fi
  1415. AC_CHECK_HEADER(zlib.h,
  1416. [
  1417. dnl zlib.h was found
  1418. HAVE_ZLIB_H="1"
  1419. dnl if the lib wasn't found already, try again with the new paths
  1420. if test "$HAVE_LIBZ" != "1"; then
  1421. AC_CHECK_LIB(z, gzread,
  1422. [
  1423. dnl the lib was found!
  1424. HAVE_LIBZ="1"
  1425. ],
  1426. [ CPPFLAGS=$_cppflags
  1427. LDFLAGS=$_ldflags])
  1428. fi
  1429. ],
  1430. [
  1431. dnl zlib.h was not found, restore the flags
  1432. CPPFLAGS=$_cppflags
  1433. LDFLAGS=$_ldflags]
  1434. )
  1435. if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
  1436. then
  1437. AC_MSG_WARN([configure found only the libz lib, not the header file!])
  1438. HAVE_LIBZ=""
  1439. elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
  1440. then
  1441. AC_MSG_WARN([configure found only the libz header file, not the lib!])
  1442. elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
  1443. then
  1444. dnl both header and lib were found!
  1445. AC_SUBST(HAVE_LIBZ)
  1446. AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
  1447. AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
  1448. CURL_LIBS="$CURL_LIBS -lz"
  1449. LIBS="$LIBS -lz"
  1450. dnl replace 'HAVE_LIBZ' in the automake makefile.ams
  1451. AMFIXLIB="1"
  1452. AC_MSG_NOTICE([found both libz and libz.h header])
  1453. curl_zlib_msg="enabled"
  1454. fi
  1455. fi
  1456. dnl set variable for use in automakefile(s)
  1457. AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
  1458. dnl **********************************************************************
  1459. dnl Check for the random seed preferences
  1460. dnl **********************************************************************
  1461. if test X"$OPENSSL_ENABLED" = X"1"; then
  1462. AC_ARG_WITH(egd-socket,
  1463. AC_HELP_STRING([--with-egd-socket=FILE],
  1464. [Entropy Gathering Daemon socket pathname]),
  1465. [ EGD_SOCKET="$withval" ]
  1466. )
  1467. if test -n "$EGD_SOCKET" ; then
  1468. AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
  1469. [your Entropy Gathering Daemon socket pathname] )
  1470. fi
  1471. dnl Check for user-specified random device
  1472. AC_ARG_WITH(random,
  1473. AC_HELP_STRING([--with-random=FILE],
  1474. [read randomness from FILE (default=/dev/urandom)]),
  1475. [ RANDOM_FILE="$withval" ],
  1476. [
  1477. if test x$cross_compiling != xyes; then
  1478. dnl Check for random device
  1479. AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
  1480. else
  1481. AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling])
  1482. fi
  1483. ]
  1484. )
  1485. if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
  1486. AC_SUBST(RANDOM_FILE)
  1487. AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
  1488. [a suitable file to read random data from])
  1489. fi
  1490. fi
  1491. dnl ---
  1492. dnl We require OpenSSL with SRP support.
  1493. dnl ---
  1494. if test "$OPENSSL_ENABLED" = "1"; then
  1495. AC_CHECK_LIB(crypto, SRP_Calc_client_key,
  1496. [
  1497. AC_DEFINE(HAVE_SSLEAY_SRP, 1, [if you have the function SRP_Calc_client_key])
  1498. AC_SUBST(HAVE_SSLEAY_SRP, [1])
  1499. ])
  1500. fi
  1501. dnl ----------------------------------------------------
  1502. dnl check for GnuTLS
  1503. dnl ----------------------------------------------------
  1504. dnl Default to compiler & linker defaults for GnuTLS files & libraries.
  1505. OPT_GNUTLS=no
  1506. AC_ARG_WITH(gnutls,dnl
  1507. AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root])
  1508. AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
  1509. OPT_GNUTLS=$withval)
  1510. if test "$OPENSSL_ENABLED" != "1"; then
  1511. if test X"$OPT_GNUTLS" != Xno; then
  1512. addld=""
  1513. if test "x$OPT_GNUTLS" = "xyes"; then
  1514. dnl this is with no partiular path given
  1515. CURL_CHECK_PKGCONFIG(gnutls)
  1516. if test "$PKGCONFIG" != "no" ; then
  1517. addlib=`$PKGCONFIG --libs-only-l gnutls`
  1518. addld=`$PKGCONFIG --libs-only-L gnutls`
  1519. addcflags=`$PKGCONFIG --cflags-only-I gnutls`
  1520. version=`$PKGCONFIG --modversion gnutls`
  1521. gtlslib=`echo $addld | $SED -e 's/-L//'`
  1522. else
  1523. dnl without pkg-config, we try libgnutls-config as that was how it
  1524. dnl used to be done
  1525. check=`libgnutls-config --version 2>/dev/null`
  1526. if test -n "$check"; then
  1527. addlib=`libgnutls-config --libs`
  1528. addcflags=`libgnutls-config --cflags`
  1529. version=`libgnutls-config --version`
  1530. gtlslib=`libgnutls-config --prefix`/lib$libsuff
  1531. fi
  1532. fi
  1533. else
  1534. dnl this is with a given path, first check if there's a libgnutls-config
  1535. dnl there and if not, make an educated guess
  1536. cfg=$OPT_GNUTLS/bin/libgnutls-config
  1537. check=`$cfg --version 2>/dev/null`
  1538. if test -n "$check"; then
  1539. addlib=`$cfg --libs`
  1540. addcflags=`$cfg --cflags`
  1541. version=`$cfg --version`
  1542. gtlslib=`$cfg --prefix`/lib$libsuff
  1543. else
  1544. dnl without pkg-config and libgnutls-config, we guess a lot!
  1545. addlib=-lgnutls
  1546. addld=-L$OPT_GNUTLS/lib$libsuff
  1547. addcflags=-I$OPT_GNUTLS/include
  1548. version="" # we just don't know
  1549. gtlslib=$OPT_GNUTLS/lib$libsuff
  1550. fi
  1551. fi
  1552. if test -z "$version"; then
  1553. dnl lots of efforts, still no go
  1554. version="unknown"
  1555. fi
  1556. if test -n "$addlib"; then
  1557. CLEANLIBS="$LIBS"
  1558. CLEANCPPFLAGS="$CPPFLAGS"
  1559. CLEADLDFLAGS="$LDFLAGS"
  1560. LIBS="$LIBS $addlib"
  1561. LDFLAGS="$LDFLAGS $addld"
  1562. if test "$addcflags" != "-I/usr/include"; then
  1563. CPPFLAGS="$CPPFLAGS $addcflags"
  1564. fi
  1565. AC_CHECK_LIB(gnutls, gnutls_check_version,
  1566. [
  1567. AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
  1568. AC_SUBST(USE_GNUTLS, [1])
  1569. GNUTLS_ENABLED=1
  1570. USE_GNUTLS="yes"
  1571. curl_ssl_msg="enabled (GnuTLS)"
  1572. ],
  1573. [
  1574. LIBS="$CLEANLIBS"
  1575. CPPFLAGS="$CLEANCPPFLAGS"
  1576. ])
  1577. if test "x$USE_GNUTLS" = "xyes"; then
  1578. AC_MSG_NOTICE([detected GnuTLS version $version])
  1579. if test -n "$gtlslib"; then
  1580. dnl when shared libs were found in a path that the run-time
  1581. dnl linker doesn't search through, we need to add it to
  1582. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1583. dnl due to this
  1584. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
  1585. export LD_LIBRARY_PATH
  1586. AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
  1587. fi
  1588. fi
  1589. fi
  1590. fi dnl GNUTLS not disabled
  1591. fi dnl OPENSSL != 1
  1592. dnl ---
  1593. dnl If GnuTLS is enabled, we MUST verify that it uses libgcrypt since
  1594. dnl curl code relies on that but recent GnuTLS versions can in fact build
  1595. dnl with different crypto libraries which curl right now cannot handle
  1596. dnl ---
  1597. if test "$GNUTLS_ENABLED" = "1"; then
  1598. AC_CHECK_LIB(gcrypt,
  1599. gcry_control, ,
  1600. [
  1601. AC_MSG_ERROR([need GnuTLS built with gcrypt to function with GnuTLS])
  1602. ])
  1603. fi
  1604. dnl ---
  1605. dnl We require GnuTLS with SRP support.
  1606. dnl ---
  1607. if test "$GNUTLS_ENABLED" = "1"; then
  1608. AC_CHECK_LIB(gnutls, gnutls_srp_verifier,
  1609. [
  1610. AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier])
  1611. AC_SUBST(HAVE_GNUTLS_SRP, [1])
  1612. ])
  1613. fi
  1614. dnl ----------------------------------------------------
  1615. dnl check for PolarSSL
  1616. dnl ----------------------------------------------------
  1617. dnl Default to compiler & linker defaults for PolarSSL files & libraries.
  1618. OPT_POLARSSL=no
  1619. _cppflags=$CPPFLAGS
  1620. _ldflags=$LDFLAGS
  1621. AC_ARG_WITH(polarssl,dnl
  1622. AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root])
  1623. AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]),
  1624. OPT_POLARSSL=$withval)
  1625. if test "$OPENSSL_ENABLED" != "1"; then
  1626. if test X"$OPT_POLARSSL" != Xno; then
  1627. if test "$OPT_POLARSSL" = "yes"; then
  1628. OPT_POLARSSL=""
  1629. fi
  1630. if test -z "$OPT_POLARSSL" ; then
  1631. dnl check for lib first without setting any new path
  1632. AC_CHECK_LIB(polarssl, havege_init,
  1633. dnl libpolarssl found, set the variable
  1634. [
  1635. AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
  1636. AC_SUBST(USE_POLARSSL, [1])
  1637. POLARSSL_ENABLED=1
  1638. USE_POLARSSL="yes"
  1639. curl_ssl_msg="enabled (PolarSSL)"
  1640. ])
  1641. fi
  1642. if test "x$USE_POLARSSL" != "xyes"; then
  1643. dnl add the path and test again
  1644. addld=-L$OPT_POLARSSL/lib$libsuff
  1645. addcflags=-I$OPT_POLARSSL/include
  1646. polarssllib=$OPT_POLARSSL/lib$libsuff
  1647. LDFLAGS="$LDFLAGS $addld"
  1648. if test "$addcflags" != "-I/usr/include"; then
  1649. CPPFLAGS="$CPPFLAGS $addcflags"
  1650. fi
  1651. AC_CHECK_LIB(polarssl, ssl_init,
  1652. [
  1653. AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
  1654. AC_SUBST(USE_POLARSSL, [1])
  1655. POLARSSL_ENABLED=1
  1656. USE_POLARSSL="yes"
  1657. curl_ssl_msg="enabled (PolarSSL)"
  1658. ],
  1659. [
  1660. CPPFLAGS=$_cppflags
  1661. LDFLAGS=$_ldflags
  1662. ])
  1663. fi
  1664. if test "x$USE_POLARSSL" = "xyes"; then
  1665. AC_MSG_NOTICE([detected PolarSSL])
  1666. CURL_LIBS="$CURL_LIBS -lpolarssl"
  1667. LIBS="$LIBS -lpolarssl"
  1668. if test -n "$polarssllib"; then
  1669. dnl when shared libs were found in a path that the run-time
  1670. dnl linker doesn't search through, we need to add it to
  1671. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1672. dnl due to this
  1673. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib"
  1674. export LD_LIBRARY_PATH
  1675. AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH])
  1676. fi
  1677. fi
  1678. fi dnl PolarSSL not disabled
  1679. fi dnl OPENSSL != 1
  1680. dnl ----------------------------------------------------
  1681. dnl check for CyaSSL
  1682. dnl ----------------------------------------------------
  1683. dnl Default to compiler & linker defaults for CyaSSL files & libraries.
  1684. OPT_CYASSL=no
  1685. _cppflags=$CPPFLAGS
  1686. _ldflags=$LDFLAGS
  1687. AC_ARG_WITH(cyassl,dnl
  1688. AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: /usr/local/cyassl)])
  1689. AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]),
  1690. OPT_CYASSL=$withval)
  1691. if test "$OPENSSL_ENABLED" != "1"; then
  1692. if test X"$OPT_CYASSL" != Xno; then
  1693. if test "$OPT_CYASSL" = "yes"; then
  1694. OPT_CYASSL=""
  1695. fi
  1696. if test -z "$OPT_CYASSL" ; then
  1697. dnl check for lib in default first
  1698. trycyassldir="/usr/local/cyassl"
  1699. LDFLAGS="$LDFLAGS -L$trycyassldir/lib"
  1700. CPPFLAGS="$CPPFLAGS -I$trycyassldir/include"
  1701. AC_CHECK_LIB(cyassl, InitCyaSSL,
  1702. dnl libcyassl found, set the variable
  1703. [
  1704. AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
  1705. AC_SUBST(USE_CYASSL, [1])
  1706. CYASSL_ENABLED=1
  1707. USE_CYASSL="yes"
  1708. curl_ssl_msg="enabled (CyaSSL)"
  1709. ])
  1710. fi
  1711. if test "x$USE_CYASSL" != "xyes"; then
  1712. dnl add the path and test again
  1713. addld=-L$OPT_CYASSL/lib$libsuff
  1714. addcflags=-I$OPT_CYASSL/include
  1715. cyassllib=$OPT_CYASSL/lib$libsuff
  1716. LDFLAGS="$LDFLAGS $addld"
  1717. if test "$addcflags" != "-I/usr/include"; then
  1718. CPPFLAGS="$CPPFLAGS $addcflags"
  1719. fi
  1720. AC_CHECK_LIB(cyassl, InitCyaSSL,
  1721. [
  1722. AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
  1723. AC_SUBST(USE_CYASSL, [1])
  1724. CYASSL_ENABLED=1
  1725. USE_CYASSL="yes"
  1726. curl_ssl_msg="enabled (CyaSSL)"
  1727. ],
  1728. [
  1729. CPPFLAGS=$_cppflags
  1730. LDFLAGS=$_ldflags
  1731. ])
  1732. fi
  1733. if test "x$USE_CYASSL" = "xyes"; then
  1734. AC_MSG_NOTICE([detected CyaSSL])
  1735. CURL_LIBS="$CURL_LIBS -lcyassl -lm"
  1736. LIBS="$LIBS -lcyassl -lm"
  1737. if test -n "$cyassllib"; then
  1738. dnl when shared libs were found in a path that the run-time
  1739. dnl linker doesn't search through, we need to add it to
  1740. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1741. dnl due to this
  1742. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib"
  1743. export LD_LIBRARY_PATH
  1744. AC_MSG_NOTICE([Added $cyassllib to LD_LIBRARY_PATH])
  1745. fi
  1746. fi
  1747. fi dnl CyaSSL not disabled
  1748. fi dnl OPENSSL != 1
  1749. dnl ----------------------------------------------------
  1750. dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
  1751. dnl ----------------------------------------------------
  1752. dnl Default to compiler & linker defaults for NSS files & libraries.
  1753. OPT_NSS=no
  1754. AC_ARG_WITH(nss,dnl
  1755. AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root])
  1756. AC_HELP_STRING([--without-nss], [disable NSS detection]),
  1757. OPT_NSS=$withval)
  1758. if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
  1759. if test X"$OPT_NSS" != Xno; then
  1760. if test "x$OPT_NSS" = "xyes"; then
  1761. CURL_CHECK_PKGCONFIG(nss)
  1762. if test "$PKGCONFIG" != "no" ; then
  1763. addlib=`$PKGCONFIG --libs nss`
  1764. addcflags=`$PKGCONFIG --cflags nss`
  1765. version=`$PKGCONFIG --modversion nss`
  1766. nssprefix=`$PKGCONFIG --variable=prefix nss`
  1767. else
  1768. dnl Without pkg-config, we check for nss-config
  1769. check=`nss-config --version 2>/dev/null`
  1770. if test -n "$check"; then
  1771. addlib=`nss-config --libs`
  1772. addcflags=`nss-config --cflags`
  1773. version=`nss-config --version`
  1774. nssprefix=`nss-config --prefix`
  1775. else
  1776. addlib="-lnss3"
  1777. addcflags=""
  1778. version="unknown"
  1779. fi
  1780. fi
  1781. else
  1782. # Without pkg-config, we'll kludge in some defaults
  1783. addlib="-L$OPT_NSS/lib -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
  1784. addcflags="-I$OPT_NSS/include"
  1785. version="unknown"
  1786. nssprefix=$OPT_NSS
  1787. fi
  1788. dnl Check for functionPK11_CreateGenericObject
  1789. dnl this is needed for using the PEM PKCS#11 module
  1790. AC_CHECK_LIB(nss3, PK11_CreateGenericObject,
  1791. [
  1792. AC_DEFINE(HAVE_PK11_CREATEGENERICOBJECT, 1, [if you have the function PK11_CreateGenericObject])
  1793. AC_SUBST(HAVE_PK11_CREATEGENERICOBJECT, [1])
  1794. ])
  1795. if test -n "$addlib"; then
  1796. CLEANLIBS="$LIBS"
  1797. CLEANCPPFLAGS="$CPPFLAGS"
  1798. LIBS="$LIBS $addlib"
  1799. if test "$addcflags" != "-I/usr/include"; then
  1800. CPPFLAGS="$CPPFLAGS $addcflags"
  1801. fi
  1802. AC_CHECK_LIB(nss3, NSS_Initialize,
  1803. [
  1804. AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
  1805. AC_SUBST(USE_NSS, [1])
  1806. USE_NSS="yes"
  1807. NSS_ENABLED=1
  1808. curl_ssl_msg="enabled (NSS)"
  1809. ],
  1810. [
  1811. LIBS="$CLEANLIBS"
  1812. CPPFLAGS="$CLEANCPPFLAGS"
  1813. ])
  1814. if test "x$USE_NSS" = "xyes"; then
  1815. AC_MSG_NOTICE([detected NSS version $version])
  1816. dnl when shared libs were found in a path that the run-time
  1817. dnl linker doesn't search through, we need to add it to
  1818. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1819. dnl due to this
  1820. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
  1821. export LD_LIBRARY_PATH
  1822. AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
  1823. fi
  1824. fi
  1825. fi dnl NSS not disabled
  1826. fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1
  1827. OPT_AXTLS=off
  1828. AC_ARG_WITH(axtls,dnl
  1829. 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.])
  1830. AC_HELP_STRING([--without-axtls], [disable axTLS]),
  1831. OPT_AXTLS=$withval)
  1832. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1833. if test X"$OPT_AXTLS" != Xno; then
  1834. dnl backup the pre-axtls variables
  1835. CLEANLDFLAGS="$LDFLAGS"
  1836. CLEANCPPFLAGS="$CPPFLAGS"
  1837. CLEANLIBS="$LIBS"
  1838. case "$OPT_AXTLS" in
  1839. yes)
  1840. dnl --with-axtls (without path) used
  1841. PREFIX_AXTLS=/usr/local
  1842. LIB_AXTLS="$PREFIX_AXTLS/lib"
  1843. LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
  1844. CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
  1845. ;;
  1846. off)
  1847. dnl no --with-axtls option given, just check default places
  1848. PREFIX_AXTLS=
  1849. ;;
  1850. *)
  1851. dnl check the given --with-axtls spot
  1852. PREFIX_AXTLS=$OPT_AXTLS
  1853. LIB_AXTLS="$PREFIX_AXTLS/lib"
  1854. LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
  1855. CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
  1856. ;;
  1857. esac
  1858. AC_CHECK_LIB(axtls, ssl_version,[
  1859. LIBS="-laxtls $LIBS"
  1860. AC_DEFINE(USE_AXTLS, 1, [if axTLS is enabled])
  1861. AC_SUBST(USE_AXTLS, [1])
  1862. AXTLS_ENABLED=1
  1863. USE_AXTLS="yes"
  1864. curl_ssl_msg="enabled (axTLS)"
  1865. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_AXTLS"
  1866. export LD_LIBRARY_PATH
  1867. AC_MSG_NOTICE([Added $LIB_AXTLS to LD_LIBRARY_PATH])
  1868. ],[
  1869. LDFLAGS="$CLEANLDFLAGS"
  1870. CPPFLAGS="$CLEANCPPFLAGS"
  1871. LIBS="$CLEANLIBS"
  1872. ])
  1873. fi
  1874. fi
  1875. if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED" = "x"; then
  1876. AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
  1877. AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss or --with-axtls to address this.])
  1878. else
  1879. # SSL is enabled, genericly
  1880. AC_SUBST(SSL_ENABLED)
  1881. SSL_ENABLED="1"
  1882. fi
  1883. dnl **********************************************************************
  1884. dnl Check for the CA bundle
  1885. dnl **********************************************************************
  1886. CURL_CHECK_CA_BUNDLE
  1887. dnl **********************************************************************
  1888. dnl Check for the presence of LIBSSH2 libraries and headers
  1889. dnl **********************************************************************
  1890. dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
  1891. OPT_LIBSSH2=off
  1892. AC_ARG_WITH(libssh2,dnl
  1893. 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])
  1894. AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]),
  1895. OPT_LIBSSH2=$withval)
  1896. if test X"$OPT_LIBSSH2" != Xno; then
  1897. dnl backup the pre-libssh2 variables
  1898. CLEANLDFLAGS="$LDFLAGS"
  1899. CLEANCPPFLAGS="$CPPFLAGS"
  1900. CLEANLIBS="$LIBS"
  1901. case "$OPT_LIBSSH2" in
  1902. yes)
  1903. dnl --with-libssh2 (without path) used
  1904. CURL_CHECK_PKGCONFIG(libssh2)
  1905. if test "$PKGCONFIG" != "no" ; then
  1906. LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2`
  1907. LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
  1908. CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
  1909. version=`$PKGCONFIG --modversion libssh2`
  1910. DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'`
  1911. fi
  1912. ;;
  1913. off)
  1914. dnl no --with-libssh2 option given, just check default places
  1915. ;;
  1916. *)
  1917. dnl use the given --with-libssh2 spot
  1918. PREFIX_SSH2=$OPT_LIBSSH2
  1919. ;;
  1920. esac
  1921. dnl if given with a prefix, we set -L and -I based on that
  1922. if test -n "$PREFIX_SSH2"; then
  1923. LIB_SSH2="-lssh2"
  1924. LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
  1925. CPP_SSH2=-I${PREFIX_SSH2}/include
  1926. DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
  1927. fi
  1928. LDFLAGS="$LDFLAGS $LD_SSH2"
  1929. CPPFLAGS="$CPPFLAGS $CPP_SSH2"
  1930. LIBS="$LIBS $LIB_SSH2"
  1931. AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
  1932. AC_CHECK_HEADERS(libssh2.h,
  1933. curl_ssh_msg="enabled (libSSH2)"
  1934. LIBSSH2_ENABLED=1
  1935. AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
  1936. AC_SUBST(USE_LIBSSH2, [1])
  1937. )
  1938. if test X"$OPT_LIBSSH2" != Xoff &&
  1939. test "$LIBSSH2_ENABLED" != "1"; then
  1940. AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
  1941. fi
  1942. if test "$LIBSSH2_ENABLED" = "1"; then
  1943. if test -n "$DIR_SSH2"; then
  1944. dnl when the libssh2 shared libs were found in a path that the run-time
  1945. dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
  1946. dnl to prevent further configure tests to fail due to this
  1947. dnl libssh2_version is a post 1.0 addition
  1948. dnl libssh2_init and libssh2_exit were added in 1.2.5
  1949. dnl libssh2_scp_send64 was added in 1.2.6
  1950. dnl libssh2_session_handshake was added in 1.2.8
  1951. AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \
  1952. libssh2_scp_send64 libssh2_session_handshake)
  1953. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
  1954. export LD_LIBRARY_PATH
  1955. AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH])
  1956. fi
  1957. else
  1958. dnl no libssh2, revert back to clean variables
  1959. LDFLAGS=$CLEANLDFLAGS
  1960. CPPFLAGS=$CLEANCPPFLAGS
  1961. LIBS=$CLEANLIBS
  1962. fi
  1963. fi
  1964. dnl **********************************************************************
  1965. dnl Check for the presence of LIBRTMP libraries and headers
  1966. dnl **********************************************************************
  1967. dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
  1968. OPT_LIBRTMP=off
  1969. AC_ARG_WITH(librtmp,dnl
  1970. 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])
  1971. AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
  1972. OPT_LIBRTMP=$withval)
  1973. if test X"$OPT_LIBRTMP" != Xno; then
  1974. dnl backup the pre-librtmp variables
  1975. CLEANLDFLAGS="$LDFLAGS"
  1976. CLEANCPPFLAGS="$CPPFLAGS"
  1977. CLEANLIBS="$LIBS"
  1978. case "$OPT_LIBRTMP" in
  1979. yes)
  1980. dnl --with-librtmp (without path) used
  1981. CURL_CHECK_PKGCONFIG(librtmp)
  1982. if test "$PKGCONFIG" != "no" ; then
  1983. LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
  1984. LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
  1985. CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
  1986. version=`$PKGCONFIG --modversion librtmp`
  1987. DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
  1988. else
  1989. dnl To avoid link errors, we do not allow --librtmp without
  1990. dnl a pkgconfig file
  1991. AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
  1992. fi
  1993. ;;
  1994. off)
  1995. dnl no --with-librtmp option given, just check default places
  1996. LIB_RTMP="-lrtmp"
  1997. ;;
  1998. *)
  1999. dnl use the given --with-librtmp spot
  2000. PREFIX_RTMP=$OPT_LIBRTMP
  2001. ;;
  2002. esac
  2003. dnl if given with a prefix, we set -L and -I based on that
  2004. if test -n "$PREFIX_RTMP"; then
  2005. LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
  2006. CPP_RTMP=-I${PREFIX_RTMP}/include
  2007. DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
  2008. fi
  2009. LDFLAGS="$LDFLAGS $LD_RTMP"
  2010. CPPFLAGS="$CPPFLAGS $CPP_RTMP"
  2011. LIBS="$LIBS $LIB_RTMP"
  2012. AC_CHECK_LIB(rtmp, RTMP_Init,
  2013. [
  2014. AC_CHECK_HEADERS(librtmp/rtmp.h,
  2015. curl_rtmp_msg="enabled (librtmp)"
  2016. LIBRTMP_ENABLED=1
  2017. AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
  2018. AC_SUBST(USE_LIBRTMP, [1])
  2019. )
  2020. ],
  2021. dnl not found, revert back to clean variables
  2022. LDFLAGS=$CLEANLDFLAGS
  2023. CPPFLAGS=$CLEANCPPFLAGS
  2024. LIBS=$CLEANLIBS
  2025. )
  2026. if test X"$OPT_LIBRTMP" != Xoff &&
  2027. test "$LIBRTMP_ENABLED" != "1"; then
  2028. AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
  2029. fi
  2030. fi
  2031. dnl **********************************************************************
  2032. dnl Check for the presence of IDN libraries and headers
  2033. dnl **********************************************************************
  2034. AC_MSG_CHECKING([whether to build with libidn])
  2035. AC_ARG_WITH(libidn,
  2036. AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
  2037. AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
  2038. [LIBIDN="$withval"])
  2039. case "$LIBIDN" in
  2040. no)
  2041. AC_MSG_RESULT(no)
  2042. ;;
  2043. *) AC_MSG_RESULT(yes)
  2044. idn=""
  2045. dnl if there is a given path, check that FIRST
  2046. if test -n "$LIBIDN"; then
  2047. if test "x$LIBIDN" != "xyes"; then
  2048. oldLDFLAGS=$LDFLAGS
  2049. oldCPPFLAGS=$CPPFLAGS
  2050. LDFLAGS="$LDFLAGS -L$LIBIDN/lib"
  2051. CPPFLAGS="$CPPFLAGS -I$LIBIDN/include"
  2052. idn="yes"
  2053. AC_CHECK_LIB(idn, idna_to_ascii_4i, ,
  2054. idn=""
  2055. LDFLAGS=$oldLDFLAGS
  2056. CPPFLAGS=$oldCPPFLAGS)
  2057. fi
  2058. fi
  2059. if test "x$idn" != "xyes"; then
  2060. dnl check with default paths
  2061. idn="yes"
  2062. AC_CHECK_LIB(idn, idna_to_ascii_lz, ,
  2063. idn="")
  2064. fi
  2065. if test "x$idn" = "xyes"; then
  2066. curl_idn_msg="enabled"
  2067. AC_SUBST(IDN_ENABLED, [1])
  2068. dnl different versions of libidn have different setups of these:
  2069. AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror)
  2070. AC_CHECK_HEADERS( idn-free.h tld.h )
  2071. fi
  2072. ;;
  2073. esac
  2074. dnl Let's hope this split URL remains working:
  2075. dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
  2076. dnl genprogc/thread_quick_ref.htm
  2077. dnl **********************************************************************
  2078. dnl Back to "normal" configuring
  2079. dnl **********************************************************************
  2080. dnl Checks for header files.
  2081. AC_HEADER_STDC
  2082. CURL_CHECK_HEADER_MALLOC
  2083. CURL_CHECK_HEADER_MEMORY
  2084. dnl Now check for the very most basic headers. Then we can use these
  2085. dnl ones as default-headers when checking for the rest!
  2086. AC_CHECK_HEADERS(
  2087. sys/types.h \
  2088. sys/time.h \
  2089. sys/select.h \
  2090. sys/socket.h \
  2091. sys/ioctl.h \
  2092. sys/uio.h \
  2093. assert.h \
  2094. unistd.h \
  2095. stdlib.h \
  2096. limits.h \
  2097. arpa/inet.h \
  2098. net/if.h \
  2099. netinet/in.h \
  2100. sys/un.h \
  2101. netinet/tcp.h \
  2102. netdb.h \
  2103. sys/sockio.h \
  2104. sys/stat.h \
  2105. sys/param.h \
  2106. termios.h \
  2107. termio.h \
  2108. sgtty.h \
  2109. fcntl.h \
  2110. alloca.h \
  2111. time.h \
  2112. io.h \
  2113. pwd.h \
  2114. utime.h \
  2115. sys/utime.h \
  2116. sys/poll.h \
  2117. poll.h \
  2118. socket.h \
  2119. sys/resource.h \
  2120. libgen.h \
  2121. locale.h \
  2122. errno.h \
  2123. stdbool.h \
  2124. arpa/tftp.h \
  2125. sys/filio.h \
  2126. sys/wait.h \
  2127. setjmp.h,
  2128. dnl to do if not found
  2129. [],
  2130. dnl to do if found
  2131. [],
  2132. dnl default includes
  2133. [
  2134. #ifdef HAVE_SYS_TYPES_H
  2135. #include <sys/types.h>
  2136. #endif
  2137. #ifdef HAVE_SYS_TIME_H
  2138. #include <sys/time.h>
  2139. #endif
  2140. #ifdef HAVE_SYS_SELECT_H
  2141. #include <sys/select.h>
  2142. #endif
  2143. #ifdef HAVE_SYS_SOCKET_H
  2144. #include <sys/socket.h>
  2145. #endif
  2146. #ifdef HAVE_NETINET_IN_H
  2147. #include <netinet/in.h>
  2148. #endif
  2149. #ifdef HAVE_SYS_UN_H
  2150. #include <sys/un.h>
  2151. #endif
  2152. ]
  2153. )
  2154. dnl Checks for typedefs, structures, and compiler characteristics.
  2155. AC_C_CONST
  2156. CURL_CHECK_VARIADIC_MACROS
  2157. AC_TYPE_SIZE_T
  2158. AC_HEADER_TIME
  2159. CURL_CHECK_STRUCT_TIMEVAL
  2160. CURL_VERIFY_RUNTIMELIBS
  2161. AC_CHECK_SIZEOF(size_t)
  2162. AC_CHECK_SIZEOF(long)
  2163. AC_CHECK_SIZEOF(int)
  2164. AC_CHECK_SIZEOF(short)
  2165. CURL_CONFIGURE_LONG
  2166. AC_CHECK_SIZEOF(time_t)
  2167. AC_CHECK_SIZEOF(off_t)
  2168. soname_bump=no
  2169. if test x"$ac_cv_native_windows" != "xyes" &&
  2170. test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then
  2171. AC_MSG_WARN([This libcurl built is probably not ABI compatible with previous])
  2172. AC_MSG_WARN([builds! You MUST read lib/README.curl_off_t to figure it out.])
  2173. soname_bump=yes
  2174. fi
  2175. AC_CHECK_TYPE(long long,
  2176. [AC_DEFINE(HAVE_LONGLONG, 1,
  2177. [Define to 1 if the compiler supports the 'long long' data type.])]
  2178. longlong="yes"
  2179. )
  2180. if test "xyes" = "x$longlong"; then
  2181. AC_MSG_CHECKING([if numberLL works])
  2182. AC_COMPILE_IFELSE([
  2183. AC_LANG_PROGRAM([[
  2184. ]],[[
  2185. long long val = 1000LL;
  2186. ]])
  2187. ],[
  2188. AC_MSG_RESULT([yes])
  2189. AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
  2190. ],[
  2191. AC_MSG_RESULT([no])
  2192. ])
  2193. fi
  2194. # check for ssize_t
  2195. AC_CHECK_TYPE(ssize_t, ,
  2196. AC_DEFINE(ssize_t, int, [the signed version of size_t]))
  2197. # check for bool type
  2198. AC_CHECK_TYPE([bool],[
  2199. AC_DEFINE(HAVE_BOOL_T, 1,
  2200. [Define to 1 if bool is an available type.])
  2201. ], ,[
  2202. #ifdef HAVE_SYS_TYPES_H
  2203. #include <sys/types.h>
  2204. #endif
  2205. #ifdef HAVE_STDBOOL_H
  2206. #include <stdbool.h>
  2207. #endif
  2208. ])
  2209. CURL_CONFIGURE_CURL_SOCKLEN_T
  2210. TYPE_IN_ADDR_T
  2211. TYPE_SOCKADDR_STORAGE
  2212. TYPE_SIG_ATOMIC_T
  2213. AC_TYPE_SIGNAL
  2214. CURL_CHECK_FUNC_SELECT
  2215. CURL_CHECK_FUNC_RECV
  2216. CURL_CHECK_FUNC_RECVFROM
  2217. CURL_CHECK_FUNC_SEND
  2218. CURL_CHECK_MSG_NOSIGNAL
  2219. CURL_CHECK_FUNC_ALARM
  2220. CURL_CHECK_FUNC_BASENAME
  2221. CURL_CHECK_FUNC_CLOSESOCKET
  2222. CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
  2223. CURL_CHECK_FUNC_CONNECT
  2224. CURL_CHECK_FUNC_FCNTL
  2225. CURL_CHECK_FUNC_FDOPEN
  2226. CURL_CHECK_FUNC_FREEADDRINFO
  2227. CURL_CHECK_FUNC_FREEIFADDRS
  2228. CURL_CHECK_FUNC_FSETXATTR
  2229. CURL_CHECK_FUNC_FTRUNCATE
  2230. CURL_CHECK_FUNC_GETADDRINFO
  2231. CURL_CHECK_FUNC_GAI_STRERROR
  2232. CURL_CHECK_FUNC_GETHOSTBYADDR
  2233. CURL_CHECK_FUNC_GETHOSTBYADDR_R
  2234. CURL_CHECK_FUNC_GETHOSTBYNAME
  2235. CURL_CHECK_FUNC_GETHOSTBYNAME_R
  2236. CURL_CHECK_FUNC_GETHOSTNAME
  2237. CURL_CHECK_FUNC_GETIFADDRS
  2238. CURL_CHECK_FUNC_GETSERVBYPORT_R
  2239. CURL_CHECK_FUNC_GMTIME_R
  2240. CURL_CHECK_FUNC_INET_NTOA_R
  2241. CURL_CHECK_FUNC_INET_NTOP
  2242. CURL_CHECK_FUNC_INET_PTON
  2243. CURL_CHECK_FUNC_IOCTL
  2244. CURL_CHECK_FUNC_IOCTLSOCKET
  2245. CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
  2246. CURL_CHECK_FUNC_LOCALTIME_R
  2247. CURL_CHECK_FUNC_MEMRCHR
  2248. CURL_CHECK_FUNC_POLL
  2249. CURL_CHECK_FUNC_SETSOCKOPT
  2250. CURL_CHECK_FUNC_SIGACTION
  2251. CURL_CHECK_FUNC_SIGINTERRUPT
  2252. CURL_CHECK_FUNC_SIGNAL
  2253. CURL_CHECK_FUNC_SIGSETJMP
  2254. CURL_CHECK_FUNC_SOCKET
  2255. CURL_CHECK_FUNC_SOCKETPAIR
  2256. CURL_CHECK_FUNC_STRCASECMP
  2257. CURL_CHECK_FUNC_STRCASESTR
  2258. CURL_CHECK_FUNC_STRCMPI
  2259. CURL_CHECK_FUNC_STRDUP
  2260. CURL_CHECK_FUNC_STRERROR_R
  2261. CURL_CHECK_FUNC_STRICMP
  2262. CURL_CHECK_FUNC_STRLCAT
  2263. CURL_CHECK_FUNC_STRNCASECMP
  2264. CURL_CHECK_FUNC_STRNCMPI
  2265. CURL_CHECK_FUNC_STRNICMP
  2266. CURL_CHECK_FUNC_STRSTR
  2267. CURL_CHECK_FUNC_STRTOK_R
  2268. CURL_CHECK_FUNC_STRTOLL
  2269. CURL_CHECK_FUNC_WRITEV
  2270. case $host in
  2271. *msdosdjgpp)
  2272. ac_cv_func_pipe=no
  2273. skipcheck_pipe=yes
  2274. AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
  2275. ;;
  2276. esac
  2277. AC_CHECK_FUNCS([fork \
  2278. geteuid \
  2279. getpass_r \
  2280. getppid \
  2281. getprotobyname \
  2282. getpwuid \
  2283. getrlimit \
  2284. gettimeofday \
  2285. inet_addr \
  2286. perror \
  2287. pipe \
  2288. setlocale \
  2289. setmode \
  2290. setrlimit \
  2291. uname \
  2292. utime
  2293. ],[
  2294. ],[
  2295. func="$ac_func"
  2296. eval skipcheck=\$skipcheck_$func
  2297. if test "x$skipcheck" != "xyes"; then
  2298. AC_MSG_CHECKING([deeper for $func])
  2299. AC_LINK_IFELSE([
  2300. AC_LANG_PROGRAM([[
  2301. ]],[[
  2302. $func ();
  2303. ]])
  2304. ],[
  2305. AC_MSG_RESULT([yes])
  2306. eval "ac_cv_func_$func=yes"
  2307. AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
  2308. [Define to 1 if you have the $func function.])
  2309. ],[
  2310. AC_MSG_RESULT([but still no])
  2311. ])
  2312. fi
  2313. ])
  2314. dnl Check if the getnameinfo function is available
  2315. dnl and get the types of five of its arguments.
  2316. CURL_CHECK_FUNC_GETNAMEINFO
  2317. if test "$ipv6" = "yes"; then
  2318. if test "$ac_cv_func_getaddrinfo" = "yes"; then
  2319. AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
  2320. IPV6_ENABLED=1
  2321. AC_SUBST(IPV6_ENABLED)
  2322. fi
  2323. CURL_CHECK_NI_WITHSCOPEID
  2324. fi
  2325. dnl ************************************************************
  2326. dnl enable non-blocking communications
  2327. dnl
  2328. CURL_CHECK_OPTION_NONBLOCKING
  2329. CURL_CHECK_NONBLOCKING_SOCKET
  2330. dnl ************************************************************
  2331. dnl nroff tool stuff
  2332. dnl
  2333. AC_PATH_PROG( PERL, perl, ,
  2334. $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
  2335. AC_SUBST(PERL)
  2336. AC_PATH_PROGS( NROFF, gnroff nroff, ,
  2337. $PATH:/usr/bin/:/usr/local/bin )
  2338. AC_SUBST(NROFF)
  2339. if test -n "$NROFF"; then
  2340. dnl only check for nroff options if an nroff command was found
  2341. AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
  2342. MANOPT="-man"
  2343. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  2344. if test -z "$mancheck"; then
  2345. MANOPT="-mandoc"
  2346. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  2347. if test -z "$mancheck"; then
  2348. MANOPT=""
  2349. AC_MSG_RESULT([failed])
  2350. AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
  2351. else
  2352. AC_MSG_RESULT([$MANOPT])
  2353. fi
  2354. else
  2355. AC_MSG_RESULT([$MANOPT])
  2356. fi
  2357. AC_SUBST(MANOPT)
  2358. fi
  2359. if test -z "$MANOPT"
  2360. then
  2361. dnl if no nroff tool was found, or no option that could convert man pages
  2362. dnl was found, then disable the built-in manual stuff
  2363. AC_MSG_WARN([disabling built-in manual])
  2364. USE_MANUAL="no";
  2365. fi
  2366. dnl *************************************************************************
  2367. dnl If the manual variable still is set, then we go with providing a built-in
  2368. dnl manual
  2369. if test "$USE_MANUAL" = "1"; then
  2370. AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
  2371. curl_manual_msg="enabled"
  2372. fi
  2373. dnl set variable for use in automakefile(s)
  2374. AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
  2375. CURL_CHECK_LIB_ARES
  2376. AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
  2377. if test "x$ac_cv_native_windows" != "xyes" &&
  2378. test "x$enable_shared" = "xyes"; then
  2379. build_libhostname=yes
  2380. else
  2381. build_libhostname=no
  2382. fi
  2383. AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
  2384. CURL_CHECK_OPTION_THREADED_RESOLVER
  2385. if test "x$want_thres" = xyes && test "x$want_ares" = xyes; then
  2386. AC_MSG_ERROR(
  2387. [Options --enable-threaded-resolver and --enable-ares are mutually exclusive])
  2388. fi
  2389. if test "$want_thres" = "yes"; then
  2390. AC_CHECK_HEADER(pthread.h,
  2391. [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
  2392. save_CFLAGS="$CFLAGS"
  2393. CFLAGS="$CFLAGS -pthread"
  2394. AC_CHECK_LIB(pthread, pthread_create,
  2395. [ AC_MSG_NOTICE([using POSIX threaded DNS lookup])
  2396. AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
  2397. USE_THREADS_POSIX=1
  2398. curl_res_msg="threaded"
  2399. ],
  2400. [ CFLAGS="$save_CFLAGS"])
  2401. ])
  2402. fi
  2403. dnl ************************************************************
  2404. dnl disable verbose text strings
  2405. dnl
  2406. AC_MSG_CHECKING([whether to enable verbose strings])
  2407. AC_ARG_ENABLE(verbose,
  2408. AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
  2409. AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
  2410. [ case "$enableval" in
  2411. no)
  2412. AC_MSG_RESULT(no)
  2413. AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
  2414. curl_verbose_msg="no"
  2415. ;;
  2416. *) AC_MSG_RESULT(yes)
  2417. ;;
  2418. esac ],
  2419. AC_MSG_RESULT(yes)
  2420. )
  2421. dnl ************************************************************
  2422. dnl enable SSPI support
  2423. dnl
  2424. AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
  2425. AC_ARG_ENABLE(sspi,
  2426. AC_HELP_STRING([--enable-sspi],[Enable SSPI])
  2427. AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
  2428. [ case "$enableval" in
  2429. yes)
  2430. if test "$ac_cv_native_windows" = "yes"; then
  2431. AC_MSG_RESULT(yes)
  2432. AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
  2433. AC_SUBST(USE_WINDOWS_SSPI, [1])
  2434. curl_sspi_msg="enabled"
  2435. else
  2436. AC_MSG_RESULT(no)
  2437. AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
  2438. fi
  2439. ;;
  2440. *)
  2441. AC_MSG_RESULT(no)
  2442. ;;
  2443. esac ],
  2444. AC_MSG_RESULT(no)
  2445. )
  2446. dnl ************************************************************
  2447. dnl disable cryptographic authentication
  2448. dnl
  2449. AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
  2450. AC_ARG_ENABLE(crypto-auth,
  2451. AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
  2452. AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
  2453. [ case "$enableval" in
  2454. no)
  2455. AC_MSG_RESULT(no)
  2456. AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
  2457. ;;
  2458. *) AC_MSG_RESULT(yes)
  2459. ;;
  2460. esac ],
  2461. AC_MSG_RESULT(yes)
  2462. )
  2463. CURL_CHECK_OPTION_NTLM_WB
  2464. CURL_CHECK_NTLM_WB
  2465. dnl ************************************************************
  2466. dnl disable TLS-SRP authentication
  2467. dnl
  2468. AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
  2469. AC_ARG_ENABLE(tls-srp,
  2470. AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
  2471. AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
  2472. [ case "$enableval" in
  2473. no)
  2474. AC_MSG_RESULT(no)
  2475. AC_DEFINE(CURL_DISABLE_TLS_SRP, 1, [to disable TLS-SRP authentication])
  2476. want_tls_srp=no
  2477. ;;
  2478. *) AC_MSG_RESULT(yes)
  2479. want_tls_srp=yes
  2480. ;;
  2481. esac ],
  2482. AC_MSG_RESULT(yes)
  2483. want_tls_srp=yes
  2484. )
  2485. if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_SSLEAY_SRP" = "x1") ; then
  2486. AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
  2487. USE_TLS_SRP=1
  2488. curl_tls_srp_msg="enabled"
  2489. fi
  2490. dnl ************************************************************
  2491. dnl disable cookies support
  2492. dnl
  2493. AC_MSG_CHECKING([whether to enable support for cookies])
  2494. AC_ARG_ENABLE(cookies,
  2495. AC_HELP_STRING([--enable-cookies],[Enable cookies support])
  2496. AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
  2497. [ case "$enableval" in
  2498. no)
  2499. AC_MSG_RESULT(no)
  2500. AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
  2501. ;;
  2502. *) AC_MSG_RESULT(yes)
  2503. ;;
  2504. esac ],
  2505. AC_MSG_RESULT(yes)
  2506. )
  2507. dnl ************************************************************
  2508. dnl Enable hiding of internal symbols in library to reduce its size and
  2509. dnl speed dynamic linking of applications. This currently is only supported
  2510. dnl on gcc >= 4.0 and SunPro C.
  2511. dnl
  2512. AC_MSG_CHECKING([whether to enable hidden symbols in the library])
  2513. AC_ARG_ENABLE(hidden-symbols,
  2514. AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
  2515. AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
  2516. [ case "$enableval" in
  2517. no)
  2518. AC_MSG_RESULT(no)
  2519. ;;
  2520. *)
  2521. AC_MSG_CHECKING([whether $CC supports it])
  2522. if test "$GCC" = yes ; then
  2523. if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ||
  2524. dnl clang always supports -fvisibility= but it doesn't show up
  2525. dnl under --help.
  2526. test "$compiler_id" = "CLANG"; then
  2527. AC_MSG_RESULT(yes)
  2528. AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
  2529. AC_DEFINE(CURL_EXTERN_SYMBOL, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
  2530. CFLAGS="$CFLAGS -fvisibility=hidden"
  2531. else
  2532. AC_MSG_RESULT(no)
  2533. fi
  2534. else
  2535. dnl Test for SunPro cc
  2536. if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
  2537. AC_MSG_RESULT(yes)
  2538. AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
  2539. AC_DEFINE(CURL_EXTERN_SYMBOL, [__global], [to make a symbol visible])
  2540. CFLAGS="$CFLAGS -xldscope=hidden"
  2541. else
  2542. AC_MSG_RESULT(no)
  2543. fi
  2544. fi
  2545. ;;
  2546. esac ],
  2547. AC_MSG_RESULT(no)
  2548. )
  2549. dnl ************************************************************
  2550. dnl enforce SONAME bump
  2551. dnl
  2552. AC_MSG_CHECKING([whether to enforce SONAME bump])
  2553. AC_ARG_ENABLE(soname-bump,
  2554. AC_HELP_STRING([--enable-soname-bump],[Enable enforced SONAME bump])
  2555. AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]),
  2556. [ case "$enableval" in
  2557. yes) AC_MSG_RESULT(yes)
  2558. soname_bump=yes
  2559. ;;
  2560. *)
  2561. AC_MSG_RESULT(no)
  2562. ;;
  2563. esac ],
  2564. AC_MSG_RESULT($soname_bump)
  2565. )
  2566. AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes)
  2567. dnl ************************************************************
  2568. if test ! -z "$winsock_LIB"; then
  2569. dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
  2570. dnl things work when built with c-ares). But we can't just move it last
  2571. dnl since then other stuff (SSL) won't build. So we simply append it to the
  2572. dnl end.
  2573. LIBS="$LIBS $winsock_LIB"
  2574. TEST_SERVER_LIBS="$TEST_SERVER_LIBS $winsock_LIB"
  2575. fi
  2576. dnl
  2577. dnl All the library dependencies put into $LIB apply to libcurl only.
  2578. dnl Those in $CURL_LIBS apply to the curl command-line client only.
  2579. dnl Those in $TEST_SERVER_LIBS apply to test servers only.
  2580. dnl Those in $ALL_LIBS apply to all targets, including test targets.
  2581. dnl
  2582. LIBCURL_LIBS=$LIBS
  2583. AC_SUBST(LIBCURL_LIBS)
  2584. AC_SUBST(CURL_LIBS)
  2585. AC_SUBST(TEST_SERVER_LIBS)
  2586. AC_SUBST(CURL_NETWORK_LIBS)
  2587. LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link
  2588. AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
  2589. dnl yes or no
  2590. ENABLE_SHARED="$enable_shared"
  2591. AC_SUBST(ENABLE_SHARED)
  2592. dnl
  2593. dnl For keeping supported features and protocols also in pkg-config file
  2594. dnl since it is more cross-compile frient than curl-config
  2595. dnl
  2596. if test "x$USE_SSLEAY" = "x1"; then
  2597. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  2598. elif test -n "$SSL_ENABLED"; then
  2599. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  2600. fi
  2601. if test "@KRB4_ENABLED@" = "x1"; then
  2602. SUPPORT_FEATURES="$SUPPORT_FEATURES KRB4"
  2603. fi
  2604. if test "x$IPV6_ENABLED" = "x1"; then
  2605. SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
  2606. fi
  2607. if test "x$HAVE_LIBZ" = "x1"; then
  2608. SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
  2609. fi
  2610. if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1"; then
  2611. SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
  2612. fi
  2613. if test "x$IDN_ENABLED" = "x1"; then
  2614. SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
  2615. fi
  2616. if test "x$USE_WINDOWS_SSPI" = "x1"; then
  2617. SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
  2618. fi
  2619. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  2620. if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
  2621. -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1"; then
  2622. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
  2623. if test "x$NTLM_WB_ENABLED" = "x1"; then
  2624. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
  2625. fi
  2626. fi
  2627. fi
  2628. if test "x$USE_TLS_SRP" = "x1"; then
  2629. SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
  2630. fi
  2631. AC_SUBST(SUPPORT_FEATURES)
  2632. dnl For supported protocols in pkg-config file
  2633. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  2634. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
  2635. if test "x$SSL_ENABLED" = "x1"; then
  2636. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
  2637. fi
  2638. fi
  2639. if test "x$CURL_DISABLE_FTP" != "x1"; then
  2640. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
  2641. if test "x$SSL_ENABLED" = "x1"; then
  2642. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
  2643. fi
  2644. fi
  2645. if test "x$CURL_DISABLE_FILE" != "x1"; then
  2646. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
  2647. fi
  2648. if test "x$CURL_DISABLE_TELNET" != "x1"; then
  2649. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
  2650. fi
  2651. if test "x$CURL_DISABLE_LDAP" != "x1"; then
  2652. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
  2653. if test "x$CURL_DISABLE_LDAPS" != "x1"; then
  2654. if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
  2655. (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
  2656. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
  2657. fi
  2658. fi
  2659. fi
  2660. if test "x$CURL_DISABLE_DICT" != "x1"; then
  2661. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
  2662. fi
  2663. if test "x$CURL_DISABLE_TFTP" != "x1"; then
  2664. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
  2665. fi
  2666. if test "x$CURL_DISABLE_GOPHER" != "x1"; then
  2667. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
  2668. fi
  2669. if test "x$CURL_DISABLE_POP3" != "x1"; then
  2670. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
  2671. if test "x$SSL_ENABLED" = "x1"; then
  2672. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
  2673. fi
  2674. fi
  2675. if test "x$CURL_DISABLE_IMAP" != "x1"; then
  2676. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
  2677. if test "x$SSL_ENABLED" = "x1"; then
  2678. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
  2679. fi
  2680. fi
  2681. if test "x$CURL_DISABLE_SMTP" != "x1"; then
  2682. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
  2683. if test "x$SSL_ENABLED" = "x1"; then
  2684. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
  2685. fi
  2686. fi
  2687. if test "x$USE_LIBSSH2" = "x1"; then
  2688. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
  2689. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  2690. fi
  2691. if test "x$CURL_DISABLE_RTSP" != "x1"; then
  2692. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
  2693. fi
  2694. if test "x$USE_LIBRTMP" = "x1"; then
  2695. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
  2696. fi
  2697. dnl replace spaces with newlines
  2698. dnl sort the lines
  2699. dnl replace the newlines back to spaces
  2700. SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
  2701. AC_SUBST(SUPPORT_PROTOCOLS)
  2702. dnl squeeze whitespace out of some variables
  2703. squeeze CFLAGS
  2704. squeeze CPPFLAGS
  2705. squeeze DEFS
  2706. squeeze LDFLAGS
  2707. squeeze LIBS
  2708. squeeze CURL_LIBS
  2709. squeeze LIBCURL_LIBS
  2710. squeeze TEST_SERVER_LIBS
  2711. squeeze CURL_NETWORK_LIBS
  2712. squeeze SUPPORT_FEATURES
  2713. squeeze SUPPORT_PROTOCOLS
  2714. if test "x$want_curldebug_assumed" = "xyes" &&
  2715. test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
  2716. ac_configure_args="$ac_configure_args --enable-curldebug"
  2717. fi
  2718. AC_CONFIG_FILES([Makefile \
  2719. docs/Makefile \
  2720. docs/examples/Makefile \
  2721. docs/libcurl/Makefile \
  2722. include/Makefile \
  2723. include/curl/Makefile \
  2724. src/Makefile \
  2725. lib/Makefile \
  2726. tests/Makefile \
  2727. tests/data/Makefile \
  2728. tests/server/Makefile \
  2729. tests/libtest/Makefile \
  2730. tests/unit/Makefile \
  2731. packages/Makefile \
  2732. packages/Win32/Makefile \
  2733. packages/Win32/cygwin/Makefile \
  2734. packages/Linux/Makefile \
  2735. packages/Linux/RPM/Makefile \
  2736. packages/Linux/RPM/curl.spec \
  2737. packages/Linux/RPM/curl-ssl.spec \
  2738. packages/Solaris/Makefile \
  2739. packages/EPM/curl.list \
  2740. packages/EPM/Makefile \
  2741. packages/vms/Makefile \
  2742. packages/AIX/Makefile \
  2743. packages/AIX/RPM/Makefile \
  2744. packages/AIX/RPM/curl.spec \
  2745. curl-config \
  2746. libcurl.pc
  2747. ])
  2748. AC_OUTPUT
  2749. CURL_GENERATE_CONFIGUREHELP_PM
  2750. AC_MSG_NOTICE([Configured to build curl/libcurl:
  2751. curl version: ${CURLVERSION}
  2752. Host setup: ${host}
  2753. Install prefix: ${prefix}
  2754. Compiler: ${CC}
  2755. SSL support: ${curl_ssl_msg}
  2756. SSH support: ${curl_ssh_msg}
  2757. zlib support: ${curl_zlib_msg}
  2758. krb4 support: ${curl_krb4_msg}
  2759. GSSAPI support: ${curl_gss_msg}
  2760. SPNEGO support: ${curl_spnego_msg}
  2761. TLS-SRP support: ${curl_tls_srp_msg}
  2762. resolver: ${curl_res_msg}
  2763. ipv6 support: ${curl_ipv6_msg}
  2764. IDN support: ${curl_idn_msg}
  2765. Build libcurl: Shared=${enable_shared}, Static=${enable_static}
  2766. Built-in manual: ${curl_manual_msg}
  2767. Verbose errors: ${curl_verbose_msg}
  2768. SSPI support: ${curl_sspi_msg}
  2769. ca cert bundle: ${ca}
  2770. ca cert path: ${capath}
  2771. LDAP support: ${curl_ldap_msg}
  2772. LDAPS support: ${curl_ldaps_msg}
  2773. RTSP support: ${curl_rtsp_msg}
  2774. RTMP support: ${curl_rtmp_msg}
  2775. Protocols: ${SUPPORT_PROTOCOLS}
  2776. ])
  2777. if test "x$soname_bump" = "xyes"; then
  2778. cat <<EOM
  2779. SONAME bump: yes - WARNING: this library will be built with the SONAME
  2780. number bumped due to (a detected) ABI breakage.
  2781. See lib/README.curl_off_t for details on this.
  2782. EOM
  2783. fi