configure.ac 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904
  1. dnl $Id$
  2. dnl Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.57)
  4. dnl We don't know the version number "staticly" so we use a dash here
  5. AC_INIT(curl, [-], [a suitable curl mailing list => http://curl.haxx.se/mail/])
  6. dnl configure script copyright
  7. AC_COPYRIGHT([Copyright (c) 1998 - 2005 Daniel Stenberg, <daniel@haxx.se>
  8. This configure script may be copied, distributed and modified under the
  9. terms of the curl license; see COPYING for more details])
  10. AC_CONFIG_SRCDIR([lib/urldata.h])
  11. AM_CONFIG_HEADER(lib/config.h src/config.h)
  12. AM_MAINTAINER_MODE
  13. dnl SED is needed by some of the tools
  14. AC_PATH_PROG( SED, sed, sed-was-not-found-by-configure,
  15. $PATH:/usr/bin:/usr/local/bin)
  16. AC_SUBST(SED)
  17. if test "x$SED" = "xsed-was-not-found-by-configure"; then
  18. AC_MSG_WARN([sed was not found, this may ruin your chances to build fine])
  19. fi
  20. dnl AR is used by libtool, and try the odd Solaris path too
  21. dnl we use AC_CHECK_TOOL since this should make a library for the target
  22. dnl platform
  23. AC_CHECK_TOOL(AR, ar,
  24. ar-was-not-found-by-configure,
  25. $PATH:/usr/bin:/usr/local/bin:/usr/ccs/bin)
  26. AC_SUBST(AR)
  27. if test "x$AR" = "xar-was-not-found-by-configure"; then
  28. AC_MSG_WARN([ar was not found, this may ruin your chances to build fine])
  29. fi
  30. dnl figure out the libcurl version
  31. VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
  32. AM_INIT_AUTOMAKE(curl,$VERSION)
  33. AC_MSG_CHECKING([curl version])
  34. AC_MSG_RESULT($VERSION)
  35. dnl
  36. dnl we extract the numerical version for curl-config only
  37. VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
  38. AC_SUBST(VERSIONNUM)
  39. dnl Solaris pkgadd support definitions
  40. PKGADD_PKG="HAXXcurl"
  41. PKGADD_NAME="cURL - a client that groks URLs"
  42. PKGADD_VENDOR="curl.haxx.se"
  43. AC_SUBST(PKGADD_PKG)
  44. AC_SUBST(PKGADD_NAME)
  45. AC_SUBST(PKGADD_VENDOR)
  46. dnl
  47. dnl initialize all the info variables
  48. curl_ssl_msg="no (--with-ssl / --with-gnutls)"
  49. curl_zlib_msg="no (--with-zlib)"
  50. curl_krb4_msg="no (--with-krb4*)"
  51. curl_gss_msg="no (--with-gssapi)"
  52. curl_spnego_msg="no (--with-spnego)"
  53. curl_ares_msg="no (--enable-ares)"
  54. curl_ipv6_msg="no (--enable-ipv6)"
  55. curl_idn_msg="no (--with-libidn)"
  56. curl_manual_msg="no (--enable-manual)"
  57. curl_verbose_msg="enabled (--disable-verbose)"
  58. curl_sspi_msg="no (--enable-sspi)"
  59. dnl
  60. dnl Detect the canonical host and target build environment
  61. dnl
  62. AC_CANONICAL_HOST
  63. dnl Get system canonical name
  64. AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
  65. dnl Check for AIX weirdos
  66. AC_AIX
  67. dnl Checks for programs.
  68. AC_PROG_CC
  69. dnl check for how to do large files
  70. AC_SYS_LARGEFILE
  71. dnl check for cygwin stuff
  72. AC_LIBTOOL_WIN32_DLL
  73. dnl libtool setup
  74. AC_PROG_LIBTOOL
  75. AC_MSG_CHECKING([if we need -no-undefined])
  76. case $host in
  77. *-*-cygwin | *-*-mingw* | *-*-pw32*)
  78. need_no_undefined=yes
  79. ;;
  80. *)
  81. need_no_undefined=no
  82. ;;
  83. esac
  84. AC_MSG_RESULT($need_no_undefined)
  85. AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
  86. AC_MSG_CHECKING([if we need -mimpure-text])
  87. mimpure=no
  88. case $host in
  89. *-*-solaris2*)
  90. if test "$GCC" = "yes"; then
  91. mimpure="yes"
  92. fi
  93. ;;
  94. *)
  95. ;;
  96. esac
  97. AC_MSG_RESULT($mimpure)
  98. AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
  99. AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
  100. case $host in
  101. *-*-mingw*)
  102. AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
  103. AC_MSG_RESULT(yes)
  104.    AC_MSG_CHECKING([if we need CURL_STATICLIB])
  105. if test "X$enable_shared" = "Xno"
  106. then
  107. AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
  108. AC_MSG_RESULT(yes)
  109.    else
  110.      AC_MSG_RESULT(no)
  111. fi
  112. ;;
  113. *)
  114. AC_MSG_RESULT(no)
  115. ;;
  116. esac
  117. dnl The install stuff has already been taken care of by the automake stuff
  118. dnl AC_PROG_INSTALL
  119. AC_PROG_MAKE_SET
  120. dnl ************************************************************
  121. dnl switch off particular protocols
  122. dnl
  123. AC_MSG_CHECKING([whether to support http])
  124. AC_ARG_ENABLE(http,
  125. AC_HELP_STRING([--enable-http],[Enable HTTP support])
  126. AC_HELP_STRING([--disable-http],[Disable HTTP support]),
  127. [ case "$enableval" in
  128. no)
  129. AC_MSG_RESULT(no)
  130. AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
  131. AC_MSG_WARN([disable HTTP disables FTP over proxy and GOPHER too])
  132. AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
  133. AC_SUBST(CURL_DISABLE_HTTP, [1])
  134. AC_SUBST(CURL_DISABLE_GOPHER, [1])
  135. ;;
  136. *) AC_MSG_RESULT(yes)
  137. ;;
  138. esac ],
  139. AC_MSG_RESULT(yes)
  140. )
  141. AC_MSG_CHECKING([whether to support ftp])
  142. AC_ARG_ENABLE(ftp,
  143. AC_HELP_STRING([--enable-ftp],[Enable FTP support])
  144. AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
  145. [ case "$enableval" in
  146. no)
  147. AC_MSG_RESULT(no)
  148. AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
  149. AC_SUBST(CURL_DISABLE_FTP, [1])
  150. ;;
  151. *) AC_MSG_RESULT(yes)
  152. ;;
  153. esac ],
  154. AC_MSG_RESULT(yes)
  155. )
  156. AC_MSG_CHECKING([whether to support gopher])
  157. AC_ARG_ENABLE(gopher,
  158. AC_HELP_STRING([--enable-gopher],[Enable GOPHER support])
  159. AC_HELP_STRING([--disable-gopher],[Disable GOPHER support]),
  160. [ case "$enableval" in
  161. no)
  162. AC_MSG_RESULT(no)
  163. AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
  164. AC_SUBST(CURL_DISABLE_GOPHER, [1])
  165. ;;
  166. *) AC_MSG_RESULT(yes)
  167. ;;
  168. esac ],
  169. AC_MSG_RESULT(yes)
  170. )
  171. AC_MSG_CHECKING([whether to support file])
  172. AC_ARG_ENABLE(file,
  173. AC_HELP_STRING([--enable-file],[Enable FILE support])
  174. AC_HELP_STRING([--disable-file],[Disable FILE support]),
  175. [ case "$enableval" in
  176. no)
  177. AC_MSG_RESULT(no)
  178. AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
  179. AC_SUBST(CURL_DISABLE_FILE, [1])
  180. ;;
  181. *) AC_MSG_RESULT(yes)
  182. ;;
  183. esac ],
  184. AC_MSG_RESULT(yes)
  185. )
  186. AC_MSG_CHECKING([whether to support ldap])
  187. AC_ARG_ENABLE(ldap,
  188. AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
  189. AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
  190. [ case "$enableval" in
  191. no)
  192. AC_MSG_RESULT(no)
  193. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  194. AC_SUBST(CURL_DISABLE_LDAP, [1])
  195. ;;
  196. *) AC_MSG_RESULT(yes)
  197. ;;
  198. esac ],
  199. AC_MSG_RESULT(yes)
  200. )
  201. AC_MSG_CHECKING([whether to support dict])
  202. AC_ARG_ENABLE(dict,
  203. AC_HELP_STRING([--enable-dict],[Enable DICT support])
  204. AC_HELP_STRING([--disable-dict],[Disable DICT support]),
  205. [ case "$enableval" in
  206. no)
  207. AC_MSG_RESULT(no)
  208. AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
  209. AC_SUBST(CURL_DISABLE_DICT, [1])
  210. ;;
  211. *) AC_MSG_RESULT(yes)
  212. ;;
  213. esac ],
  214. AC_MSG_RESULT(yes)
  215. )
  216. AC_MSG_CHECKING([whether to support telnet])
  217. AC_ARG_ENABLE(telnet,
  218. AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
  219. AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
  220. [ case "$enableval" in
  221. no)
  222. AC_MSG_RESULT(no)
  223. AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
  224. AC_SUBST(CURL_DISABLE_TELNET, [1])
  225. ;;
  226. *) AC_MSG_RESULT(yes)
  227. ;;
  228. esac ],
  229. AC_MSG_RESULT(yes)
  230. )
  231. dnl **********************************************************************
  232. dnl Check for built-in manual
  233. dnl **********************************************************************
  234. AC_MSG_CHECKING([whether to provide built-in manual])
  235. AC_ARG_ENABLE(manual,
  236. AC_HELP_STRING([--enable-manual],[Enable built-in manual])
  237. AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
  238. [ case "$enableval" in
  239. no)
  240. AC_MSG_RESULT(no)
  241. ;;
  242. *) AC_MSG_RESULT(yes)
  243. USE_MANUAL="1"
  244. ;;
  245. esac ],
  246. AC_MSG_RESULT(yes)
  247. USE_MANUAL="1"
  248. )
  249. dnl The actual use of the USE_MANUAL variable is done much later in this
  250. dnl script to allow other actions to disable it as well.
  251. dnl **********************************************************************
  252. dnl Checks for libraries.
  253. dnl **********************************************************************
  254. dnl gethostbyname without lib or in the nsl lib?
  255. AC_CHECK_FUNC(gethostbyname,
  256. [HAVE_GETHOSTBYNAME="1"
  257. ],
  258. [ AC_CHECK_LIB(nsl, gethostbyname,
  259. [HAVE_GETHOSTBYNAME="1"
  260. LIBS="$LIBS -lnsl"
  261. ])
  262. ])
  263. if test "$HAVE_GETHOSTBYNAME" != "1"
  264. then
  265. dnl gethostbyname in the socket lib?
  266. AC_CHECK_LIB(socket, gethostbyname,
  267. [HAVE_GETHOSTBYNAME="1"
  268. LIBS="$LIBS -lsocket"
  269. ])
  270. fi
  271. dnl At least one system has been identified to require BOTH nsl and socket
  272. dnl libs at the same time to link properly.
  273. if test "$HAVE_GETHOSTBYNAME" != "1"
  274. then
  275. AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
  276. my_ac_save_LIBS=$LIBS
  277. LIBS="-lnsl -lsocket $LIBS"
  278. AC_TRY_LINK( ,
  279. [gethostbyname();],
  280. [ dnl found it!
  281. HAVE_GETHOSTBYNAME="1"
  282. AC_MSG_RESULT([yes])],
  283. [ dnl failed!
  284. AC_MSG_RESULT([no])
  285. dnl restore LIBS
  286. LIBS=$my_ac_save_LIBS]
  287. )
  288. fi
  289. if test "$HAVE_GETHOSTBYNAME" != "1"
  290. then
  291. dnl This is for Msys/Mingw
  292. AC_MSG_CHECKING([for gethostbyname in ws2_32])
  293. my_ac_save_LIBS=$LIBS
  294. LIBS="-lws2_32 $LIBS"
  295. AC_TRY_LINK([#include <winsock2.h>],
  296. [gethostbyname("www.dummysite.com");],
  297. [ dnl worked!
  298. ws2="yes"
  299. AC_MSG_RESULT([yes])
  300. HAVE_GETHOSTBYNAME="1"],
  301. [ dnl failed, restore LIBS
  302. LIBS=$my_ac_save_LIBS
  303. AC_MSG_RESULT(no)]
  304. )
  305. fi
  306. if test "$HAVE_GETHOSTBYNAME" != "1"
  307. then
  308. dnl gethostbyname in the net lib - for BeOS
  309. AC_CHECK_LIB(net, gethostbyname,
  310. [HAVE_GETHOSTBYNAME="1"
  311. LIBS="$LIBS -lnet"
  312. ])
  313. fi
  314. if test "$HAVE_GETHOSTBYNAME" = "1"; then
  315. AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
  316. else
  317. AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
  318. fi
  319. dnl resolve lib?
  320. AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
  321. if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
  322. AC_CHECK_LIB(resolve, strcasecmp,
  323. [LIBS="-lresolve $LIBS"],
  324. ,
  325. -lnsl)
  326. fi
  327. dnl socket lib?
  328. AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
  329. dnl dl lib?
  330. AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ])
  331. AC_MSG_CHECKING([whether to use libgcc])
  332. AC_ARG_ENABLE(libgcc,
  333. AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
  334. [ case "$enableval" in
  335. yes)
  336. LIBS="$LIBS -lgcc"
  337. AC_MSG_RESULT(yes)
  338. ;;
  339. *) AC_MSG_RESULT(no)
  340. ;;
  341. esac ],
  342. AC_MSG_RESULT(no)
  343. )
  344. dnl **********************************************************************
  345. dnl Check for the name of dynamic OpenLDAP libraries
  346. dnl **********************************************************************
  347. LDAPLIBNAME=""
  348. AC_ARG_WITH(ldap-lib,
  349. AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of dynamic ldap lib file]),
  350. [LDAPLIBNAME="$withval"])
  351. LBERLIBNAME=""
  352. AC_ARG_WITH(lber-lib,
  353. AC_HELP_STRING([--with-lber-lib=libname],[Specify name of dynamic lber lib file]),
  354. [LBERLIBNAME="$withval"])
  355. if test x$CURL_DISABLE_LDAP != x1 ; then
  356. if test -z "$LDAPLIBNAME" ; then
  357. case $host in
  358. *-*-cygwin | *-*-mingw* | *-*-pw32*)
  359. dnl Windows uses a single and unique OpenLDAP DLL name
  360. LDAPLIBNAME="wldap32.dll"
  361. LBERLIBNAME="no"
  362. ;;
  363. esac
  364. fi
  365. if test "$LDAPLIBNAME" ; then
  366. AC_DEFINE_UNQUOTED(DL_LDAP_FILE, "$LDAPLIBNAME")
  367. AC_MSG_CHECKING([name of dynamic library ldap])
  368. AC_MSG_RESULT($LDAPLIBNAME)
  369. else
  370. dnl Try to find the right ldap library name for this system
  371. CURL_DLLIB_NAME(DL_LDAP_FILE, ldap)
  372. fi
  373. if test "$LBERLIBNAME" ; then
  374. dnl If name is "no" then don't define this variable at all
  375. dnl (it's only needed if libldap.so's dependencies are broken).
  376. if test "$LBERLIBNAME" != "no" ; then
  377. AC_DEFINE_UNQUOTED(DL_LBER_FILE, "$LBERLIBNAME")
  378. fi
  379. AC_MSG_CHECKING([name of dynamic library lber])
  380. AC_MSG_RESULT($LBERLIBNAME)
  381. else
  382. dnl Try to find the right lber library name for this system
  383. CURL_DLLIB_NAME(DL_LBER_FILE, lber)
  384. fi
  385. fi
  386. dnl **********************************************************************
  387. dnl Check for the presence of the winmm library.
  388. dnl **********************************************************************
  389. AC_MSG_CHECKING([for timeGetTime in winmm])
  390. my_ac_save_LIBS=$LIBS
  391. LIBS="-lwinmm $LIBS"
  392. AC_TRY_LINK([#include <windef.h>
  393. #include <mmsystem.h>
  394. ],
  395. [timeGetTime();],
  396. [ dnl worked!
  397. AC_MSG_RESULT([yes])
  398. ],
  399. [ dnl failed, restore LIBS
  400. LIBS=$my_ac_save_LIBS
  401. AC_MSG_RESULT(no)]
  402. )
  403. dnl **********************************************************************
  404. dnl Checks for IPv6
  405. dnl **********************************************************************
  406. AC_MSG_CHECKING([whether to enable ipv6])
  407. AC_ARG_ENABLE(ipv6,
  408. AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
  409. AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
  410. [ case "$enableval" in
  411. no)
  412. AC_MSG_RESULT(no)
  413. ipv6=no
  414. ;;
  415. *) AC_MSG_RESULT(yes)
  416. ipv6=yes
  417. ;;
  418. esac ],
  419. AC_TRY_RUN([ /* is AF_INET6 available? */
  420. #include <sys/types.h>
  421. #include <sys/socket.h>
  422. main()
  423. {
  424. if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
  425. exit(1);
  426. else
  427. exit(0);
  428. }
  429. ],
  430. AC_MSG_RESULT(yes)
  431. ipv6=yes,
  432. AC_MSG_RESULT(no)
  433. ipv6=no,
  434. AC_MSG_RESULT(no)
  435. ipv6=no
  436. ))
  437. if test "$ipv6" = "yes"; then
  438. curl_ipv6_msg="enabled"
  439. CURL_CHECK_WORKING_GETADDRINFO
  440. CURL_CHECK_NI_WITHSCOPEID
  441. fi
  442. dnl **********************************************************************
  443. dnl Check how non-blocking sockets are set
  444. dnl **********************************************************************
  445. AC_ARG_ENABLE(nonblocking,
  446. AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it])
  447. AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]),
  448. [
  449. if test "$enableval" = "no" ; then
  450. AC_MSG_WARN([non-blocking sockets disabled])
  451. AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
  452. [to disable NON-BLOCKING connections])
  453. else
  454. CURL_CHECK_NONBLOCKING_SOCKET
  455. fi
  456. ],
  457. [
  458. CURL_CHECK_NONBLOCKING_SOCKET
  459. ])
  460. dnl **********************************************************************
  461. dnl Check if the operating system allows programs to write to their own argv[]
  462. dnl **********************************************************************
  463. AC_MSG_CHECKING([if argv can be written to])
  464. AC_CACHE_VAL(curl_cv_writable_argv, [
  465. AC_RUN_IFELSE([[
  466. int main(int argc, char ** argv) {
  467. argv[0][0] = ' ';
  468. return (argv[0][0] == ' ')?0:1;
  469. }
  470. ]],
  471. curl_cv_writable_argv=yes,
  472. curl_cv_writable_argv=no,
  473. curl_cv_writable_argv=cross)
  474. ])
  475. case $curl_cv_writable_argv in
  476. yes)
  477. AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
  478. AC_MSG_RESULT(yes)
  479. ;;
  480. no)
  481. AC_MSG_RESULT(no)
  482. ;;
  483. *)
  484. AC_MSG_RESULT(no)
  485. AC_MSG_WARN([the previous check could not be made default was used])
  486. ;;
  487. esac
  488. dnl **********************************************************************
  489. dnl Check for the presence of Kerberos4 libraries and headers
  490. dnl **********************************************************************
  491. AC_ARG_WITH(krb4-includes,
  492. AC_HELP_STRING([--with-krb4-includes=DIR],
  493. [Specify location of kerberos4 headers]),[
  494. CPPFLAGS="$CPPFLAGS -I$withval"
  495. KRB4INC="$withval"
  496. want_krb4=yes
  497. ])
  498. AC_ARG_WITH(krb4-libs,
  499. AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
  500. LDFLAGS="$LDFLAGS -L$withval"
  501. KRB4LIB="$withval"
  502. want_krb4=yes
  503. ])
  504. OPT_KRB4=off
  505. AC_ARG_WITH(krb4,dnl
  506. AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
  507. OPT_KRB4="$withval"
  508. if test X"$OPT_KRB4" != Xno; then
  509. want_krb4="yes"
  510. if test X"$OPT_KRB4" != Xyes; then
  511. LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
  512. KRB4LIB="$OPT_KRB4/lib$libsuff"
  513. CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
  514. KRB4INC="$OPT_KRB4/include"
  515. fi
  516. fi
  517. ])
  518. AC_MSG_CHECKING([if Kerberos4 support is requested])
  519. if test "$want_krb4" = yes
  520. then
  521. if test "$ipv6" = "yes"; then
  522. echo krb4 is not compatible with IPv6
  523. exit 1
  524. fi
  525. AC_MSG_RESULT(yes)
  526. dnl Check for & handle argument to --with-krb4
  527. AC_MSG_CHECKING(where to look for Kerberos4)
  528. if test X"$OPT_KRB4" = Xyes
  529. then
  530. AC_MSG_RESULT([defaults])
  531. else
  532. AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
  533. fi
  534. dnl Check for DES library
  535. AC_CHECK_LIB(des, des_pcbc_encrypt,
  536. [
  537. AC_CHECK_HEADERS(des.h)
  538. dnl resolv lib?
  539. AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
  540. dnl Check for the Kerberos4 library
  541. AC_CHECK_LIB(krb, krb_net_read,
  542. [
  543. dnl Check for header files
  544. AC_CHECK_HEADERS(krb.h)
  545. dnl we found the required libraries, add to LIBS
  546. LIBS="-lkrb -lcom_err -ldes $LIBS"
  547. dnl Check for function krb_get_our_ip_for_realm
  548. dnl this is needed for NAT networks
  549. AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
  550. dnl add define KRB4
  551. AC_DEFINE(HAVE_KRB4, 1,
  552. [if you have the Kerberos4 libraries (including -ldes)])
  553. dnl substitute it too!
  554. KRB4_ENABLED=1
  555. AC_SUBST(KRB4_ENABLED)
  556. curl_krb4_msg="enabled"
  557. dnl the krb4 stuff needs a strlcpy()
  558. AC_CHECK_FUNCS(strlcpy)
  559. ])
  560. ])
  561. else
  562. AC_MSG_RESULT(no)
  563. fi
  564. dnl **********************************************************************
  565. dnl Check for FBopenssl(SPNEGO) libraries
  566. dnl **********************************************************************
  567. AC_ARG_WITH(spnego,
  568. AC_HELP_STRING([--with-spnego=DIR],
  569. [Specify location of SPNEGO library fbopenssl]), [
  570. SPNEGO_ROOT="$withval"
  571. if test x"$SPNEGO_ROOT" != xno; then
  572. want_spnego="yes"
  573. fi
  574. ])
  575. AC_MSG_CHECKING([if SPNEGO support is requested])
  576. if test x"$want_spnego" = xyes; then
  577. if test X"$SPNEGO_ROOT" = Xyes; then
  578. AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
  579. AC_MSG_RESULT(no)
  580. else
  581. if test -z "$SPNEGO_LIB_DIR"; then
  582. LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
  583. else
  584. LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
  585. fi
  586. AC_MSG_RESULT(yes)
  587. AC_DEFINE(HAVE_SPNEGO, 1,
  588. [Define this if you have the SPNEGO library fbopenssl])
  589. curl_spnego_msg="enabled"
  590. fi
  591. else
  592. AC_MSG_RESULT(no)
  593. fi
  594. dnl **********************************************************************
  595. dnl Check for GSS-API libraries
  596. dnl **********************************************************************
  597. AC_ARG_WITH(gssapi-includes,
  598. AC_HELP_STRING([--with-gssapi-includes=DIR],
  599. [Specify location of GSSAPI header]),
  600. [ GSSAPI_INCS="-I$withval"
  601. want_gss="yes" ]
  602. )
  603. AC_ARG_WITH(gssapi-libs,
  604. AC_HELP_STRING([--with-gssapi-libs=DIR],
  605. [Specify location of GSSAPI libs]),
  606. [ GSSAPI_LIBS="-L$withval"
  607. want_gss="yes" ]
  608. )
  609. AC_ARG_WITH(gssapi,
  610. AC_HELP_STRING([--with-gssapi=DIR],
  611. [Where to look for GSSAPI]), [
  612. GSSAPI_ROOT="$withval"
  613. if test x"$GSSAPI_ROOT" != xno; then
  614. want_gss="yes"
  615. fi
  616. ])
  617. save_CPPFLAGS="$CPPFLAGS"
  618. AC_MSG_CHECKING([if GSSAPI support is requested])
  619. if test x"$want_gss" = xyes; then
  620. AC_MSG_RESULT(yes)
  621. if test -z "$GSSAPI_INCS"; then
  622. if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
  623. GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
  624. elif test "$GSSAPI_ROOT" != "yes"; then
  625. GSSAPI_INCS="-I$GSSAPI_ROOT/include"
  626. fi
  627. fi
  628. CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
  629. AC_CHECK_HEADER(gss.h,
  630. [
  631. dnl found in the given dirs
  632. AC_DEFINE(HAVE_GSSGNU, 1, [if you have the GNU gssapi libraries])
  633. gnu_gss=yes
  634. ],
  635. [
  636. dnl not found, check Heimdal
  637. AC_CHECK_HEADER(gssapi.h,
  638. [
  639. dnl found in the given dirs
  640. AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
  641. ],
  642. [
  643. dnl not found, check in gssapi/ subdir
  644. AC_CHECK_HEADER(gssapi/gssapi.h,
  645. [
  646. dnl found
  647. AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
  648. ],
  649. [
  650. dnl no header found, disabling GSS
  651. want_gss=no
  652. AC_MSG_WARN(disabling GSSAPI since no header files was found)
  653. ]
  654. )
  655. ]
  656. )
  657. ]
  658. )
  659. else
  660. AC_MSG_RESULT(no)
  661. fi
  662. if test x"$want_gss" = xyes; then
  663. AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
  664. curl_gss_msg="enabled (MIT/Heimdal)"
  665. if test -n "$gnu_gss"; then
  666. curl_gss_msg="enabled (GNU GSS)"
  667. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR -lgss"
  668. elif test -z "$GSSAPI_LIB_DIR"; then
  669. if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
  670. gss_ldflags=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
  671. LDFLAGS="$LDFLAGS $gss_ldflags"
  672. elif test "$GSSAPI_ROOT" != "yes"; then
  673. LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff -lgssapi"
  674. else
  675. LDFLAGS="$LDFLAGS -lgssapi"
  676. fi
  677. else
  678. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR -lgssapi"
  679. fi
  680. else
  681. CPPFLAGS="$save_CPPFLAGS"
  682. fi
  683. dnl **********************************************************************
  684. dnl Check for the presence of SSL libraries and headers
  685. dnl **********************************************************************
  686. dnl Default to compiler & linker defaults for SSL files & libraries.
  687. OPT_SSL=off
  688. dnl Default to no CA bundle
  689. ca="no"
  690. AC_ARG_WITH(ssl,dnl
  691. AC_HELP_STRING([--with-ssl=PATH],[where to look for SSL, PATH points to the SSL installation (default: /usr/local/ssl)])
  692. AC_HELP_STRING([--without-ssl], [disable SSL]),
  693. OPT_SSL=$withval)
  694. if test X"$OPT_SSL" != Xno; then
  695. dnl backup the pre-ssl variables
  696. CLEANLDFLAGS="$LDFLAGS"
  697. CLEANCPPFLAGS="$CPPFLAGS"
  698. CLEANLIBS="$LIBS"
  699. case "$OPT_SSL" in
  700. yes)
  701. dnl --with-ssl (without path) used
  702. if test x$cross_compiling != xyes; then
  703. dnl only do pkg-config magic when not cross-compiling
  704. PKGTEST="yes"
  705. fi
  706. PREFIX_OPENSSL=/usr/local/ssl
  707. LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
  708. ;;
  709. off)
  710. dnl no --with-ssl option given, just check default places
  711. if test x$cross_compiling != xyes; then
  712. dnl only do pkg-config magic when not cross-compiling
  713. PKGTEST="yes"
  714. fi
  715. PREFIX_OPENSSL=
  716. ;;
  717. *)
  718. dnl check the given --with-ssl spot
  719. PKGTEST="no"
  720. PREFIX_OPENSSL=$OPT_SSL
  721. LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
  722. LDFLAGS="$LDFLAGS -L$LIB_OPENSSL"
  723. CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
  724. ;;
  725. esac
  726. if test "$PKGTEST" = "yes"; then
  727. dnl Detect the pkg-config tool, as it may have extra info about the
  728. dnl openssl installation we can use. I *believe* this is what we are
  729. dnl expected to do on really recent Redhat Linux hosts.
  730. AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
  731. if test "$PKGCONFIG" != "no" ; then
  732. AC_MSG_CHECKING([OpenSSL options with pkg-config])
  733. $PKGCONFIG --exists openssl
  734. SSL_EXISTS=$?
  735. if test "$SSL_EXISTS" -eq "0"; then
  736. SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
  737. SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
  738. SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
  739. LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
  740. dnl use the values pkg-config reported
  741. LIBS="$LIBS $SSL_LIBS"
  742. CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
  743. LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
  744. AC_MSG_RESULT([found])
  745. else
  746. AC_MSG_RESULT([no])
  747. fi
  748. fi
  749. fi
  750. dnl This is for Msys/Mingw
  751. AC_MSG_CHECKING([for gdi32])
  752. my_ac_save_LIBS=$LIBS
  753. LIBS="-lgdi32 $LIBS"
  754. AC_TRY_LINK([#include <windef.h>
  755. #include <wingdi.h>],
  756. [GdiFlush();],
  757. [ dnl worked!
  758. AC_MSG_RESULT([yes])],
  759. [ dnl failed, restore LIBS
  760. LIBS=$my_ac_save_LIBS
  761. AC_MSG_RESULT(no)]
  762. )
  763. AC_CHECK_LIB(crypto, CRYPTO_lock,[
  764. HAVECRYPTO="yes"
  765. LIBS="-lcrypto $LIBS"
  766. ],[
  767. LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
  768. CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
  769. AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
  770. HAVECRYPTO="yes"
  771. LIBS="-lcrypto $LIBS"], [
  772. LDFLAGS="$CLEANLDFLAGS"
  773. CPPFLAGS="$CLEANCPPFLAGS"
  774. LIBS="$CLEANLIBS"
  775. ])
  776. ])
  777. if test X"$HAVECRYPTO" = X"yes"; then
  778. dnl This is only reasonable to do if crypto actually is there: check for
  779. dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
  780. AC_CHECK_LIB(ssl, SSL_connect)
  781. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  782. dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
  783. AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
  784. OLIBS=$LIBS
  785. LIBS="$LIBS -lRSAglue -lrsaref"
  786. AC_CHECK_LIB(ssl, SSL_connect)
  787. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  788. dnl still no SSL_connect
  789. AC_MSG_RESULT(no)
  790. LIBS=$OLIBS
  791. else
  792. AC_MSG_RESULT(yes)
  793. fi
  794. else
  795. dnl Have the libraries--check for SSLeay/OpenSSL headers
  796. AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
  797. openssl/pem.h openssl/ssl.h openssl/err.h,
  798. curl_ssl_msg="enabled (OpenSSL)"
  799. OPENSSL_ENABLED=1
  800. AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
  801. if test $ac_cv_header_openssl_x509_h = no; then
  802. AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h,
  803. curl_ssl_msg="enabled (OpenSSL)"
  804. OPENSSL_ENABLED=1)
  805. fi
  806. fi
  807. if test X"$OPENSSL_ENABLED" = X"1"; then
  808. AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
  809. dnl is there a pkcs12.h header present?
  810. AC_CHECK_HEADERS(openssl/pkcs12.h)
  811. else
  812. LIBS="$CLEANLIBS"
  813. fi
  814. dnl USE_SSLEAY is the historical name for what configure calls
  815. dnl OPENSSL_ENABLED; the names should really be unified
  816. USE_SSLEAY="$OPENSSL_ENABLED"
  817. AC_SUBST(USE_SSLEAY)
  818. if test X"$OPT_SSL" != Xoff &&
  819. test "$OPENSSL_ENABLED" != "1"; then
  820. AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
  821. fi
  822. fi
  823. if test X"$OPENSSL_ENABLED" = X"1"; then
  824. dnl If the ENGINE library seems to be around, check for the OpenSSL engine
  825. dnl stuff, it is kind of "separated" from the main SSL check
  826. AC_CHECK_FUNC(ENGINE_init,
  827. [
  828. AC_CHECK_HEADERS(openssl/engine.h)
  829. AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
  830. ])
  831. dnl these can only exist if openssl exists
  832. AC_CHECK_FUNCS( RAND_status \
  833. RAND_screen \
  834. RAND_egd \
  835. CRYPTO_cleanup_all_ex_data )
  836. fi
  837. if test "$OPENSSL_ENABLED" = "1"; then
  838. if test -n "$LIB_OPENSSL"; then
  839. dnl when the ssl shared libs were found in a path that the run-time
  840. dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
  841. dnl to prevent further configure tests to fail due to this
  842. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
  843. export LD_LIBRARY_PATH
  844. AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
  845. fi
  846. fi
  847. fi
  848. dnl **********************************************************************
  849. dnl Check for the random seed preferences
  850. dnl **********************************************************************
  851. if test X"$OPENSSL_ENABLED" = X"1"; then
  852. AC_ARG_WITH(egd-socket,
  853. AC_HELP_STRING([--with-egd-socket=FILE],
  854. [Entropy Gathering Daemon socket pathname]),
  855. [ EGD_SOCKET="$withval" ]
  856. )
  857. if test -n "$EGD_SOCKET" ; then
  858. AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
  859. [your Entropy Gathering Daemon socket pathname] )
  860. fi
  861. dnl Check for user-specified random device
  862. AC_ARG_WITH(random,
  863. AC_HELP_STRING([--with-random=FILE],
  864. [read randomness from FILE (default=/dev/urandom)]),
  865. [ RANDOM_FILE="$withval" ],
  866. [
  867. dnl Check for random device
  868. AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
  869. ]
  870. )
  871. if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
  872. AC_SUBST(RANDOM_FILE)
  873. AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
  874. [a suitable file to read random data from])
  875. fi
  876. fi
  877. dnl ----------------------------------------------------
  878. dnl FIX: only check for GnuTLS if OpenSSL is not enabled
  879. dnl ----------------------------------------------------
  880. dnl Default to compiler & linker defaults for GnuTLS files & libraries.
  881. OPT_GNUTLS=no
  882. AC_ARG_WITH(gnutls,dnl
  883. AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root (default: /usr/local/)])
  884. AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
  885. OPT_GNUTLS=$withval)
  886. if test "$OPENSSL_ENABLED" != "1"; then
  887. if test X"$OPT_GNUTLS" != Xno; then
  888. if test "x$OPT_GNUTLS" = "xyes"; then
  889. check=`libgnutls-config --version 2>/dev/null`
  890. if test -n "$check"; then
  891. addlib=`libgnutls-config --libs`
  892. addcflags=`libgnutls-config --cflags`
  893. version=`libgnutls-config --version`
  894. gtlsprefix=`libgnutls-config --prefix`
  895. fi
  896. else
  897. addlib=`$OPT_GNUTLS/bin/libgnutls-config --libs`
  898. addcflags=`$OPT_GNUTLS/bin/libgnutls-config --cflags`
  899. version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null`
  900. gtlsprefix=$OPT_GNUTLS
  901. if test -z "$version"; then
  902. version="unknown"
  903. fi
  904. fi
  905. if test -n "$addlib"; then
  906. CLEANLDFLAGS="$LDFLAGS"
  907. CLEANCPPFLAGS="$CPPFLAGS"
  908. LDFLAGS="$LDFLAGS $addlib"
  909. if test "$addcflags" != "-I/usr/include"; then
  910. CPPFLAGS="$CPPFLAGS $addcflags"
  911. fi
  912. AC_CHECK_LIB(gnutls, gnutls_check_version,
  913. [
  914. AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
  915. AC_SUBST(USE_GNUTLS, [1])
  916. USE_GNUTLS="yes"
  917. curl_ssl_msg="enabled (GnuTLS)"
  918. ],
  919. [
  920. LDFLAGS="$CLEANLDFLAGS"
  921. CPPFLAGS="$CLEANCPPFLAGS"
  922. ])
  923. if test "x$USE_GNUTLS" = "xyes"; then
  924. AC_MSG_NOTICE([detected GnuTLS version $version])
  925. dnl when shared libs were found in a path that the run-time
  926. dnl linker doesn't search through, we need to add it to
  927. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  928. dnl due to this
  929. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
  930. export LD_LIBRARY_PATH
  931. AC_MSG_NOTICE([Added $gtlsprefix/lib$libsuff to LD_LIBRARY_PATH])
  932. fi
  933. fi
  934. fi dnl GNUTLS not disabled
  935. if test X"$USE_GNUTLS" != "Xyes"; then
  936. AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
  937. AC_MSG_WARN([Use --with-ssl or --with-gnutls to address this.])
  938. fi
  939. fi dnl OPENSSL != 1
  940. dnl **********************************************************************
  941. dnl Check for the CA bundle
  942. dnl **********************************************************************
  943. if test X"$USE_GNUTLS$OPENSSL_ENABLED" != "X"; then
  944. AC_MSG_CHECKING([CA cert bundle install path])
  945. AC_ARG_WITH(ca-bundle,
  946. AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
  947. AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
  948. [ ca="$withval" ],
  949. [
  950. if test "x$prefix" != xNONE; then
  951. ca="\${prefix}/share/curl/curl-ca-bundle.crt"
  952. else
  953. ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
  954. fi
  955. ] )
  956. if test "x$ca" != "xno"; then
  957. CURL_CA_BUNDLE='"'$ca'"'
  958. AC_SUBST(CURL_CA_BUNDLE)
  959. fi
  960. AC_MSG_RESULT([$ca])
  961. fi dnl only done if some kind of SSL was enabled
  962. AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
  963. dnl **********************************************************************
  964. dnl Check for the presence of ZLIB libraries and headers
  965. dnl **********************************************************************
  966. dnl Check for & handle argument to --with-zlib.
  967. _cppflags=$CPPFLAGS
  968. _ldflags=$LDFLAGS
  969. AC_ARG_WITH(zlib,
  970. AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
  971. AC_HELP_STRING([--without-zlib],[disable use of zlib]),
  972. [OPT_ZLIB="$withval"])
  973. if test "$OPT_ZLIB" = "no" ; then
  974. AC_MSG_WARN([zlib disabled])
  975. else
  976. if test "$OPT_ZLIB" = "yes" ; then
  977. OPT_ZLIB=""
  978. fi
  979. if test -z "$OPT_ZLIB" ; then
  980. dnl check for the lib first without setting any new path, since many
  981. dnl people have it in the default path
  982. AC_CHECK_LIB(z, inflateEnd,
  983. dnl libz found, set the variable
  984. [HAVE_LIBZ="1"],
  985. dnl if no lib found, try /usr/local
  986. [OPT_ZLIB="/usr/local"])
  987. fi
  988. dnl Add a nonempty path to the compiler flags
  989. if test -n "$OPT_ZLIB"; then
  990. CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
  991. LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
  992. fi
  993. AC_CHECK_HEADER(zlib.h,
  994. [
  995. dnl zlib.h was found
  996. HAVE_ZLIB_H="1"
  997. dnl if the lib wasn't found already, try again with the new paths
  998. if test "$HAVE_LIBZ" != "1"; then
  999. AC_CHECK_LIB(z, gzread,
  1000. [
  1001. dnl the lib was found!
  1002. HAVE_LIBZ="1"
  1003. ],
  1004. [ CPPFLAGS=$_cppflags
  1005. LDFLAGS=$_ldflags])
  1006. fi
  1007. ],
  1008. [
  1009. dnl zlib.h was not found, restore the flags
  1010. CPPFLAGS=$_cppflags
  1011. LDFLAGS=$_ldflags]
  1012. )
  1013. if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
  1014. then
  1015. AC_MSG_WARN([configure found only the libz lib, not the header file!])
  1016. elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
  1017. then
  1018. AC_MSG_WARN([configure found only the libz header file, not the lib!])
  1019. elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
  1020. then
  1021. dnl both header and lib were found!
  1022. AC_SUBST(HAVE_LIBZ)
  1023. AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
  1024. AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
  1025. LIBS="$LIBS -lz"
  1026. dnl replace 'HAVE_LIBZ' in the automake makefile.ams
  1027. AMFIXLIB="1"
  1028. AC_MSG_NOTICE([found both libz and libz.h header])
  1029. curl_zlib_msg="enabled"
  1030. fi
  1031. fi
  1032. dnl set variable for use in automakefile(s)
  1033. AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
  1034. AC_MSG_CHECKING([whether to build with libidn])
  1035. AC_ARG_WITH(libidn,
  1036. AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
  1037. AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
  1038. [LIBIDN="$withval"])
  1039. case "$LIBIDN" in
  1040. no)
  1041. AC_MSG_RESULT(no)
  1042. ;;
  1043. *) AC_MSG_RESULT(yes)
  1044. idn=""
  1045. dnl if there is a given path, check that FIRST
  1046. if test -n "$LIBIDN"; then
  1047. if test "x$LIBIDN" != "xyes"; then
  1048. oldLDFLAGS=$LDFLAGS
  1049. oldCPPFLAGS=$CPPFLAGS
  1050. LDFLAGS="$LDFLAGS -L$LIBIDN/lib"
  1051. CPPFLAGS="$CPPFLAGS -I$LIBIDN/include"
  1052. idn="yes"
  1053. AC_CHECK_LIB(idn, idna_to_ascii_4i, ,
  1054. idn=""
  1055. LDFLAGS=$oldLDFLAGS
  1056. CPPFLAGS=$oldCPPFLAGS)
  1057. fi
  1058. fi
  1059. if test "x$idn" != "xyes"; then
  1060. dnl check with default paths
  1061. idn="yes"
  1062. AC_CHECK_LIB(idn, idna_to_ascii_lz, ,
  1063. idn="")
  1064. fi
  1065. if test "x$idn" = "xyes"; then
  1066. curl_idn_msg="enabled"
  1067. AC_SUBST(IDN_ENABLED, [1])
  1068. dnl different versions of libidn have different setups of these:
  1069. AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror)
  1070. AC_CHECK_HEADERS( idn-free.h tld.h )
  1071. fi
  1072. ;;
  1073. esac
  1074. dnl Default is to try the thread-safe versions of a few functions
  1075. OPT_THREAD=on
  1076. dnl detect AIX 4.3 or later
  1077. dnl see full docs on this reasoning in the lib/hostip.c source file
  1078. AC_MSG_CHECKING([AIX 4.3 or later])
  1079. AC_PREPROC_IFELSE([
  1080. #if defined(_AIX) && defined(_AIX43)
  1081. printf("just fine");
  1082. #else
  1083. #error "this is not AIX 4.3 or later"
  1084. #endif
  1085. ],
  1086. [ AC_MSG_RESULT([yes])
  1087. RECENTAIX=yes
  1088. OPT_THREAD=off ],
  1089. [ AC_MSG_RESULT([no]) ]
  1090. )
  1091. AC_ARG_ENABLE(thread,dnl
  1092. AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
  1093. AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
  1094. [ case "$enableval" in
  1095. no)
  1096. OPT_THREAD=off
  1097. AC_MSG_WARN(libcurl will not get built using thread-safe functions)
  1098. ;;
  1099. *)
  1100. ;;
  1101. esac
  1102. ]
  1103. )
  1104. if test X"$OPT_THREAD" = Xoff
  1105. then
  1106. AC_DEFINE(DISABLED_THREADSAFE, 1, \
  1107. Set to explicitly specify we don't want to use thread-safe functions)
  1108. else
  1109. if test "$ipv6" != "yes"; then
  1110. dnl dig around for gethostbyname_r()
  1111. CURL_CHECK_GETHOSTBYNAME_R()
  1112. dnl dig around for gethostbyaddr_r()
  1113. dnl CURL_CHECK_GETHOSTBYADDR_R()
  1114. fi
  1115. dnl poke around for inet_ntoa_r()
  1116. CURL_CHECK_INET_NTOA_R()
  1117. dnl is there a localtime_r()
  1118. CURL_CHECK_LOCALTIME_R()
  1119. dnl is there a strerror_r()
  1120. CURL_CHECK_STRERROR_R()
  1121. checkfor_gmtime_r="yes"
  1122. fi
  1123. dnl for recent AIX versions, we skip all the thread-safe checks above since
  1124. dnl they claim a thread-safe libc using the standard API. But there are
  1125. dnl some functions still not thread-safe. Check for these!
  1126. dnl Let's hope this split URL remains working:
  1127. dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
  1128. dnl genprogc/thread_quick_ref.htm
  1129. if test "x$RECENTAIX" = "xyes"; then
  1130. AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
  1131. dnl check if this is the IMB xlc compiler
  1132. dnl Details thanks to => http://predef.sourceforge.net/
  1133. AC_MSG_CHECKING([if this is the xlc compiler])
  1134. AC_EGREP_CPP([^__xlC__], [__xlC__],
  1135. dnl action if the text is found, this it has not been replaced by the
  1136. dnl cpp
  1137. XLC="no"
  1138. AC_MSG_RESULT([no]),
  1139. dnl the text was not found, it was replaced by the cpp
  1140. XLC="yes"
  1141. AC_MSG_RESULT([yes])
  1142. CFLAGS="$CFLAGS -qthreaded"
  1143. )
  1144. dnl is there a localtime_r()
  1145. CURL_CHECK_LOCALTIME_R()
  1146. dnl is there a strerror_r()
  1147. CURL_CHECK_STRERROR_R()
  1148. checkfor_gmtime_r="yes"
  1149. fi
  1150. if test x$cross_compiling != xyes; then
  1151. if test x$checkfor_gmtime_r = xyes; then
  1152. dnl if gmtime_r was found, verify that it actuall works, as (at least) HPUX
  1153. dnl 10.20 is known to have a buggy one. If it doesn't work, disable use of
  1154. dnl it.
  1155. AC_MSG_CHECKING([if gmtime_r exists and works])
  1156. AC_RUN_IFELSE([[
  1157. #include <time.h>
  1158. int main(void)
  1159. {
  1160. time_t local = 1170352587;
  1161. struct tm *gmt;
  1162. struct tm keeper;
  1163. putenv("TZ=CST6CDT");
  1164. tzset();
  1165. gmt = gmtime_r(&local, &keeper);
  1166. if(gmt) {
  1167. return 0;
  1168. }
  1169. return 1; /* failure */
  1170. }
  1171. ]],
  1172. dnl success, do nothing
  1173. AC_MSG_RESULT(yes)
  1174. AC_DEFINE(HAVE_GMTIME_R, 1, [if you have (a working) gmtime_r])
  1175. ,
  1176. dnl failure, now disable the function
  1177. AC_MSG_RESULT(no)
  1178. ,
  1179. dnl not invoked when crosscompiling)
  1180. ])
  1181. fi
  1182. else
  1183. dnl and for crosscompilings
  1184. AC_CHECK_FUNCS(gmtime_r)
  1185. fi
  1186. dnl **********************************************************************
  1187. dnl Back to "normal" configuring
  1188. dnl **********************************************************************
  1189. dnl Checks for header files.
  1190. AC_HEADER_STDC
  1191. dnl First check for the very most basic headers. Then we can use these
  1192. dnl ones as default-headers when checking for the rest!
  1193. AC_CHECK_HEADERS(
  1194. sys/types.h \
  1195. sys/time.h \
  1196. sys/select.h \
  1197. sys/socket.h \
  1198. sys/ioctl.h \
  1199. assert.h \
  1200. unistd.h \
  1201. malloc.h \
  1202. stdlib.h \
  1203. limits.h \
  1204. arpa/inet.h \
  1205. net/if.h \
  1206. netinet/in.h \
  1207. netinet/tcp.h \
  1208. netdb.h \
  1209. sys/sockio.h \
  1210. sys/stat.h \
  1211. sys/param.h \
  1212. termios.h \
  1213. termio.h \
  1214. sgtty.h \
  1215. fcntl.h \
  1216. dlfcn.h \
  1217. alloca.h \
  1218. winsock.h \
  1219. winsock2.h \
  1220. time.h \
  1221. io.h \
  1222. pwd.h \
  1223. utime.h \
  1224. sys/utime.h \
  1225. sys/poll.h \
  1226. sys/resource.h \
  1227. libgen.h \
  1228. locale.h \
  1229. errno.h \
  1230. setjmp.h,
  1231. dnl to do if not found
  1232. [],
  1233. dnl to do if found
  1234. [],
  1235. dnl default includes
  1236. [
  1237. #ifdef HAVE_SYS_TYPES_H
  1238. #include <sys/types.h>
  1239. #endif
  1240. #ifdef HAVE_SYS_TIME_H
  1241. #include <sys/time.h>
  1242. #endif
  1243. #ifdef HAVE_SYS_SELECT_H
  1244. #include <sys/select.h>
  1245. #endif
  1246. #ifdef HAVE_SYS_SOCKET_H
  1247. #include <sys/socket.h>
  1248. #endif
  1249. #ifdef HAVE_NETINET_IN_H
  1250. #include <netinet/in.h>
  1251. #endif
  1252. ]
  1253. )
  1254. dnl Checks for typedefs, structures, and compiler characteristics.
  1255. AC_C_CONST
  1256. AC_TYPE_SIZE_T
  1257. AC_HEADER_TIME
  1258. AC_CHECK_SIZEOF(curl_off_t, ,[
  1259. #include <stdio.h>
  1260. #include "$srcdir/include/curl/curl.h"
  1261. ])
  1262. AC_CHECK_SIZEOF(size_t)
  1263. AC_CHECK_SIZEOF(long)
  1264. AC_CHECK_SIZEOF(time_t)
  1265. AC_CHECK_TYPE(long long,
  1266. [AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports long long])]
  1267. longlong="yes"
  1268. )
  1269. if test "xyes" = "x$longlong"; then
  1270. AC_MSG_CHECKING([if numberLL works])
  1271. AC_COMPILE_IFELSE([long long val = 1000LL;],
  1272. [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])]
  1273. AC_MSG_RESULT(yes),
  1274. AC_MSG_RESULT(no)
  1275. )
  1276. fi
  1277. # check for ssize_t
  1278. AC_CHECK_TYPE(ssize_t, ,
  1279. AC_DEFINE(ssize_t, int, [the signed version of size_t]))
  1280. TYPE_SOCKLEN_T
  1281. TYPE_IN_ADDR_T
  1282. TYPE_SOCKADDR_STORAGE
  1283. AC_FUNC_SELECT_ARGTYPES
  1284. dnl Checks for library functions.
  1285. dnl AC_PROG_GCC_TRADITIONAL
  1286. AC_TYPE_SIGNAL
  1287. dnl AC_FUNC_VPRINTF
  1288. AC_CHECK_FUNCS( strtoll \
  1289. socket \
  1290. select \
  1291. strdup \
  1292. strstr \
  1293. strtok_r \
  1294. uname \
  1295. strcasecmp \
  1296. stricmp \
  1297. strcmpi \
  1298. gethostbyaddr \
  1299. gettimeofday \
  1300. inet_addr \
  1301. inet_ntoa \
  1302. inet_pton \
  1303. perror \
  1304. closesocket \
  1305. siginterrupt \
  1306. sigaction \
  1307. signal \
  1308. getpass_r \
  1309. strlcat \
  1310. getpwuid \
  1311. geteuid \
  1312. dlopen \
  1313. utime \
  1314. sigsetjmp \
  1315. basename \
  1316. setlocale \
  1317. ftruncate \
  1318. pipe \
  1319. poll \
  1320. getrlimit \
  1321. setrlimit,
  1322. dnl if found
  1323. [],
  1324. dnl if not found, $ac_func is the name we check for
  1325. func="$ac_func"
  1326. AC_MSG_CHECKING([deeper for $func])
  1327. AC_TRY_LINK( [],
  1328. [ $func ();],
  1329. AC_MSG_RESULT(yes!)
  1330. eval "ac_cv_func_$func=yes"
  1331. def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'`
  1332. AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
  1333. AC_MSG_RESULT(but still no)
  1334. )
  1335. )
  1336. dnl For some reason, the check above doesn't properly detect select() with
  1337. dnl Msys/Mingw
  1338. if test "$ac_cv_func_select" != "yes"; then
  1339. AC_MSG_CHECKING([for select in ws2_32])
  1340. AC_TRY_LINK([#include <winsock2.h>],
  1341. [select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL);],
  1342. [ dnl worked!
  1343. AC_MSG_RESULT([yes])
  1344. HAVE_SELECT="1"
  1345. AC_DEFINE_UNQUOTED(HAVE_SELECT,1)],
  1346. [AC_MSG_ERROR(You can't compile without a select)]
  1347. )
  1348. fi
  1349. dnl sigsetjmp() might be a macro and no function so if it isn't found already
  1350. dnl we make an extra check here!
  1351. if test "$ac_cv_func_sigsetjmp" != "yes"; then
  1352. AC_MSG_CHECKING([for sigsetjmp defined as macro])
  1353. AC_TRY_LINK( [#include <setjmp.h>],
  1354. [sigjmp_buf jmpenv;
  1355. sigsetjmp(jmpenv, 1);],
  1356. AC_MSG_RESULT(yes)
  1357. AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]),
  1358. AC_MSG_RESULT(no)
  1359. )
  1360. fi
  1361. AC_CHECK_DECL(basename, ,
  1362. AC_DEFINE(NEED_BASENAME_PROTO, 1, [If you lack a fine basename() prototype]),
  1363. #ifdef HAVE_STRING_H
  1364. #include <string.h>
  1365. #endif
  1366. #ifdef HAVE_LIBGEN_H
  1367. #include <libgen.h>
  1368. #endif
  1369. )
  1370. AC_MSG_CHECKING([if we are Mac OS X (to disable poll)])
  1371. disable_poll=no
  1372. case $host in
  1373. *-*-darwin*)
  1374. disable_poll="yes";
  1375. ;;
  1376. *)
  1377. ;;
  1378. esac
  1379. AC_MSG_RESULT($disable_poll)
  1380. if test "$disable_poll" = "no"; then
  1381. dnl poll() might be badly emulated, as in Mac OS X 10.3 (and other BSDs?) and
  1382. dnl to find out we make an extra check here!
  1383. if test "$ac_cv_func_poll" = "yes"; then
  1384. AC_MSG_CHECKING([if poll works with NULL inputs])
  1385. AC_RUN_IFELSE([
  1386. #ifdef HAVE_SYS_POLL_H
  1387. #include <sys/poll.h>
  1388. #endif
  1389. int main(void)
  1390. {
  1391. /* make this return 0 == timeout since there's nothing to read from */
  1392. return poll((void *)0, 0, 10 /*ms*/);
  1393. }
  1394. ],
  1395. AC_MSG_RESULT(yes)
  1396. AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll]),
  1397. AC_MSG_RESULT(no),
  1398. AC_MSG_RESULT(cross-compiling assumes yes)
  1399. AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll])
  1400. ) dnl end of AC_RUN_IFELSE
  1401. fi dnl poll() was found
  1402. fi dnl poll()-check is not disabled
  1403. AC_PATH_PROG( PERL, perl, ,
  1404. $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
  1405. AC_SUBST(PERL)
  1406. AC_PATH_PROGS( NROFF, gnroff nroff, ,
  1407. $PATH:/usr/bin/:/usr/local/bin )
  1408. AC_SUBST(NROFF)
  1409. if test -n "$NROFF"; then
  1410. dnl only check for nroff options if an nroff command was found
  1411. AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
  1412. MANOPT="-man"
  1413. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  1414. if test -z "$mancheck"; then
  1415. MANOPT="-mandoc"
  1416. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  1417. if test -z "$mancheck"; then
  1418. MANOPT=""
  1419. AC_MSG_RESULT([failed])
  1420. AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
  1421. else
  1422. AC_MSG_RESULT([$MANOPT])
  1423. fi
  1424. else
  1425. AC_MSG_RESULT([$MANOPT])
  1426. fi
  1427. AC_SUBST(MANOPT)
  1428. fi
  1429. if test -z "$MANOPT"
  1430. then
  1431. dnl if no nroff tool was found, or no option that could convert man pages
  1432. dnl was found, then disable the built-in manual stuff
  1433. AC_MSG_WARN([disabling built-in manual])
  1434. USE_MANUAL="no";
  1435. fi
  1436. dnl *************************************************************************
  1437. dnl If the manual variable still is set, then we go with providing a built-in
  1438. dnl manual
  1439. if test "$USE_MANUAL" = "1"; then
  1440. AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
  1441. curl_manual_msg="enabled"
  1442. fi
  1443. dnl set variable for use in automakefile(s)
  1444. AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
  1445. AC_MSG_CHECKING([whether to enable ares])
  1446. AC_ARG_ENABLE(ares,
  1447. AC_HELP_STRING([--enable-ares=PATH],[Enable ares for name lookups])
  1448. AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
  1449. [ case "$enableval" in
  1450. no)
  1451. AC_MSG_RESULT(no)
  1452. ;;
  1453. *) AC_MSG_RESULT(yes)
  1454. if test "x$IPV6_ENABLED" = "x1"; then
  1455. AC_MSG_ERROR([ares doesn't work with ipv6, disable ipv6 to use ares])
  1456. fi
  1457. AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
  1458. dnl substitute HAVE_ARES for curl-config and similar
  1459. HAVE_ARES="1"
  1460. AC_SUBST(HAVE_ARES)
  1461. curl_ares_msg="enabled"
  1462. LIBS="-lcares $LIBS"
  1463. dnl For backwards compatibility default to includes/lib in srcdir/ares
  1464. dnl If a value is specified it is assumed that the libs are in $val/lib
  1465. dnl and the includes are in $val/include. This is the default setup for
  1466. dnl ares so it should not be a problem.
  1467. if test "x$enableval" = "xyes" ; then
  1468. if test -d "$srcdir/ares"; then
  1469. aresembedded="yes"
  1470. AC_CONFIG_SUBDIRS(ares)
  1471. aresinc=`cd $srcdir/ares && pwd`
  1472. CPPFLAGS="$CPPFLAGS -I$aresinc"
  1473. dnl the pwd= below cannot 'cd' into the ares dir to get the full
  1474. dnl path to it, since it may not exist yet if we build outside of
  1475. dnl the source tree
  1476. pwd=`pwd`
  1477. LDFLAGS="$LDFLAGS -L$pwd/ares"
  1478. fi
  1479. else
  1480. CPPFLAGS="$CPPFLAGS -I$enableval/include"
  1481. LDFLAGS="$LDFLAGS -L$enableval/lib"
  1482. fi
  1483. if test -z "$aresembedded"; then
  1484. dnl verify that a sufficient c-ares is here if we have pointed one
  1485. dnl out and don't use the "embedded" ares dir (in which case we don't
  1486. dnl check it because it might not have been built yet)
  1487. AC_MSG_CHECKING([that c-ares is good and recent enough])
  1488. AC_LINK_IFELSE( [
  1489. #include <ares.h>
  1490. /* provide a set of dummy functions in case c-ares was built with debug */
  1491. void curl_dofree() { }
  1492. void curl_sclose() { }
  1493. void curl_domalloc() { }
  1494. int main(void)
  1495. {
  1496. ares_channel channel;
  1497. ares_cancel(channel);
  1498. return 0;
  1499. }
  1500. ],
  1501. AC_MSG_RESULT(yes),
  1502. AC_MSG_RESULT(no)
  1503. AC_MSG_ERROR([c-ares library defective or too old])
  1504. )
  1505. fi
  1506. ;;
  1507. esac ],
  1508. AC_MSG_RESULT(no)
  1509. )
  1510. dnl ************************************************************
  1511. dnl disable verbose text strings
  1512. dnl
  1513. AC_MSG_CHECKING([whether to enable verbose strings])
  1514. AC_ARG_ENABLE(verbose,
  1515. AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
  1516. AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
  1517. [ case "$enableval" in
  1518. no)
  1519. AC_MSG_RESULT(no)
  1520. AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
  1521. AC_SUBST(CURL_DISABLE_VERBOSE_STRINGS)
  1522. curl_verbose_msg="no"
  1523. ;;
  1524. *) AC_MSG_RESULT(yes)
  1525. ;;
  1526. esac ],
  1527. AC_MSG_RESULT(yes)
  1528. )
  1529. dnl ************************************************************
  1530. dnl enable SSPI support
  1531. dnl
  1532. AC_MSG_CHECKING([whether to enable SSPI support (win32 builds only)])
  1533. AC_ARG_ENABLE(sspi,
  1534. AC_HELP_STRING([--enable-sspi],[Enable SSPI])
  1535. AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
  1536. [ case "$enableval" in
  1537. yes)
  1538. AC_MSG_RESULT(yes)
  1539. AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
  1540. AC_SUBST(USE_WINDOWS_SSPI)
  1541. LIBS="$LIBS -lsecur32"
  1542. curl_sspi_msg="yes"
  1543. ;;
  1544. *)
  1545. AC_MSG_RESULT(no)
  1546. ;;
  1547. esac ],
  1548. AC_MSG_RESULT(no)
  1549. )
  1550. dnl ************************************************************
  1551. dnl lame option to switch on debug options
  1552. dnl
  1553. AC_MSG_CHECKING([whether to enable debug options])
  1554. AC_ARG_ENABLE(debug,
  1555. AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
  1556. AC_HELP_STRING([--disable-debug],[Disable debug options]),
  1557. [ case "$enableval" in
  1558. no)
  1559. AC_MSG_RESULT(no)
  1560. ;;
  1561. *) AC_MSG_RESULT(yes)
  1562. CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
  1563. CFLAGS="$CFLAGS -g"
  1564. dnl set compiler "debug" options to become more picky, and remove
  1565. dnl optimize options from CFLAGS
  1566. CURL_CC_DEBUG_OPTS
  1567. ;;
  1568. esac
  1569. ],
  1570. AC_MSG_RESULT(no)
  1571. )
  1572. dnl ************************************************************
  1573. dnl disable cryptographic authentication
  1574. dnl
  1575. AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
  1576. AC_ARG_ENABLE(crypto-auth,
  1577. AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
  1578. AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
  1579. [ case "$enableval" in
  1580. no)
  1581. AC_MSG_RESULT(no)
  1582. AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
  1583. AC_SUBST(CURL_DISABLE_CRYPTO_AUTH)
  1584. ;;
  1585. *) AC_MSG_RESULT(yes)
  1586. ;;
  1587. esac ],
  1588. AC_MSG_RESULT(yes)
  1589. )
  1590. dnl ************************************************************
  1591. dnl disable cookies support
  1592. dnl
  1593. AC_MSG_CHECKING([whether to enable support for cookies])
  1594. AC_ARG_ENABLE(cookies,
  1595. AC_HELP_STRING([--enable-cookies],[Enable cookies support])
  1596. AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
  1597. [ case "$enableval" in
  1598. no)
  1599. AC_MSG_RESULT(no)
  1600. AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
  1601. AC_SUBST(CURL_DISABLE_COOKIES)
  1602. ;;
  1603. *) AC_MSG_RESULT(yes)
  1604. ;;
  1605. esac ],
  1606. AC_MSG_RESULT(yes)
  1607. )
  1608. if test "x$ws2" = "xyes"; then
  1609. dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
  1610. dnl things work when built with c-ares). But we can't just move it last
  1611. dnl since then other stuff (SSL) won't build. So we simply append it to the
  1612. dnl end.
  1613. LIBS="$LIBS -lws2_32"
  1614. fi
  1615. AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
  1616. AC_CONFIG_FILES([Makefile \
  1617. docs/Makefile \
  1618. docs/examples/Makefile \
  1619. docs/libcurl/Makefile \
  1620. include/Makefile \
  1621. include/curl/Makefile \
  1622. src/Makefile \
  1623. lib/Makefile \
  1624. tests/Makefile \
  1625. tests/data/Makefile \
  1626. tests/server/Makefile \
  1627. tests/libtest/Makefile \
  1628. packages/Makefile \
  1629. packages/Win32/Makefile \
  1630. packages/Win32/cygwin/Makefile \
  1631. packages/Linux/Makefile \
  1632. packages/Linux/RPM/Makefile \
  1633. packages/Linux/RPM/curl.spec \
  1634. packages/Linux/RPM/curl-ssl.spec \
  1635. packages/Solaris/Makefile \
  1636. packages/DOS/Makefile \
  1637. packages/EPM/curl.list \
  1638. packages/EPM/Makefile \
  1639. packages/vms/Makefile \
  1640. curl-config \
  1641. libcurl.pc
  1642. ])
  1643. AC_OUTPUT
  1644. AC_MSG_NOTICE([Configured to build curl/libcurl:
  1645. curl version: ${VERSION}
  1646. Host setup: ${host}
  1647. Install prefix: ${prefix}
  1648. Compiler: ${CC}
  1649. SSL support: ${curl_ssl_msg}
  1650. zlib support: ${curl_zlib_msg}
  1651. krb4 support: ${curl_krb4_msg}
  1652. GSSAPI support: ${curl_gss_msg}
  1653. SPNEGO support: ${curl_spnego_msg}
  1654. c-ares support: ${curl_ares_msg}
  1655. ipv6 support: ${curl_ipv6_msg}
  1656. IDN support: ${curl_idn_msg}
  1657. Build libcurl: Shared=${enable_shared}, Static=${enable_static}
  1658. Built-in manual: ${curl_manual_msg}
  1659. Verbose errors: ${curl_verbose_msg}
  1660. SSPI support: ${curl_sspi_msg}
  1661. ca cert path: ${ca}
  1662. ])