2
0

configure.ac 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(include/xmlrpc-c/base.h)
  3. AM_CONFIG_HEADER(xmlrpc_amconfig.h)
  4. dnl =======================================================================
  5. dnl Define PACKAGE, VERSION, @PACKAGE@, @VERSION@
  6. dnl =======================================================================
  7. dnl "x.xx" is supposed to be a version number, but is meaningless here.
  8. dnl The real version number is in Makefile.version.
  9. AM_INIT_AUTOMAKE(xmlrpc-c, x.xx)
  10. dnl Define @build@, @build_cpu@, @build_vendor@, @build_os,
  11. dnl @host, @host_cpu@, @host_vender, and @host_os@ substitutions.
  12. dnl "host" means the target system -- the one for which we are building.
  13. dnl "build" means the system that will do the building.
  14. AC_CANONICAL_HOST
  15. dnl =======================================================================
  16. dnl Decide What To Build
  17. dnl =======================================================================
  18. FEATURE_LIST=
  19. AC_ARG_ENABLE(wininet-client,
  20. [ --disable-wininet-client Don't build the Wininet client transport], ,
  21. enable_wininet_client=maybe)
  22. if test $enable_wininet_client = maybe; then
  23. AC_CHECK_PROG(have_wininet_config, wininet-config, yes, no)
  24. if test $have_wininet_config = no; then
  25. AC_MSG_NOTICE([You don't appear to have Wininet installed (no working wininet-config in your command search path), so we will not build the Wininet client XML transport])
  26. MUST_BUILD_WININET_CLIENT=no
  27. else
  28. MUST_BUILD_WININET_CLIENT=yes
  29. fi
  30. else
  31. MUST_BUILD_WININET_CLIENT=$enable_wininet_client
  32. fi
  33. AC_MSG_CHECKING(whether to build Wininet client XML transport module)
  34. AC_MSG_RESULT($MUST_BUILD_WININET_CLIENT)
  35. AC_SUBST(MUST_BUILD_WININET_CLIENT)
  36. AC_ARG_ENABLE(curl-client,
  37. [ --disable-curl-client Don't build the Curl client transport], ,
  38. enable_curl_client=maybe)
  39. if test $enable_curl_client = maybe; then
  40. AC_CHECK_PROG(have_curl_config, curl-config, yes, no)
  41. if test $have_curl_config = no; then
  42. AC_MSG_NOTICE([You don't appear to have Curl installed (no working curl-config in your command search path), so we will not build the Curl client XML transport])
  43. MUST_BUILD_CURL_CLIENT=no
  44. else
  45. MUST_BUILD_CURL_CLIENT=yes
  46. fi
  47. else
  48. MUST_BUILD_CURL_CLIENT=$enable_curl_client
  49. fi
  50. AC_MSG_CHECKING(whether to build Curl client XML transport module)
  51. AC_MSG_RESULT($MUST_BUILD_CURL_CLIENT)
  52. AC_SUBST(MUST_BUILD_CURL_CLIENT)
  53. AC_ARG_ENABLE(libwww-client,
  54. [ --disable-libwww-client Don't build the Libwww client transport], ,
  55. enable_libwww_client=maybe)
  56. if test $enable_libwww_client = maybe; then
  57. AC_CHECK_PROG(have_libwww_config, libwww-config, yes, no)
  58. if test $have_libwww_config = no; then
  59. AC_MSG_NOTICE([You don't appear to have Libwww installed (no working libwww-config in your command search path), so we will not build the Libwww client XML transport])
  60. MUST_BUILD_LIBWWW_CLIENT=no
  61. else
  62. MUST_BUILD_LIBWWW_CLIENT=yes
  63. fi
  64. else
  65. MUST_BUILD_LIBWWW_CLIENT=$enable_libwww_client
  66. fi
  67. AC_MSG_CHECKING(whether to build Libwww client XML transport module)
  68. AC_MSG_RESULT($MUST_BUILD_LIBWWW_CLIENT)
  69. AC_SUBST(MUST_BUILD_LIBWWW_CLIENT)
  70. AC_ARG_ENABLE(tools,
  71. [ --enable-tools Build the tools], ,
  72. [enable_tools=no])
  73. # The first AC_CHECK_LIB has to be in unconditional code because as a
  74. # side effect, it determines what the object file suffix is on this system,
  75. # and if it is statically present even though not actually executed, Autoconf
  76. # later thinks it has already computed the object file suffix and uses it
  77. # without computing it. This was with Autoconf 2.59
  78. AC_CHECK_LIB(ncurses, main, [have_libncurses=yes], [have_libncurses=no])
  79. AC_CHECK_LIB(readline, main, [have_libreadline=yes], [have_libreadline=no])
  80. AC_MSG_CHECKING(whether to build tools)
  81. BUILD_XMLRPC_PSTREAM=no
  82. if test $enable_tools = yes; then
  83. if ! test "$MUST_BUILD_WININET_CLIENT $MUST_BUILD_CURL_CLIENT $MUST_BUILD_LIBWWW_CLIENT" = "no no no"; then
  84. if test $have_libreadline = yes && test $have_libncurses = yes; then
  85. BUILD_XMLRPC_PSTREAM=yes
  86. fi
  87. BUILD_TOOLS=yes
  88. fi
  89. else
  90. BUILD_TOOLS=$enable_tools
  91. fi
  92. AC_MSG_RESULT($BUILD_TOOLS)
  93. AC_SUBST(BUILD_TOOLS)
  94. if test $BUILD_TOOLS = yes; then
  95. AC_MSG_CHECKING(whether to build the xmlrpc_pstream tool)
  96. AC_MSG_RESULT($BUILD_XMLRPC_PSTREAM)
  97. AC_SUBST(BUILD_XMLRPC_PSTREAM)
  98. fi
  99. dnl Set up the appropriate Makefile substitutions.
  100. CLIENTTEST=clienttest
  101. AC_SUBST(CLIENTTEST)
  102. XMLRPC_CLIENT_H=xmlrpc_client.h
  103. AC_SUBST(XMLRPC_CLIENT_H)
  104. XMLRPC_TRANSPORT_H=xmlrpc_transport.h
  105. AC_SUBST(XMLRPC_TRANSPORT_H)
  106. SYNCH_CLIENT=synch_client
  107. AC_SUBST(SYNCH_CLIENT)
  108. ASYNCH_CLIENT=asynch_client
  109. AC_SUBST(ASYNCH_CLIENT)
  110. AUTH_CLIENT=auth_client
  111. AC_SUBST(AUTH_CLIENT)
  112. QUERY_MEERKAT=query-meerkat
  113. AC_SUBST(QUERY_MEERKAT)
  114. if test $MUST_BUILD_WININET_CLIENT = yes; then
  115. FEATURE_LIST="wininet-client $FEATURE_LIST"
  116. fi
  117. if test $MUST_BUILD_CURL_CLIENT = yes; then
  118. FEATURE_LIST="curl-client $FEATURE_LIST"
  119. fi
  120. if test $MUST_BUILD_LIBWWW_CLIENT = yes; then
  121. FEATURE_LIST="libwww-client $FEATURE_LIST"
  122. fi
  123. dnl Check to see if we should build our Abyss server module.
  124. AC_MSG_CHECKING(whether to build Abyss server module)
  125. AC_ARG_ENABLE(abyss-server,
  126. [ --disable-abyss-server Don't build the Abyss server module], ,
  127. enable_abyss_server=yes)
  128. AC_MSG_RESULT($enable_abyss_server)
  129. ENABLE_ABYSS_SERVER=$enable_abyss_server
  130. AC_SUBST(ENABLE_ABYSS_SERVER)
  131. dnl Set up the appropriate Makefile substitutions.
  132. ABYSS_SUBDIR=
  133. SERVERTEST=
  134. VALIDATEE=
  135. XMLRPC_ABYSS_H=
  136. SERVER=
  137. if test x"$enable_abyss_server" != xno; then
  138. FEATURE_LIST="abyss-server $FEATURE_LIST"
  139. ABYSS_SUBDIR=abyss
  140. SERVERTEST=servertest
  141. VALIDATEE=validatee
  142. XMLRPC_ABYSS_H=xmlrpc_abyss.h
  143. SERVER=server
  144. fi
  145. AC_SUBST(ABYSS_SUBDIR)
  146. AC_SUBST(SERVERTEST)
  147. AC_SUBST(VALIDATEE)
  148. AC_SUBST(XMLRPC_ABYSS_H)
  149. AC_SUBST(SERVER)
  150. dnl Check to see if we should build our CGI server module.
  151. AC_MSG_CHECKING(whether to build CGI server module)
  152. AC_ARG_ENABLE(cgi-server,
  153. [ --disable-cgi-server Don't build the CGI server module], ,
  154. enable_cgi_server=yes)
  155. AC_MSG_RESULT($enable_cgi_server)
  156. ENABLE_CGI_SERVER=$enable_cgi_server
  157. AC_SUBST(ENABLE_CGI_SERVER)
  158. dnl Check to see if we should build our C++ stuff.
  159. AC_MSG_CHECKING(whether to build C++ wrappers and tools)
  160. AC_ARG_ENABLE(cplusplus,
  161. [ --disable-cplusplus Don't build the C++ wrapper classes or tools], ,
  162. enable_cplusplus=yes)
  163. AC_MSG_RESULT($enable_cplusplus)
  164. ENABLE_CPLUSPLUS=$enable_cplusplus
  165. AC_SUBST(ENABLE_CPLUSPLUS)
  166. dnl Set up the appropriate Makefile substitutions.
  167. LIBXMLRPC_CPP_A=
  168. CPPTEST=
  169. XMLRPCCPP_H=
  170. XML_RPC_API2CPP_SUBDIR=
  171. MEERKAT_APP_LIST=
  172. INTEROP_CLIENT_SUBDIR=
  173. if test x"$enable_cplusplus" != xno; then
  174. FEATURE_LIST="c++ $FEATURE_LIST"
  175. LIBXMLRPC_CPP_A=libxmlrpc_cpp.a
  176. CPPTEST=cpptest
  177. XMLRPCCPP_H=XmlRpcCpp.h
  178. if test $MUST_BUILD_LIBWWW_CLIENT = yes; then
  179. XML_RPC_API2CPP_SUBDIR=xml-rpc-api2cpp
  180. elif test $MUST_BUILD_CURL_CLIENT = yes; then
  181. XML_RPC_API2CPP_SUBDIR=xml-rpc-api2cpp
  182. fi
  183. fi
  184. AC_SUBST(LIBXMLRPC_CPP_A)
  185. AC_SUBST(CPPTEST)
  186. AC_SUBST(XMLRPCCPP_H)
  187. AC_SUBST(XML_RPC_API2CPP_SUBDIR)
  188. AC_SUBST(FEATURE_LIST)
  189. dnl =======================================================================
  190. dnl Checks for programs.
  191. dnl =======================================================================
  192. AC_PROG_CC
  193. if test x"$enable_cplusplus" != xno; then
  194. AC_PROG_CXX
  195. fi
  196. dnl =======================================================================
  197. dnl Checks for libraries.
  198. dnl =======================================================================
  199. # Code by albert chin <china@thewrittenword.com> to check for various
  200. # oddball networking libraries. Solaris and some other operating systems
  201. # hide their networking code in various places. (Yes, this links too many
  202. # of our libraries against -lsocket, but a finer-grained mechanism would
  203. # require too much testing.)
  204. AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
  205. # Above sets LIBS, which is not all that useful because we don't want
  206. # to include every library in every link. It also sets
  207. # ac_cv_lib_socket_socket, which we use to pass more specific information
  208. # to the configuration files.
  209. if test x"$ac_cv_lib_socket_socket" = xyes; then
  210. LSOCKET=-lsocket
  211. else
  212. LSOCKET=
  213. fi
  214. AC_SUBST(LSOCKET)
  215. # For some reason, we don't seem to need this on Solaris. If you do
  216. # need it, go ahead and try it.
  217. # AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
  218. dnl =======================================================================
  219. dnl Checks for header files.
  220. dnl =======================================================================
  221. AC_STDC_HEADERS
  222. dnl We don't use AM_CONFIG_HEADER to define HAVE_WCHAR_H, etc. because
  223. dnl the following is more straightforward and easier to understand,
  224. dnl especially for a newcomer. Furthermore, AM_CONFIG_HEADER represents
  225. dnl false as undefined, whereas our scheme represents it as 0. undefined
  226. dnl is a poor choice because it often means just that you neglected to
  227. dnl choose a value for some reason.
  228. dnl defines ac_cv_header_wchar_h, etc:
  229. AC_CHECK_HEADERS(wchar.h)
  230. if test x"$ac_cv_header_wchar_h" = xyes; then
  231. HAVE_WCHAR_H_DEFINE=1
  232. else
  233. HAVE_WCHAR_H_DEFINE=0
  234. fi
  235. AC_SUBST(HAVE_WCHAR_H_DEFINE)
  236. # Needed by Abyss on Solaris:
  237. AC_CHECK_HEADERS(sys/filio.h)
  238. if test x"$ac_cv_header_sys_filio_h" = xyes; then
  239. HAVE_SYS_FILIO_H_DEFINE=1
  240. else
  241. HAVE_SYS_FILIO_H_DEFINE=0
  242. fi
  243. AC_SUBST(HAVE_SYS_FILIO_H_DEFINE)
  244. # Needed by Abyss on Solaris:
  245. AC_CHECK_HEADERS(sys/ioctl.h)
  246. if test x"$ac_cv_header_sys_ioctl_h" = xyes; then
  247. HAVE_SYS_IOCTL_H_DEFINE=1
  248. else
  249. HAVE_SYS_IOCTL_H_DEFINE=0
  250. fi
  251. AC_SUBST(HAVE_SYS_IOCTL_H_DEFINE)
  252. AC_CHECK_HEADERS(sys/select.h)
  253. if test x"$ac_cv_header_sys_select_h" = xyes; then
  254. HAVE_SYS_SELECT_H_DEFINE=1
  255. else
  256. HAVE_SYS_SELECT_H_DEFINE=0
  257. fi
  258. AC_SUBST(HAVE_SYS_SELECT_H_DEFINE)
  259. AC_CHECK_HEADERS(stdarg.h, , [
  260. AC_MSG_ERROR(stdarg.h is required to build this library)
  261. ])
  262. dnl =======================================================================
  263. dnl Checks for typedefs, structures, and compiler characteristics.
  264. dnl =======================================================================
  265. dnl AC_C_BIGENDIAN
  266. AC_TYPE_SIZE_T
  267. dnl This check is borrowed from Python 1.5.2.
  268. va_list_is_array=no
  269. AC_MSG_CHECKING(whether va_list is an array)
  270. AC_TRY_COMPILE([
  271. #include <stdarg.h>
  272. ], [va_list list1, list2; list1 = list2;], ,
  273. va_list_is_array=yes)
  274. AC_MSG_RESULT($va_list_is_array)
  275. if test x"$va_list_is_array" = xyes; then
  276. VA_LIST_IS_ARRAY_DEFINE=1
  277. else
  278. VA_LIST_IS_ARRAY_DEFINE=0
  279. fi
  280. AC_SUBST(VA_LIST_IS_ARRAY_DEFINE)
  281. AC_MSG_CHECKING(whether compiler has __attribute__)
  282. AC_TRY_COMPILE(, [int x __attribute__((__unused__));],
  283. compiler_has_attribute=yes,
  284. compiler_has_attribute=no)
  285. AC_MSG_RESULT($compiler_has_attribute)
  286. if test x"$compiler_has_attribute" = xyes; then
  287. ATTR_UNUSED="__attribute__((__unused__))"
  288. else
  289. ATTR_UNUSED=
  290. fi
  291. AC_SUBST(ATTR_UNUSED)
  292. dnl =======================================================================
  293. dnl Checks for library functions.
  294. dnl =======================================================================
  295. AC_CHECK_FUNC(vsnprintf, , [
  296. AC_MSG_ERROR(your C library does not provide vsnprintf)
  297. ])
  298. dnl Unicode function needed by test suites.
  299. AC_CHECK_FUNCS(wcsncmp)
  300. dnl CygWin doesn't provide setgroups.
  301. AC_CHECK_FUNCS(setgroups)
  302. AC_CHECK_FUNCS(asprintf)
  303. AC_CHECK_FUNCS(setenv strtoll strtoull strtoq strtouq __strtoll __strtoull)
  304. dnl uclib doesn't have pselect
  305. AC_CHECK_FUNCS(pselect)
  306. dnl Windows doesn't have gettimeofday, localtime_r, or gmtime_r
  307. AC_CHECK_FUNCS(gettimeofday)
  308. AC_CHECK_FUNCS(localtime_r)
  309. AC_CHECK_FUNCS(gmtime_r)
  310. dnl Windows doesn't have strcasecmp;
  311. AC_CHECK_FUNCS(strcasecmp)
  312. AC_CHECK_FUNCS(stricmp)
  313. AC_CHECK_FUNCS(_stricmp)
  314. dnl =======================================================================
  315. dnl Checks for operating system features.
  316. dnl =======================================================================
  317. dnl Non-Unix systems will need to set up their platform configuration file
  318. dnl by hand.
  319. DIRECTORY_SEPARATOR="/"
  320. AC_SUBST(DIRECTORY_SEPARATOR)
  321. dnl =======================================================================
  322. dnl ABYSS Configuration
  323. dnl =======================================================================
  324. AC_MSG_CHECKING(whether to use Abyss pthread function)
  325. AC_ARG_ENABLE(abyss-threads,
  326. [ --disable-abyss-threads Use fork in Abyss instead of pthreads], ,
  327. enable_abyss_threads=yes)
  328. AC_MSG_RESULT($enable_abyss_threads)
  329. ENABLE_ABYSS_THREADS=$enable_abyss_threads
  330. AC_SUBST(ENABLE_ABYSS_THREADS)
  331. if test x"$enable_abyss_threads" != xno; then
  332. CFLAGS="$CFLAGS -D_THREAD"
  333. fi
  334. dnl =======================================================================
  335. dnl Finding wininet stubs
  336. dnl =======================================================================
  337. dnl If you implement the parts of wininet.h the wininet_transport uses,
  338. dnl you will need to configure this way..
  339. if test $MUST_BUILD_WININET_CLIENT = yes; then
  340. dnl You can control which of these gets chosen by controlling PATH.
  341. AC_PATH_PROGS(WININET_CONFIG, wininet-xmlrpc-config wininet-config, no)
  342. if test "x$WININET_CONFIG" = "xno"; then
  343. AC_MSG_ERROR(Configure INTERNAL ERROR - first wininet-config found, then not found)
  344. fi
  345. dnl Get our wininet version.
  346. dnl Adapted from a macro which called gtk-config.
  347. AC_MSG_CHECKING(for wininet version >= 1.0.0)
  348. W3VER=$($WININET_CONFIG --version)
  349. WININET_MAJOR=\
  350. $(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/')
  351. WININET_MINOR=\
  352. $(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/')
  353. WININET_MICRO=\
  354. $(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/')
  355. AC_MSG_RESULT($WININET_MAJOR.$WININET_MINOR.$WININET_MICRO)
  356. dnl Check to make sure our version is OK.
  357. WININET_VERSION_OK=yes
  358. if test $WININET_MAJOR -lt 1; then
  359. WININET_VERSION_OK=no
  360. else
  361. if test $WININET_MAJOR -eq 1 -a $WININET_MINOR -lt 0; then
  362. WININET_VERSION_OK=no
  363. else
  364. if test $WININET_MAJOR -eq 1 -a $WININET_MINOR -eq 0 \
  365. -a $WININET_MICRO -lt 0; then
  366. WININET_VERSION_OK=no
  367. fi
  368. fi
  369. fi
  370. if test "x$WININET_VERSION_OK" = "xno"; then
  371. AC_MSG_ERROR(wininet version >= 1.0.0 required)
  372. fi
  373. dnl Get the necessary CFLAGS, and merge them into our master list.
  374. WININET_CFLAGS=$($WININET_CONFIG --cflags)
  375. AC_SUBST(WININET_CFLAGS)
  376. CFLAGS="$CFLAGS $WININET_CFLAGS"
  377. dnl Get the huge list of libraries we need to link against.
  378. WININET_LDADD=$($WININET_CONFIG --libs)
  379. AC_SUBST(WININET_LDADD)
  380. AC_MSG_CHECKING(for wininet library directory)
  381. WININET_LIBDIR="$($WININET_CONFIG --prefix)/lib"
  382. AC_MSG_RESULT($WININET_LIBDIR)
  383. AC_SUBST(WININET_LIBDIR)
  384. fi # MUST_BUILD_WININET_CLIENT
  385. dnl =======================================================================
  386. dnl Finding w3c-libwww
  387. dnl =======================================================================
  388. if test $MUST_BUILD_LIBWWW_CLIENT = yes; then
  389. dnl First of all, locate the libwww config program.
  390. dnl You can control which of these gets chosen by controlling PATH.
  391. AC_PATH_PROGS(LIBWWW_CONFIG, libwww-xmlrpc-config libwww-config, no)
  392. if test "x$LIBWWW_CONFIG" = "xno"; then
  393. AC_MSG_ERROR(Configure INTERNAL ERROR - first libwww-config found, then not found)
  394. fi
  395. dnl Get our libwww version.
  396. dnl Adapted from a macro which called gtk-config.
  397. AC_MSG_CHECKING(for w3c-libwww version >= 5.2.8)
  398. W3VER=$($LIBWWW_CONFIG --version)
  399. LIBWWW_MAJOR=\
  400. $(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/')
  401. LIBWWW_MINOR=\
  402. $(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/')
  403. LIBWWW_MICRO=\
  404. $(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/')
  405. AC_MSG_RESULT($LIBWWW_MAJOR.$LIBWWW_MINOR.$LIBWWW_MICRO)
  406. dnl Check to make sure our version is OK.
  407. LIBWWW_VERSION_OK=yes
  408. if test $LIBWWW_MAJOR -lt 5; then
  409. LIBWWW_VERSION_OK=no
  410. else
  411. if test $LIBWWW_MAJOR -eq 5 -a $LIBWWW_MINOR -lt 2; then
  412. LIBWWW_VERSION_OK=no
  413. else
  414. if test $LIBWWW_MAJOR -eq 5 -a $LIBWWW_MINOR -eq 2 \
  415. -a $LIBWWW_MICRO -lt 8; then
  416. LIBWWW_VERSION_OK=no
  417. fi
  418. fi
  419. fi
  420. if test "x$LIBWWW_VERSION_OK" = "xno"; then
  421. AC_MSG_ERROR(w3c-libwww version >= 5.2.8 required)
  422. fi
  423. dnl Get the huge list of libraries we need to link against.
  424. LIBWWW_LDADD=$(LIBWWW_CONFIG --libs)
  425. AC_SUBST(LIBWWW_LDADD)
  426. AC_MSG_CHECKING(for libwww library directory)
  427. LIBWWW_LIBDIR="$(LIBWWW_CONFIG --prefix)/lib"
  428. AC_MSG_RESULT($LIBWWW_LIBDIR)
  429. AC_SUBST(LIBWWW_LIBDIR)
  430. fi # MUST_BUILD_LIBWWW_CLIENT
  431. dnl =======================================================================
  432. dnl Finding Curl
  433. dnl =======================================================================
  434. if test $MUST_BUILD_CURL_CLIENT = yes; then
  435. dnl First of all, locate the Curl config program.
  436. dnl You can control which of these gets chosen by controlling PATH.
  437. AC_PATH_PROGS(CURL_CONFIG, curl-xmlrpc-config curl-config, no)
  438. if test "x$CURL_CONFIG" = "xno"; then
  439. AC_MSG_ERROR(Configure INTERNAL ERROR - first curl-config found, then not found)
  440. fi
  441. dnl There used to be code here to check the Curl version and make sure
  442. dnl it is at least 7.8. But there were bugs both in the code and in
  443. dnl curl (curl-config --vernum, at least in older versions of Curl,
  444. dnl omits the leading zero). So it didn't work. Plus, checking version
  445. dnl numbers isn't a good idea. Better to check for feature presence.
  446. dnl So we don't do any check now. If we find out there's a problem with
  447. dnl older Curls, we will revisit that.
  448. CURL_LDADD=$($CURL_CONFIG --libs)
  449. AC_SUBST(CURL_LDADD)
  450. AC_MSG_CHECKING(for Curl library directory)
  451. CURL_LIBDIR="$($CURL_CONFIG --prefix)/lib"
  452. AC_MSG_RESULT($CURL_LIBDIR)
  453. AC_SUBST(CURL_LIBDIR)
  454. fi # MUST_BUILD_CURL_CLIENT
  455. dnl =======================================================================
  456. dnl Checks for build options.
  457. dnl =======================================================================
  458. AC_ARG_WITH(libwww-ssl,
  459. [ --with-libwww-ssl Include libwww SSL capability.]
  460. )
  461. if test x"$enable_libwww_client" != xno; then
  462. AC_MSG_CHECKING(whether to use SSL with libwww)
  463. if test x"$with_libwww_ssl" = xyes; then
  464. AC_MSG_RESULT(yes)
  465. HAVE_LIBWWW_SSL_DEFINE=1
  466. else
  467. AC_MSG_RESULT(no)
  468. HAVE_LIBWWW_SSL_DEFINE=0
  469. fi
  470. fi
  471. AC_SUBST(HAVE_LIBWWW_SSL_DEFINE)
  472. dnl Check to see if we should build the libxml2 backend.
  473. AC_ARG_ENABLE(libxml2-backend,
  474. [ --enable-libxml2-backend Use libxml2 instead of built-in expat], ,
  475. enable_libxml2_backend=no)
  476. AC_MSG_CHECKING(whether to build the libxml2 backend)
  477. AC_MSG_RESULT($enable_libxml2_backend)
  478. if test $enable_libxml2_backend = yes; then
  479. AC_CHECK_PROG(have_xml2_config, xml2-config, yes, no)
  480. if test $have_xml2_config = no; then
  481. AC_MSG_ERROR([You specified --enable-libxml2_backend, but don't appear to have libxml2 installed (no working xml2-config in your command search path), so we cannot not build for libxml2])
  482. fi
  483. fi
  484. ENABLE_LIBXML2_BACKEND=$enable_libxml2_backend
  485. AC_SUBST(ENABLE_LIBXML2_BACKEND)
  486. dnl =======================================================================
  487. dnl Compiler information
  488. dnl =======================================================================
  489. C_COMPILER_GNU=$ac_cv_c_compiler_gnu
  490. AC_SUBST(C_COMPILER_GNU)
  491. CXX_COMPILER_GNU=$ac_cv_cxx_compiler_gnu
  492. AC_SUBST(CXX_COMPILER_GNU)
  493. dnl obsolete variables, need to be removed from Makefile.in:
  494. CC_WARN_FLAGS=
  495. AC_SUBST(CC_WARN_FLAGS)
  496. CPP_WARN_FLAGS=
  497. AC_SUBST(CPP_WARN_FLAGS)
  498. BUILDDIR=$(pwd)
  499. AC_SUBST(BUILDDIR)
  500. dnl =======================================================================
  501. dnl Output our results.
  502. dnl =======================================================================
  503. dnl Note that AM_CONFIG_HEADER at the top of this file outputs another
  504. dnl result: xmlrpc_amconfig.h .
  505. AC_OUTPUT( \
  506. srcdir.mk \
  507. config.mk \
  508. xmlrpc_config.h \
  509. )
  510. if test ! -f GNUmakefile; then
  511. ln -s "${srcdir}/GNUmakefile" .
  512. fi
  513. if test ! -f Makefile; then
  514. ln -s "${srcdir}/Makefile" .
  515. fi
  516. if test "$MUST_BUILD_WININET_CLIENT $MUST_BUILD_CURL_CLIENT $MUST_BUILD_LIBWWW_CLIENT" = "no no no"; then
  517. AC_MSG_NOTICE([==>])
  518. AC_MSG_NOTICE([==>We are not building any client XML transport (see earlier messages explaining why), therefore WE WILL NOT BUILD THE CLIENT LIBRARY.])
  519. AC_MSG_NOTICE([==>])
  520. fi