configure.ac 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275
  1. dnl $Id: configure.ac,v 1.62 2004/03/18 10:03:34 bagder Exp $
  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, [-], [curl-bug@haxx.se])
  6. dnl configure script copyright
  7. AC_COPYRIGHT([Copyright (c) 1998 - 2004 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, , $PATH:/usr/bin:/usr/local/bin)
  15. AC_SUBST(SED)
  16. dnl AR is used by libtool, and try the odd Solaris path too
  17. AC_PATH_PROG( AR, ar, , $PATH:/usr/bin:/usr/local/bin:/usr/ccs/bin)
  18. AC_SUBST(AR)
  19. dnl figure out the libcurl version
  20. VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curl.h`
  21. AM_INIT_AUTOMAKE(curl,$VERSION)
  22. AC_MSG_CHECKING([curl version])
  23. AC_MSG_RESULT($VERSION)
  24. dnl
  25. dnl we extract the numerical version for curl-config only
  26. VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curl.h`
  27. AC_SUBST(VERSIONNUM)
  28. dnl Solaris pkgadd support definitions
  29. PKGADD_PKG="HAXXcurl"
  30. PKGADD_NAME="cURL - a client that groks URLs"
  31. PKGADD_VENDOR="curl.haxx.se"
  32. AC_SUBST(PKGADD_PKG)
  33. AC_SUBST(PKGADD_NAME)
  34. AC_SUBST(PKGADD_VENDOR)
  35. dnl
  36. dnl Detect the canonical host and target build environment
  37. dnl
  38. AC_CANONICAL_HOST
  39. dnl Get system canonical name
  40. AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
  41. dnl Check for AIX weirdos
  42. AC_AIX
  43. dnl Checks for programs.
  44. AC_PROG_CC
  45. dnl check for how to do large files
  46. AC_SYS_LARGEFILE
  47. dnl check for cygwin stuff
  48. AC_LIBTOOL_WIN32_DLL
  49. dnl libtool setup
  50. AM_PROG_LIBTOOL
  51. AC_MSG_CHECKING([if we need -no-undefined])
  52. case $host in
  53. *-*-cygwin | *-*-mingw* | *-*-pw32*)
  54. need_no_undefined=yes
  55. ;;
  56. *)
  57. need_no_undefined=no
  58. ;;
  59. esac
  60. AC_MSG_RESULT($need_no_undefined)
  61. AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
  62. AC_MSG_CHECKING([if we need -mimpure-text])
  63. case $host in
  64. *-*-solaris2*)
  65. if test "$GCC" = "yes"; then
  66. mimpure="yes"
  67. fi
  68. ;;
  69. *)
  70. mimpure=no
  71. ;;
  72. esac
  73. AC_MSG_RESULT($mimpure)
  74. AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
  75. dnl The install stuff has already been taken care of by the automake stuff
  76. dnl AC_PROG_INSTALL
  77. AC_PROG_MAKE_SET
  78. dnl ************************************************************
  79. dnl switch off particular protocols
  80. dnl
  81. AC_MSG_CHECKING([whether to support http])
  82. AC_ARG_ENABLE(http,
  83. AC_HELP_STRING([--enable-http],[Enable HTTP support])
  84. AC_HELP_STRING([--disable-http],[Disable HTTP support]),
  85. [ case "$enableval" in
  86. no)
  87. AC_MSG_RESULT(no)
  88. AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
  89. AC_MSG_WARN([disable HTTP disables FTP over proxy and GOPHER too])
  90. AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
  91. AC_SUBST(CURL_DISABLE_HTTP)
  92. AC_SUBST(CURL_DISABLE_GOPHER)
  93. ;;
  94. *) AC_MSG_RESULT(yes)
  95. ;;
  96. esac ],
  97. AC_MSG_RESULT(yes)
  98. )
  99. AC_MSG_CHECKING([whether to support ftp])
  100. AC_ARG_ENABLE(ftp,
  101. AC_HELP_STRING([--enable-ftp],[Enable FTP support])
  102. AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
  103. [ case "$enableval" in
  104. no)
  105. AC_MSG_RESULT(no)
  106. AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
  107. AC_SUBST(CURL_DISABLE_FTP)
  108. ;;
  109. *) AC_MSG_RESULT(yes)
  110. ;;
  111. esac ],
  112. AC_MSG_RESULT(yes)
  113. )
  114. AC_MSG_CHECKING([whether to support gopher])
  115. AC_ARG_ENABLE(gopher,
  116. AC_HELP_STRING([--enable-gopher],[Enable GOPHER support])
  117. AC_HELP_STRING([--disable-gopher],[Disable GOPHER support]),
  118. [ case "$enableval" in
  119. no)
  120. AC_MSG_RESULT(no)
  121. AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
  122. AC_SUBST(CURL_DISABLE_GOPHER)
  123. ;;
  124. *) AC_MSG_RESULT(yes)
  125. ;;
  126. esac ],
  127. AC_MSG_RESULT(yes)
  128. )
  129. AC_MSG_CHECKING([whether to support file])
  130. AC_ARG_ENABLE(file,
  131. AC_HELP_STRING([--enable-file],[Enable FILE support])
  132. AC_HELP_STRING([--disable-file],[Disable FILE support]),
  133. [ case "$enableval" in
  134. no)
  135. AC_MSG_RESULT(no)
  136. AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
  137. AC_SUBST(CURL_DISABLE_FILE)
  138. ;;
  139. *) AC_MSG_RESULT(yes)
  140. ;;
  141. esac ],
  142. AC_MSG_RESULT(yes)
  143. )
  144. AC_MSG_CHECKING([whether to support ldap])
  145. AC_ARG_ENABLE(ldap,
  146. AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
  147. AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
  148. [ case "$enableval" in
  149. no)
  150. AC_MSG_RESULT(no)
  151. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  152. AC_SUBST(CURL_DISABLE_LDAP)
  153. ;;
  154. *) AC_MSG_RESULT(yes)
  155. ;;
  156. esac ],
  157. AC_MSG_RESULT(yes)
  158. )
  159. AC_MSG_CHECKING([whether to support dict])
  160. AC_ARG_ENABLE(dict,
  161. AC_HELP_STRING([--enable-dict],[Enable DICT support])
  162. AC_HELP_STRING([--disable-dict],[Disable DICT support]),
  163. [ case "$enableval" in
  164. no)
  165. AC_MSG_RESULT(no)
  166. AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
  167. AC_SUBST(CURL_DISABLE_DICT)
  168. ;;
  169. *) AC_MSG_RESULT(yes)
  170. ;;
  171. esac ],
  172. AC_MSG_RESULT(yes)
  173. )
  174. AC_MSG_CHECKING([whether to support telnet])
  175. AC_ARG_ENABLE(telnet,
  176. AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
  177. AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
  178. [ case "$enableval" in
  179. no)
  180. AC_MSG_RESULT(no)
  181. AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
  182. AC_SUBST(CURL_DISABLE_TELNET)
  183. ;;
  184. *) AC_MSG_RESULT(yes)
  185. ;;
  186. esac ],
  187. AC_MSG_RESULT(yes)
  188. )
  189. dnl **********************************************************************
  190. dnl Check for built-in manual
  191. dnl **********************************************************************
  192. AC_MSG_CHECKING([whether to provide built-in manual])
  193. AC_ARG_ENABLE(manual,
  194. AC_HELP_STRING([--enable-manual],[Enable built-in manual])
  195. AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
  196. [ case "$enableval" in
  197. no)
  198. AC_MSG_RESULT(no)
  199. ;;
  200. *) AC_MSG_RESULT(yes)
  201. USE_MANUAL="1"
  202. ;;
  203. esac ],
  204. AC_MSG_RESULT(yes)
  205. USE_MANUAL="1"
  206. )
  207. dnl The actual use of the USE_MANUAL variable is done much later in this
  208. dnl script to allow other actions to disable it as well.
  209. dnl **********************************************************************
  210. dnl Checks for libraries.
  211. dnl **********************************************************************
  212. dnl gethostbyname without lib or in the nsl lib?
  213. AC_CHECK_FUNC(gethostbyname,
  214. [HAVE_GETHOSTBYNAME="1"
  215. ],
  216. [ AC_CHECK_LIB(nsl, gethostbyname,
  217. [HAVE_GETHOSTBYNAME="1"
  218. LIBS="$LIBS -lnsl"
  219. ])
  220. ])
  221. if test "$HAVE_GETHOSTBYNAME" != "1"
  222. then
  223. dnl gethostbyname in the socket lib?
  224. AC_CHECK_LIB(socket, gethostbyname,
  225. [HAVE_GETHOSTBYNAME="1"
  226. LIBS="$LIBS -lsocket"
  227. ])
  228. fi
  229. dnl At least one system has been identified to require BOTH nsl and socket
  230. dnl libs at the same time to link properly.
  231. if test "$HAVE_GETHOSTBYNAME" != "1"
  232. then
  233. AC_MSG_CHECKING([trying gethostbyname with both nsl and socket libs])
  234. my_ac_save_LIBS=$LIBS
  235. LIBS="-lnsl -lsocket $LIBS"
  236. AC_TRY_LINK( ,
  237. [gethostbyname();],
  238. [ dnl found it!
  239. HAVE_GETHOSTBYNAME="1",
  240. AC_MSG_RESULT([yes])],
  241. [ dnl failed!
  242. AC_MSG_RESULT([no])
  243. dnl restore LIBS
  244. LIBS=$my_ac_save_LIBS]
  245. )
  246. fi
  247. if test "$HAVE_GETHOSTBYNAME" != "1"
  248. then
  249. dnl This is for Msys/Mingw
  250. AC_MSG_CHECKING([for gethostbyname in ws2_32])
  251. my_ac_save_LIBS=$LIBS
  252. LIBS="-lws2_32 $LIBS"
  253. AC_TRY_LINK([#include <winsock2.h>],
  254. [gethostbyname("www.dummysite.com");],
  255. [ dnl worked!
  256. AC_MSG_RESULT([yes])
  257. HAVE_GETHOSTBYNAME="1"],
  258. [ dnl failed, restore LIBS
  259. LIBS=$my_ac_save_LIBS
  260. AC_MSG_RESULT(no)]
  261. )
  262. fi
  263. if test "$HAVE_GETHOSTBYNAME" = "1"; then
  264. AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
  265. else
  266. AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
  267. fi
  268. dnl resolve lib?
  269. AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
  270. if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
  271. AC_CHECK_LIB(resolve, strcasecmp,
  272. [LIBS="-lresolve $LIBS"],
  273. ,
  274. -lnsl)
  275. fi
  276. dnl socket lib?
  277. AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
  278. dnl dl lib?
  279. AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ])
  280. AC_MSG_CHECKING([whether to use libgcc])
  281. AC_ARG_ENABLE(libgcc,
  282. AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
  283. [ case "$enableval" in
  284. yes)
  285. LIBS="$LIBS -lgcc"
  286. AC_MSG_RESULT(yes)
  287. ;;
  288. *) AC_MSG_RESULT(no)
  289. ;;
  290. esac ],
  291. AC_MSG_RESULT(no)
  292. )
  293. dnl **********************************************************************
  294. dnl Check for the presence of the winmm library.
  295. dnl **********************************************************************
  296. AC_MSG_CHECKING([for timeGetTime in winmm])
  297. my_ac_save_LIBS=$LIBS
  298. LIBS="-lwinmm $LIBS"
  299. AC_TRY_LINK([#include <windef.h>
  300. #include <mmsystem.h>
  301. ],
  302. [timeGetTime();],
  303. [ dnl worked!
  304. AC_MSG_RESULT([yes])
  305. ],
  306. [ dnl failed, restore LIBS
  307. LIBS=$my_ac_save_LIBS
  308. AC_MSG_RESULT(no)]
  309. )
  310. dnl **********************************************************************
  311. dnl Checks for IPv6
  312. dnl **********************************************************************
  313. AC_MSG_CHECKING([whether to enable ipv6])
  314. AC_ARG_ENABLE(ipv6,
  315. AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
  316. AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
  317. [ case "$enableval" in
  318. no)
  319. AC_MSG_RESULT(no)
  320. ipv6=no
  321. ;;
  322. *) AC_MSG_RESULT(yes)
  323. ipv6=yes
  324. ;;
  325. esac ],
  326. AC_TRY_RUN([ /* is AF_INET6 available? */
  327. #include <sys/types.h>
  328. #include <sys/socket.h>
  329. main()
  330. {
  331. if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
  332. exit(1);
  333. else
  334. exit(0);
  335. }
  336. ],
  337. AC_MSG_RESULT(yes)
  338. ipv6=yes,
  339. AC_MSG_RESULT(no)
  340. ipv6=no,
  341. AC_MSG_RESULT(no)
  342. ipv6=no
  343. ))
  344. if test "$ipv6" = "yes"; then
  345. CURL_CHECK_WORKING_GETADDRINFO
  346. fi
  347. dnl **********************************************************************
  348. dnl Check how non-blocking sockets are set
  349. dnl **********************************************************************
  350. AC_ARG_ENABLE(nonblocking,
  351. AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it])
  352. AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]),
  353. [
  354. if test "$enableval" = "no" ; then
  355. AC_MSG_WARN([non-blocking sockets disabled])
  356. AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
  357. [to disable NON-BLOCKING connections])
  358. else
  359. CURL_CHECK_NONBLOCKING_SOCKET
  360. fi
  361. ],
  362. [
  363. CURL_CHECK_NONBLOCKING_SOCKET
  364. ])
  365. dnl **********************************************************************
  366. dnl Check for the random seed preferences
  367. dnl **********************************************************************
  368. AC_ARG_WITH(egd-socket,
  369. AC_HELP_STRING([--with-egd-socket=FILE],
  370. [Entropy Gathering Daemon socket pathname]),
  371. [ EGD_SOCKET="$withval" ]
  372. )
  373. if test -n "$EGD_SOCKET" ; then
  374. AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
  375. [your Entropy Gathering Daemon socket pathname] )
  376. fi
  377. dnl Check for user-specified random device
  378. AC_ARG_WITH(random,
  379. AC_HELP_STRING([--with-random=FILE],[read randomness from FILE (default=/dev/urandom)]),
  380. [ RANDOM_FILE="$withval" ],
  381. [
  382. dnl Check for random device
  383. AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
  384. ]
  385. )
  386. if test -n "$RANDOM_FILE" ; then
  387. AC_SUBST(RANDOM_FILE)
  388. AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
  389. [a suitable file to read random data from])
  390. fi
  391. dnl **********************************************************************
  392. dnl Check if the operating system allows programs to write to their own argv[]
  393. dnl **********************************************************************
  394. AC_MSG_CHECKING([if argv can be written to])
  395. AC_CACHE_VAL(curl_cv_writable_argv, [
  396. AC_RUN_IFELSE([[
  397. int main(int argc, char ** argv) {
  398. argv[0][0] = ' ';
  399. return (argv[0][0] == ' ')?0:1;
  400. }
  401. ]],
  402. curl_cv_writable_argv=yes,
  403. curl_cv_writable_argv=no,
  404. curl_cv_writable_argv=cross)
  405. ])
  406. case $curl_cv_writable_argv in
  407. yes)
  408. AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
  409. AC_MSG_RESULT(yes)
  410. ;;
  411. no)
  412. AC_MSG_RESULT(no)
  413. ;;
  414. *)
  415. AC_MSG_RESULT(no)
  416. AC_MSG_WARN([the previous check could not be made default was used])
  417. ;;
  418. esac
  419. dnl **********************************************************************
  420. dnl Check for the presence of Kerberos4 libraries and headers
  421. dnl **********************************************************************
  422. AC_ARG_WITH(krb4-includes,
  423. AC_HELP_STRING([--with-krb4-includes=DIR],
  424. [Specify location of kerberos4 headers]),[
  425. CPPFLAGS="$CPPFLAGS -I$withval"
  426. KRB4INC="$withval"
  427. want_krb4=yes
  428. ])
  429. AC_ARG_WITH(krb4-libs,
  430. AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
  431. LDFLAGS="$LDFLAGS -L$withval"
  432. KRB4LIB="$withval"
  433. want_krb4=yes
  434. ])
  435. OPT_KRB4=off
  436. AC_ARG_WITH(krb4,dnl
  437. AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
  438. OPT_KRB4="$withval"
  439. if test X"$OPT_KRB4" != Xyes
  440. then
  441. LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
  442. KRB4LIB="$OPT_KRB4/lib$libsuff"
  443. CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
  444. KRB4INC="$OPT_KRB4/include"
  445. fi
  446. want_krb4="yes"
  447. ])
  448. AC_MSG_CHECKING([if Kerberos4 support is requested])
  449. if test "$want_krb4" = yes
  450. then
  451. if test "$ipv6" = "yes"; then
  452. echo krb4 is not compatible with IPv6
  453. exit 1
  454. fi
  455. AC_MSG_RESULT(yes)
  456. dnl Check for & handle argument to --with-krb4
  457. AC_MSG_CHECKING(where to look for Kerberos4)
  458. if test X"$OPT_KRB4" = Xyes
  459. then
  460. AC_MSG_RESULT([defaults])
  461. else
  462. AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
  463. fi
  464. dnl Check for DES library
  465. AC_CHECK_LIB(des, des_pcbc_encrypt,
  466. [
  467. AC_CHECK_HEADERS(des.h)
  468. dnl resolv lib?
  469. AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
  470. dnl Check for the Kerberos4 library
  471. AC_CHECK_LIB(krb, krb_net_read,
  472. [
  473. dnl Check for header files
  474. AC_CHECK_HEADERS(krb.h)
  475. dnl we found the required libraries, add to LIBS
  476. LIBS="-lkrb -ldes $LIBS"
  477. dnl Check for function krb_get_our_ip_for_realm
  478. dnl this is needed for NAT networks
  479. AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
  480. dnl add define KRB4
  481. AC_DEFINE(HAVE_KRB4, 1,
  482. [if you have the Kerberos4 libraries (including -ldes)])
  483. dnl substitute it too!
  484. KRB4_ENABLED=1
  485. AC_SUBST(KRB4_ENABLED)
  486. dnl the krb4 stuff needs a strlcpy()
  487. AC_CHECK_FUNCS(strlcpy)
  488. ])
  489. ])
  490. else
  491. AC_MSG_RESULT(no)
  492. fi
  493. dnl **********************************************************************
  494. dnl Check for FBopenssl(SPNEGO) libraries
  495. dnl **********************************************************************
  496. AC_ARG_WITH(spnego,
  497. AC_HELP_STRING([--with-spnego=DIR],
  498. [Specify location of SPNEGO library fbopenssl]),
  499. [ SPNEGO_ROOT="$withval"
  500. want_spnego="yes" ]
  501. )
  502. AC_MSG_CHECKING([if SPNEGO support is requested])
  503. if test x"$want_spnego" = xyes; then
  504. if test X"$SPNEGO_ROOT" = Xyes; then
  505. AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
  506. AC_MSG_RESULT(no)
  507. else
  508. if test -z "$SPNEGO_LIB_DIR"; then
  509. LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
  510. else
  511. LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
  512. fi
  513. AC_MSG_RESULT(yes)
  514. AC_DEFINE(HAVE_SPNEGO, 1, [Define this if you have the SPNEGO library fbopenssl])
  515. fi
  516. else
  517. AC_MSG_RESULT(no)
  518. fi
  519. dnl **********************************************************************
  520. dnl Check for GSS-API libraries
  521. dnl **********************************************************************
  522. AC_ARG_WITH(gssapi-includes,
  523. AC_HELP_STRING([--with-gssapi-includes=DIR],
  524. [Specify location of GSSAPI header]),
  525. [ GSSAPI_INCS="-I$withval"
  526. want_gss="yes" ]
  527. )
  528. AC_ARG_WITH(gssapi-libs,
  529. AC_HELP_STRING([--with-gssapi-libs=DIR],
  530. [Specify location of GSSAPI libs]),
  531. [ GSSAPI_LIBS="-L$withval -lgssapi"
  532. want_gss="yes" ]
  533. )
  534. AC_ARG_WITH(gssapi,
  535. AC_HELP_STRING([--with-gssapi=DIR],
  536. [Where to look for GSSAPI]),
  537. [ GSSAPI_ROOT="$withval"
  538. want_gss="yes" ]
  539. )
  540. AC_MSG_CHECKING([if GSSAPI support is requested])
  541. if test x"$want_gss" = xyes; then
  542. if test -z "$GSSAPI_INCS"; then
  543. if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
  544. GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
  545. else
  546. GSSAPI_INCS="-I$GSSAPI_ROOT/include"
  547. fi
  548. fi
  549. CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
  550. if test -z "$GSSAPI_LIB_DIR"; then
  551. if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
  552. gss_ldflags=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
  553. LDFLAGS="$LDFLAGS $gss_ldflags"
  554. else
  555. LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff -lgssapi"
  556. fi
  557. else
  558. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  559. fi
  560. AC_MSG_RESULT(yes)
  561. AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
  562. if test -n "$GSSAPI_INCS"; then
  563. # cut off the preceding -I from the include path
  564. GSSAPI_INCS=`echo $GSSAPI_INCS | sed -e s/^-I//g`
  565. fi
  566. if test -f "$GSSAPI_INCS/gssapi.h"; then
  567. AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
  568. else
  569. AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
  570. fi
  571. else
  572. AC_MSG_RESULT(no)
  573. fi
  574. dnl Detect the pkg-config tool, as it may have extra info about the
  575. dnl openssl installation we can use. I *believe* this is what we are
  576. dnl expected to do on really recent Redhat Linux hosts.
  577. AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
  578. if test "$PKGCONFIG" != "no" ; then
  579. AC_MSG_CHECKING([for OpenSSL options using pkg-config])
  580. $PKGCONFIG --exists openssl
  581. SSL_EXISTS=$?
  582. if test "$SSL_EXISTS" -eq "0"; then
  583. SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
  584. SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
  585. SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
  586. LIBS="$LIBS $SSL_LIBS"
  587. CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
  588. LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
  589. AC_MSG_RESULT([yes])
  590. else
  591. AC_MSG_RESULT([no])
  592. fi
  593. fi
  594. dnl **********************************************************************
  595. dnl Check for the presence of SSL libraries and headers
  596. dnl **********************************************************************
  597. dnl Default to compiler & linker defaults for SSL files & libraries.
  598. OPT_SSL=off
  599. dnl Default to no CA bundle
  600. ca="no"
  601. AC_ARG_WITH(ssl,dnl
  602. AC_HELP_STRING([--with-ssl=PATH],[where to look for SSL, PATH points to the SSL installation (default: /usr/local/ssl)])
  603. AC_HELP_STRING([--without-ssl], [disable SSL]),
  604. OPT_SSL=$withval)
  605. if test X"$OPT_SSL" = Xno
  606. then
  607. AC_MSG_WARN(SSL/https support disabled)
  608. else
  609. dnl Check for and handle argument to --with-ssl.
  610. dnl save the pre-ssl check flags for a while
  611. CLEANLDFLAGS="$LDFLAGS"
  612. CLEANCPPFLAGS="$CPPFLAGS"
  613. case "$OPT_SSL" in
  614. yes)
  615. EXTRA_SSL=/usr/local/ssl ;;
  616. off)
  617. EXTRA_SSL= ;;
  618. *)
  619. dnl check the given spot right away!
  620. EXTRA_SSL=$OPT_SSL
  621. LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib$libsuff"
  622. CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
  623. ;;
  624. esac
  625. AC_CHECK_LIB(crypto, CRYPTO_lock,[
  626. HAVECRYPTO="yes"
  627. ],[
  628. OLDLDFLAGS="$LDFLAGS"
  629. OLDCPPFLAGS="$CPPFLAGS"
  630. LDFLAGS="$CLEANLDFLAGS -L$EXTRA_SSL/lib$libsuff"
  631. CPPFLAGS="$CLEANCPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
  632. AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
  633. HAVECRYPTO="yes" ], [
  634. LDFLAGS="$OLDLDFLAGS"
  635. CPPFLAGS="$OLDCPPFLAGS"
  636. ])
  637. ])
  638. if test "$HAVECRYPTO" = "yes"; then
  639. dnl This is only reasonable to do if crypto actually is there: check for
  640. dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
  641. dnl This is for Msys/Mingw
  642. AC_MSG_CHECKING([for gdi32])
  643. my_ac_save_LIBS=$LIBS
  644. LIBS="-lgdi32 $LIBS"
  645. AC_TRY_LINK([#include <windef.h>
  646. #include <wingdi.h>],
  647. [GdiFlush();],
  648. [ dnl worked!
  649. AC_MSG_RESULT([yes])],
  650. [ dnl failed, restore LIBS
  651. LIBS=$my_ac_save_LIBS
  652. AC_MSG_RESULT(no)]
  653. )
  654. AC_CHECK_LIB(crypto, CRYPTO_add_lock)
  655. AC_CHECK_LIB(ssl, SSL_connect)
  656. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  657. dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
  658. AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
  659. OLIBS=$LIBS
  660. LIBS="$LIBS -lRSAglue -lrsaref"
  661. AC_CHECK_LIB(ssl, SSL_connect)
  662. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  663. dnl still no SSL_connect
  664. AC_MSG_RESULT(no)
  665. LIBS=$OLIBS
  666. else
  667. AC_MSG_RESULT(yes)
  668. fi
  669. fi
  670. dnl Check for SSLeay headers
  671. AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
  672. openssl/pem.h openssl/ssl.h openssl/err.h,
  673. OPENSSL_ENABLED=1)
  674. if test $ac_cv_header_openssl_x509_h = no; then
  675. AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h,
  676. OPENSSL_ENABLED=1)
  677. fi
  678. dnl If the ENGINE library seems to be around, check for the OpenSSL engine
  679. dnl header, it is kind of "separated" from the main SSL check
  680. AC_CHECK_FUNC(ENGINE_init, [ AC_CHECK_HEADERS(openssl/engine.h) ])
  681. AC_SUBST(OPENSSL_ENABLED)
  682. AC_MSG_CHECKING([CA cert bundle install path])
  683. AC_ARG_WITH(ca-bundle,
  684. AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
  685. AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
  686. [ ca="$withval" ],
  687. [
  688. if test "x$prefix" != xNONE; then
  689. ca="\${prefix}/share/curl/curl-ca-bundle.crt"
  690. else
  691. ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
  692. fi
  693. ] )
  694. if test X"$OPT_SSL" = Xno; then
  695. ca="no"
  696. fi
  697. if test "x$ca" != "xno"; then
  698. CURL_CA_BUNDLE='"'$ca'"'
  699. AC_SUBST(CURL_CA_BUNDLE)
  700. fi
  701. AC_MSG_RESULT([$ca])
  702. dnl these can only exist if openssl exists
  703. AC_CHECK_FUNCS( RAND_status \
  704. RAND_screen \
  705. RAND_egd \
  706. CRYPTO_cleanup_all_ex_data )
  707. fi
  708. if test X"$OPT_SSL" != Xoff &&
  709. test "$OPENSSL_ENABLED" != "1"; then
  710. AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
  711. fi
  712. fi
  713. AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
  714. dnl **********************************************************************
  715. dnl Check for the presence of ZLIB libraries and headers
  716. dnl **********************************************************************
  717. dnl Check for & handle argument to --with-zlib.
  718. _cppflags=$CPPFLAGS
  719. _ldflags=$LDFLAGS
  720. OPT_ZLIB="/usr/local"
  721. AC_ARG_WITH(zlib,
  722. AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
  723. AC_HELP_STRING([--without-zlib],[disable use of zlib]),
  724. [OPT_ZLIB="$withval"])
  725. case "$OPT_ZLIB" in
  726. no)
  727. AC_MSG_WARN([zlib disabled]) ;;
  728. *)
  729. dnl check for the lib first without setting any new path, since many
  730. dnl people have it in the default path
  731. AC_CHECK_LIB(z, inflateEnd,
  732. dnl libz found, set the variable
  733. [HAVE_LIBZ="1"],
  734. dnl if no lib found, try to add the given library
  735. [if test -d "$OPT_ZLIB"; then
  736. CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
  737. LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
  738. fi])
  739. AC_CHECK_HEADER(zlib.h,
  740. [
  741. dnl zlib.h was found
  742. HAVE_ZLIB_H="1"
  743. dnl if the lib wasn't found already, try again with the new paths
  744. if test "$HAVE_LIBZ" != "1"; then
  745. AC_CHECK_LIB(z, gzread,
  746. [
  747. dnl the lib was found!
  748. HAVE_LIBZ="1"
  749. ],
  750. [ CPPFLAGS=$_cppflags
  751. LDFLAGS=$_ldflags])
  752. fi
  753. ],
  754. [
  755. dnl zlib.h was not found, restore the flags
  756. CPPFLAGS=$_cppflags
  757. LDFLAGS=$_ldflags]
  758. )
  759. if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
  760. then
  761. AC_MSG_WARN([configure found only the libz lib, not the header file!])
  762. elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
  763. then
  764. AC_MSG_WARN([configure found only the libz header file, not the lib!])
  765. elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
  766. then
  767. dnl both header and lib were found!
  768. AC_SUBST(HAVE_LIBZ)
  769. AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
  770. AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
  771. LIBS="$LIBS -lz"
  772. dnl replace 'HAVE_LIBZ' in the automake makefile.ams
  773. AMFIXLIB="1"
  774. AC_MSG_NOTICE([found both libz and libz.h header])
  775. fi
  776. ;;
  777. esac
  778. dnl set variable for use in automakefile(s)
  779. AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
  780. dnl Default is to try the thread-safe versions of a few functions
  781. OPT_THREAD=on
  782. dnl detect AIX 4.3 or later
  783. dnl see full docs on this reasoning in the lib/hostip.c source file
  784. AC_MSG_CHECKING([AIX 4.3 or later])
  785. AC_PREPROC_IFELSE([
  786. #if defined(_AIX) && defined(_AIX43)
  787. printf("just fine");
  788. #else
  789. #error "this is not AIX 4.3 or later"
  790. #endif
  791. ],
  792. [ AC_MSG_RESULT([yes])
  793. OPT_THREAD=off ],
  794. [ AC_MSG_RESULT([no]) ]
  795. )
  796. AC_ARG_ENABLE(thread,dnl
  797. AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
  798. AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
  799. [ case "$enableval" in
  800. no)
  801. OPT_THREAD=off
  802. AC_MSG_WARN(libcurl will not get built using thread-safe functions)
  803. ;;
  804. *)
  805. ;;
  806. esac
  807. ]
  808. )
  809. if test X"$OPT_THREAD" = Xoff
  810. then
  811. AC_DEFINE(DISABLED_THREADSAFE, 1, \
  812. Set to explicitly specify we don't want to use thread-safe functions)
  813. else
  814. if test "$ipv6" != "yes"; then
  815. dnl dig around for gethostbyname_r()
  816. CURL_CHECK_GETHOSTBYNAME_R()
  817. dnl dig around for gethostbyaddr_r()
  818. CURL_CHECK_GETHOSTBYADDR_R()
  819. fi
  820. dnl poke around for inet_ntoa_r()
  821. CURL_CHECK_INET_NTOA_R()
  822. dnl is there a localtime_r()
  823. CURL_CHECK_LOCALTIME_R()
  824. AC_CHECK_FUNCS( gmtime_r )
  825. fi
  826. dnl **********************************************************************
  827. dnl Back to "normal" configuring
  828. dnl **********************************************************************
  829. dnl Checks for header files.
  830. AC_HEADER_STDC
  831. dnl First check for the very most basic headers. Then we can use these
  832. dnl ones as default-headers when checking for the rest!
  833. AC_CHECK_HEADERS(
  834. sys/types.h \
  835. sys/time.h \
  836. sys/select.h \
  837. sys/socket.h \
  838. sys/ioctl.h \
  839. assert.h \
  840. unistd.h \
  841. malloc.h \
  842. stdlib.h \
  843. limits.h \
  844. arpa/inet.h \
  845. net/if.h \
  846. netinet/in.h \
  847. netdb.h \
  848. sys/sockio.h \
  849. sys/stat.h \
  850. sys/param.h \
  851. termios.h \
  852. termio.h \
  853. sgtty.h \
  854. fcntl.h \
  855. dlfcn.h \
  856. alloca.h \
  857. winsock.h \
  858. time.h \
  859. io.h \
  860. pwd.h \
  861. utime.h \
  862. sys/utime.h \
  863. sys/poll.h \
  864. setjmp.h,
  865. dnl to do if not found
  866. [],
  867. dnl to do if found
  868. [],
  869. dnl default includes
  870. [
  871. #ifdef HAVE_SYS_TYPES_H
  872. #include <sys/types.h>
  873. #endif
  874. #ifdef HAVE_SYS_TIME_H
  875. #include <sys/time.h>
  876. #endif
  877. #ifdef HAVE_SYS_SELECT_H
  878. #include <sys/select.h>
  879. #endif
  880. #ifdef HAVE_SYS_SOCKET_H
  881. #include <sys/socket.h>
  882. #endif
  883. ]
  884. )
  885. dnl Checks for typedefs, structures, and compiler characteristics.
  886. AC_C_CONST
  887. AC_TYPE_SIZE_T
  888. AC_HEADER_TIME
  889. AC_CHECK_SIZEOF(curl_off_t, ,[
  890. #include <stdio.h>
  891. #include "$srcdir/include/curl/curl.h"
  892. ])
  893. AC_CHECK_TYPE(long long,
  894. [AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports 'long long'])])
  895. # check for ssize_t
  896. AC_CHECK_TYPE(ssize_t, ,
  897. AC_DEFINE(ssize_t, int, [the signed version of size_t]))
  898. TYPE_SOCKLEN_T
  899. TYPE_IN_ADDR_T
  900. AC_FUNC_SELECT_ARGTYPES
  901. dnl Checks for library functions.
  902. dnl AC_PROG_GCC_TRADITIONAL
  903. AC_TYPE_SIGNAL
  904. dnl AC_FUNC_VPRINTF
  905. AC_CHECK_FUNCS( strtoll \
  906. socket \
  907. select \
  908. strdup \
  909. strstr \
  910. strtok_r \
  911. strftime \
  912. uname \
  913. strcasecmp \
  914. stricmp \
  915. strcmpi \
  916. gethostbyaddr \
  917. gettimeofday \
  918. inet_addr \
  919. inet_ntoa \
  920. inet_pton \
  921. tcsetattr \
  922. tcgetattr \
  923. perror \
  924. closesocket \
  925. siginterrupt \
  926. sigaction \
  927. signal \
  928. getpass_r \
  929. strlcat \
  930. getpwuid \
  931. geteuid \
  932. dlopen \
  933. utime \
  934. sigsetjmp \
  935. poll,
  936. dnl if found
  937. [],
  938. dnl if not found, $ac_func is the name we check for
  939. func="$ac_func"
  940. AC_MSG_CHECKING([deeper for $func])
  941. AC_TRY_LINK( [],
  942. [ $func ();],
  943. AC_MSG_RESULT(yes!)
  944. eval "ac_cv_func_$func=yes"
  945. def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'`
  946. AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
  947. AC_MSG_RESULT(but still no)
  948. )
  949. )
  950. dnl sigsetjmp() might be a macro and no function so if it isn't found already
  951. dnl we make an extra check here!
  952. if test "$ac_cv_func_sigsetjmp" != "yes"; then
  953. AC_MSG_CHECKING([for sigsetjmp defined as macro])
  954. AC_TRY_LINK( [#include <setjmp.h>],
  955. [sigjmp_buf jmpenv;
  956. sigsetjmp(jmpenv, 1);],
  957. AC_MSG_RESULT(yes)
  958. AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]),
  959. AC_MSG_RESULT(no)
  960. )
  961. fi
  962. AC_PATH_PROG( PERL, perl, ,
  963. $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
  964. AC_SUBST(PERL)
  965. AC_PATH_PROGS( NROFF, gnroff nroff, ,
  966. $PATH:/usr/bin/:/usr/local/bin )
  967. AC_SUBST(NROFF)
  968. if test -n "$NROFF"; then
  969. dnl only check for nroff options if an nroff command was found
  970. AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
  971. MANOPT="-man"
  972. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  973. if test -z "$mancheck"; then
  974. MANOPT="-mandoc"
  975. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  976. if test -z "$mancheck"; then
  977. MANOPT=""
  978. AC_MSG_RESULT([failed])
  979. AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
  980. else
  981. AC_MSG_RESULT([$MANOPT])
  982. fi
  983. else
  984. AC_MSG_RESULT([$MANOPT])
  985. fi
  986. AC_SUBST(MANOPT)
  987. fi
  988. if test -z "$MANOPT"
  989. then
  990. dnl if no nroff tool was found, or no option that could convert man pages
  991. dnl was found, then disable the built-in manual stuff
  992. AC_MSG_WARN([disabling built-in manual])
  993. USE_MANUAL="no";
  994. fi
  995. AC_PROG_YACC
  996. if test -z "$YACC"
  997. then
  998. AC_MSG_CHECKING([if OK to build without bison/yacc])
  999. dnl no yacc is a big deal if we have no pre-fixed getdate.y
  1000. if test -r "$srcdir/lib/getdate.c"
  1001. then
  1002. dnl all is well, we don't have to generate it!
  1003. AC_MSG_RESULT(yes)
  1004. else
  1005. AC_MSG_RESULT(no)
  1006. AC_MSG_ERROR([no yacc or bison found, can't build libcurl!])
  1007. fi
  1008. fi
  1009. dnl *************************************************************************
  1010. dnl If the manual variable still is set, then we go with providing a built-in
  1011. dnl manual
  1012. if test "$USE_MANUAL" = "1"; then
  1013. AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
  1014. fi
  1015. dnl set variable for use in automakefile(s)
  1016. AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
  1017. dnl AC_PATH_PROG( RANLIB, ranlib, /usr/bin/ranlib,
  1018. dnl $PATH:/usr/bin/:/usr/local/bin )
  1019. dnl AC_SUBST(RANLIB)
  1020. dnl ************************************************************
  1021. dnl lame option to switch on debug options
  1022. dnl
  1023. AC_MSG_CHECKING([whether to enable debug options])
  1024. AC_ARG_ENABLE(debug,
  1025. AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
  1026. AC_HELP_STRING([--disable-debug],[Disable debug options]),
  1027. [ case "$enableval" in
  1028. no)
  1029. AC_MSG_RESULT(no)
  1030. ;;
  1031. *) AC_MSG_RESULT(yes)
  1032. CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
  1033. CFLAGS="$CFLAGS -g"
  1034. dnl set compiler "debug" options to become more picky, and remove
  1035. dnl optimize options from CFLAGS
  1036. CURL_CC_DEBUG_OPTS
  1037. ;;
  1038. esac
  1039. ],
  1040. AC_MSG_RESULT(no)
  1041. )
  1042. AC_MSG_CHECKING([whether to enable ares])
  1043. AC_ARG_ENABLE(ares,
  1044. AC_HELP_STRING([--enable-ares=PATH],[Enable ares for name lookups])
  1045. AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
  1046. [ case "$enableval" in
  1047. no)
  1048. AC_MSG_RESULT(no)
  1049. ;;
  1050. *) AC_MSG_RESULT(yes)
  1051. if test "x$IPV6_ENABLED" = "x1"; then
  1052. AC_MSG_ERROR([ares doesn't work with ipv6, disable ipv6 to use ares])
  1053. fi
  1054. AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
  1055. dnl substitute HAVE_ARES for curl-config and similar
  1056. HAVE_ARES="1"
  1057. AC_SUBST(HAVE_ARES)
  1058. LIBS="$LIBS -lcares"
  1059. dnl For backwards compatibility default to includes/lib in srcdir/ares
  1060. dnl If a value is specified it is assumed that the libs are in $val/lib
  1061. dnl and the includes are in $val/include. This is the default setup for
  1062. dnl ares so it should not be a problem.
  1063. if test "x$enableval" = "xyes" ; then
  1064. if test -d "$srcdir/ares"; then
  1065. AC_CONFIG_SUBDIRS(ares)
  1066. aresinc=`cd $srcdir/ares && pwd`
  1067. CPPFLAGS="$CPPFLAGS -I$aresinc"
  1068. dnl the pwd= below cannot 'cd' into the ares dir to get the full
  1069. dnl path to it, since it may not exist yet if we build outside of
  1070. dnl the source tree
  1071. pwd=`pwd`
  1072. LDFLAGS="$LDFLAGS -L$pwd/ares"
  1073. fi
  1074. else
  1075. CPPFLAGS="$CPPFLAGS -I$enableval/include"
  1076. LDFLAGS="$LDFLAGS -L$enableval/lib"
  1077. fi
  1078. ;;
  1079. esac ],
  1080. AC_MSG_RESULT(no)
  1081. )
  1082. AC_CONFIG_FILES([Makefile \
  1083. docs/Makefile \
  1084. docs/examples/Makefile \
  1085. docs/libcurl/Makefile \
  1086. include/Makefile \
  1087. include/curl/Makefile \
  1088. src/Makefile \
  1089. lib/Makefile \
  1090. tests/Makefile \
  1091. tests/data/Makefile \
  1092. tests/server/Makefile \
  1093. tests/libtest/Makefile \
  1094. packages/Makefile \
  1095. packages/Win32/Makefile \
  1096. packages/Win32/cygwin/Makefile \
  1097. packages/Linux/Makefile \
  1098. packages/Linux/RPM/Makefile \
  1099. packages/Linux/RPM/curl.spec \
  1100. packages/Linux/RPM/curl-ssl.spec \
  1101. packages/Solaris/Makefile \
  1102. packages/DOS/Makefile \
  1103. packages/EPM/curl.list \
  1104. packages/EPM/Makefile \
  1105. packages/vms/Makefile \
  1106. curl-config
  1107. ])
  1108. AC_OUTPUT