configure.ac 73 KB

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