configure.in 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(entities.c)
  3. AM_CONFIG_HEADER(config.h)
  4. AC_CONFIG_MACRO_DIR([m4])
  5. AC_CANONICAL_HOST
  6. LIBXML_MAJOR_VERSION=2
  7. LIBXML_MINOR_VERSION=7
  8. LIBXML_MICRO_VERSION=7
  9. LIBXML_MICRO_VERSION_SUFFIX=
  10. LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
  11. LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
  12. LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
  13. if test -f CVS/Entries ; then
  14. extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
  15. echo extra=$extra
  16. if test "$extra" != ""
  17. then
  18. LIBXML_VERSION_EXTRA="-CVS$extra"
  19. fi
  20. else if test -d .svn ; then
  21. extra=`svn info | grep Revision | sed 's+Revision: ++'`
  22. echo extra=$extra
  23. if test "$extra" != ""
  24. then
  25. LIBXML_VERSION_EXTRA="-SVN$extra"
  26. fi
  27. else if test -d .git ; then
  28. extra=`git describe | sed 's+LIBXML[[0-9.]]*-++'`
  29. echo extra=$extra
  30. if test "$extra" != ""
  31. then
  32. LIBXML_VERSION_EXTRA="-GIT$extra"
  33. fi
  34. fi
  35. fi
  36. fi
  37. AC_SUBST(LIBXML_MAJOR_VERSION)
  38. AC_SUBST(LIBXML_MINOR_VERSION)
  39. AC_SUBST(LIBXML_MICRO_VERSION)
  40. AC_SUBST(LIBXML_VERSION)
  41. AC_SUBST(LIBXML_VERSION_INFO)
  42. AC_SUBST(LIBXML_VERSION_NUMBER)
  43. AC_SUBST(LIBXML_VERSION_EXTRA)
  44. VERSION=${LIBXML_VERSION}
  45. AM_INIT_AUTOMAKE(libxml2, $VERSION)
  46. dnl Checks for programs.
  47. AC_PROG_CC
  48. AC_PROG_INSTALL
  49. AC_PROG_CPP
  50. AC_PATH_PROG(RM, rm, /bin/rm)
  51. AC_PATH_PROG(MV, mv, /bin/mv)
  52. AC_PATH_PROG(TAR, tar, /bin/tar)
  53. AC_PATH_PROG(PERL, perl, /usr/bin/perl)
  54. AC_PATH_PROG(WGET, wget, /usr/bin/wget)
  55. AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
  56. AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
  57. dnl Make sure we have an ANSI compiler
  58. AM_C_PROTOTYPES
  59. test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
  60. AC_LIBTOOL_WIN32_DLL
  61. AM_PROG_LIBTOOL
  62. dnl
  63. dnl if the system support linker version scripts for symbol versioning
  64. dnl then add it
  65. dnl
  66. VERSION_SCRIPT_FLAGS=
  67. # lt_cv_prog_gnu_ld is from libtool 2.+
  68. if test "$lt_cv_prog_gnu_ld" = yes; then
  69. VERSION_SCRIPT_FLAGS=-Wl,--version-script=
  70. else
  71. case $host in
  72. *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";;
  73. esac
  74. fi
  75. AC_SUBST(VERSION_SCRIPT_FLAGS)
  76. AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
  77. dnl
  78. dnl We process the AC_ARG_WITH first so that later we can modify
  79. dnl some of them to try to prevent impossible combinations. This
  80. dnl also allows up so alphabetize the choices
  81. dnl
  82. dnl
  83. dnl zlib option might change flags, so we save them initially
  84. dnl
  85. _cppflags="${CPPFLAGS}"
  86. _ldflags="${LDFLAGS}"
  87. AC_ARG_WITH(c14n,
  88. [ --with-c14n add the Canonicalization support (on)])
  89. AC_ARG_WITH(catalog,
  90. [ --with-catalog add the Catalog support (on)])
  91. AC_ARG_WITH(debug,
  92. [ --with-debug add the debugging module (on)])
  93. AC_ARG_WITH(docbook,
  94. [ --with-docbook add Docbook SGML support (on)])
  95. AC_ARG_WITH(fexceptions,
  96. [ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
  97. AC_ARG_WITH(ftp,
  98. [ --with-ftp add the FTP support (on)])
  99. AC_ARG_WITH(history,
  100. [ --with-history add history support to xmllint shell(off)])
  101. AC_ARG_WITH(html,
  102. [ --with-html add the HTML support (on)])
  103. dnl Specific dir for HTML output ?
  104. AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
  105. [path to base html directory, default $datadir/doc/html]),
  106. [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
  107. AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
  108. [directory used under html-dir, default $PACKAGE-$VERSION/html]),
  109. [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
  110. [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
  111. AC_SUBST(HTML_DIR)
  112. AC_ARG_WITH(http,
  113. [ --with-http add the HTTP support (on)])
  114. AC_ARG_WITH(iconv,
  115. [ --with-iconv[[=DIR]] add ICONV support (on)])
  116. AC_ARG_WITH(iso8859x,
  117. [ --with-iso8859x add ISO8859X support if no iconv (on)])
  118. AC_ARG_WITH(legacy,
  119. [ --with-legacy add deprecated APIs for compatibility (on)])
  120. AC_ARG_WITH(mem_debug,
  121. [ --with-mem-debug add the memory debugging module (off)])
  122. AC_ARG_WITH(minimum,
  123. [ --with-minimum build a minimally sized library (off)])
  124. AC_ARG_WITH(output,
  125. [ --with-output add the serialization support (on)])
  126. AC_ARG_WITH(pattern,
  127. [ --with-pattern add the xmlPattern selection interface (on)])
  128. AC_ARG_WITH(push,
  129. [ --with-push add the PUSH parser interfaces (on)])
  130. AC_ARG_WITH(python,
  131. [ --with-python[[=DIR]] build Python bindings if found])
  132. AC_ARG_WITH(reader,
  133. [ --with-reader add the xmlReader parsing interface (on)])
  134. AC_ARG_WITH(readline,
  135. [ --with-readline=DIR use readline in DIR],[
  136. if test "$withval" != "no" -a "$withval" != "yes"; then
  137. RDL_DIR=$withval
  138. CPPFLAGS="${CPPFLAGS} -I$withval/include"
  139. LDFLAGS="${LDFLAGS} -L$withval/lib"
  140. fi
  141. ])
  142. AC_ARG_WITH(regexps,
  143. [ --with-regexps add Regular Expressions support (on)])
  144. AC_ARG_WITH(run_debug,
  145. [ --with-run-debug add the runtime debugging module (off)])
  146. AC_ARG_WITH(sax1,
  147. [ --with-sax1 add the older SAX1 interface (on)])
  148. AC_ARG_WITH(schemas,
  149. [ --with-schemas add Relax-NG and Schemas support (on)])
  150. AC_ARG_WITH(schematron,
  151. [ --with-schematron add Schematron support (on)])
  152. AC_ARG_WITH(threads,
  153. [ --with-threads add multithread support(on)])
  154. AC_ARG_WITH(thread-alloc,
  155. [ --with-thread-alloc add per-thread memory(off)])
  156. AC_ARG_WITH(tree,
  157. [ --with-tree add the DOM like tree manipulation APIs (on)])
  158. AC_ARG_WITH(valid,
  159. [ --with-valid add the DTD validation support (on)])
  160. AC_ARG_WITH(writer,
  161. [ --with-writer add the xmlWriter saving interface (on)])
  162. AC_ARG_WITH(xinclude,
  163. [ --with-xinclude add the XInclude support (on)])
  164. AC_ARG_WITH(xpath,
  165. [ --with-xpath add the XPATH support (on)])
  166. AC_ARG_WITH(xptr,
  167. [ --with-xptr add the XPointer support (on)])
  168. AC_ARG_WITH(modules,
  169. [ --with-modules add the dynamic modules support (on)])
  170. AC_ARG_WITH(zlib,
  171. [ --with-zlib[[=DIR]] use libz in DIR],[
  172. if test "$withval" != "no" -a "$withval" != "yes"; then
  173. Z_DIR=$withval
  174. CPPFLAGS="${CPPFLAGS} -I$withval/include"
  175. LDFLAGS="${LDFLAGS} -L$withval/lib"
  176. fi
  177. ])
  178. AC_ARG_WITH(coverage,
  179. [ --with-coverage build for code coverage with GCC (off)])
  180. AC_ARG_ENABLE(rebuild-docs,
  181. [ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=yes]]])
  182. AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "no"])
  183. dnl
  184. dnl hard dependancies on options
  185. dnl
  186. if test "$with_schemas" = "yes"
  187. then
  188. with_pattern=yes
  189. with_regexps=yes
  190. fi
  191. if test "$with_schematron" = "yes"
  192. then
  193. with_pattern=yes
  194. with_xpath=yes
  195. fi
  196. if test "$with_reader" = "yes"
  197. then
  198. with_push=yes
  199. fi
  200. if test "$with_xptr" = "yes"
  201. then
  202. with_xpath=yes
  203. fi
  204. dnl
  205. dnl option to build a minimal libxml2 library
  206. dnl
  207. if test "$with_minimum" = "yes"
  208. then
  209. echo "Configuring for a minimal library"
  210. if test "$with_c14n" = ""
  211. then
  212. with_c14n=no
  213. fi
  214. if test "$with_catalog" = ""
  215. then
  216. with_catalog=no
  217. fi
  218. echo So far so good!
  219. if test "$with_debug" = ""
  220. then
  221. with_debug=no
  222. fi
  223. if test "$with_docbook" = ""
  224. then
  225. with_docbook=no
  226. fi
  227. if test "$with_fexceptions" = ""
  228. then
  229. with_fexceptions=no
  230. fi
  231. if test "$with_ftp" = ""
  232. then
  233. with_ftp=no
  234. fi
  235. if test "$with_history" = ""
  236. then
  237. with_history=no
  238. fi
  239. if test "$with_html" = ""
  240. then
  241. with_html=no
  242. fi
  243. if test "$with_http" = ""
  244. then
  245. with_http=no
  246. fi
  247. if test "$with_iconv" = ""
  248. then
  249. with_iconv=no
  250. fi
  251. if test "$with_iso8859x" = ""
  252. then
  253. with_iso8859x=no
  254. fi
  255. if test "$with_legacy" = ""
  256. then
  257. with_legacy=no
  258. fi
  259. if test "$with_mem_debug" = ""
  260. then
  261. with_mem_debug=no
  262. fi
  263. if test "$with_output" = ""
  264. then
  265. with_output=no
  266. fi
  267. if test "$with_pattern" = ""
  268. then
  269. with_pattern=no
  270. fi
  271. if test "$with_push" = ""
  272. then
  273. with_push=no
  274. fi
  275. if test "$with_python" = ""
  276. then
  277. with_python=no
  278. fi
  279. if test "$with_reader" = ""
  280. then
  281. with_reader=no
  282. fi
  283. if test "$with_readline" = ""
  284. then
  285. with_readline=no
  286. fi
  287. if test "$with_regexps" = ""
  288. then
  289. with_regexps=no
  290. fi
  291. if test "$with_run_debug" = ""
  292. then
  293. with_run_debug=no
  294. fi
  295. if test "$with_sax1" = ""
  296. then
  297. with_sax1=no
  298. fi
  299. if test "$with_schemas" = ""
  300. then
  301. with_schemas=no
  302. fi
  303. if test "$with_schematron" = ""
  304. then
  305. with_schematron=no
  306. fi
  307. if test "$with_threads" = ""
  308. then
  309. with_threads=no
  310. fi
  311. if test "$with_thread_alloc" = ""
  312. then
  313. with_thread_alloc=no
  314. fi
  315. if test "$with_tree" = ""
  316. then
  317. with_tree=no
  318. fi
  319. if test "$with_valid" = ""
  320. then
  321. with_valid=no
  322. fi
  323. if test "$with_writer" = ""
  324. then
  325. with_writer=no
  326. fi
  327. if test "$with_xinclude" = ""
  328. then
  329. with_xinclude=no
  330. fi
  331. if test "$with_xpath" = ""
  332. then
  333. with_xpath=no
  334. fi
  335. if test "$with_xptr" = ""
  336. then
  337. with_xptr=no
  338. fi
  339. if test "$with_zlib" = ""
  340. then
  341. with_zlib=no
  342. fi
  343. if test "$with_modules" = ""
  344. then
  345. with_modules=no
  346. fi
  347. fi
  348. echo Checking zlib
  349. dnl Checks for zlib library.
  350. WITH_ZLIB=0
  351. if test "$with_zlib" = "no"; then
  352. echo "Disabling compression support"
  353. else
  354. AC_CHECK_HEADERS(zlib.h,
  355. AC_CHECK_LIB(z, gzread,[
  356. AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
  357. WITH_ZLIB=1
  358. if test "x${Z_DIR}" != "x"; then
  359. Z_CFLAGS="-I${Z_DIR}/include"
  360. Z_LIBS="-L${Z_DIR}/lib -lz"
  361. [case ${host} in
  362. *-*-solaris*)
  363. Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
  364. ;;
  365. esac]
  366. else
  367. Z_LIBS="-lz"
  368. fi]))
  369. fi
  370. AC_SUBST(Z_CFLAGS)
  371. AC_SUBST(Z_LIBS)
  372. AC_SUBST(WITH_ZLIB)
  373. CPPFLAGS=${_cppflags}
  374. LDFLAGS=${_ldflags}
  375. echo Checking headers
  376. dnl Checks for header files.
  377. AC_HEADER_DIRENT
  378. AC_HEADER_STDC
  379. AC_CHECK_HEADERS([fcntl.h])
  380. AC_CHECK_HEADERS([unistd.h])
  381. AC_CHECK_HEADERS([ctype.h])
  382. AC_CHECK_HEADERS([dirent.h])
  383. AC_CHECK_HEADERS([errno.h])
  384. AC_CHECK_HEADERS([malloc.h])
  385. AC_CHECK_HEADERS([stdarg.h])
  386. AC_CHECK_HEADERS([sys/stat.h])
  387. AC_CHECK_HEADERS([sys/types.h])
  388. AC_CHECK_HEADERS([stdint.h])
  389. AC_CHECK_HEADERS([inttypes.h.h])
  390. AC_CHECK_HEADERS([time.h])
  391. AC_CHECK_HEADERS([ansidecl.h])
  392. AC_CHECK_HEADERS([ieeefp.h])
  393. AC_CHECK_HEADERS([nan.h])
  394. AC_CHECK_HEADERS([math.h])
  395. AC_CHECK_HEADERS([limits.h])
  396. AC_CHECK_HEADERS([fp_class.h])
  397. AC_CHECK_HEADERS([float.h])
  398. AC_CHECK_HEADERS([stdlib.h])
  399. AC_CHECK_HEADERS([sys/socket.h], [], [],
  400. [#if HAVE_SYS_TYPES_H
  401. # include <sys/types.h>
  402. # endif
  403. ])
  404. AC_CHECK_HEADERS([netinet/in.h], [], [],
  405. [#if HAVE_SYS_TYPES_H
  406. # include <sys/types.h>
  407. # endif
  408. ])
  409. AC_CHECK_HEADERS([arpa/inet.h], [], [],
  410. [#if HAVE_SYS_TYPES_H
  411. # include <sys/types.h>
  412. # endif
  413. #if HAVE_ARPA_INET_H
  414. # include <arpa/inet.h>
  415. # endif
  416. ])
  417. AC_CHECK_HEADERS([netdb.h])
  418. AC_CHECK_HEADERS([sys/time.h])
  419. AC_CHECK_HEADERS([sys/select.h])
  420. AC_CHECK_HEADERS([poll.h])
  421. AC_CHECK_HEADERS([sys/mman.h])
  422. AC_CHECK_HEADERS([sys/timeb.h])
  423. AC_CHECK_HEADERS([signal.h])
  424. AC_CHECK_HEADERS([arpa/nameser.h], [], [],
  425. [#if HAVE_SYS_TYPES_H
  426. # include <sys/types.h>
  427. # endif
  428. ])
  429. AC_CHECK_HEADERS([resolv.h], [], [],
  430. [#if HAVE_SYS_TYPES_H
  431. # include <sys/types.h>
  432. # endif
  433. #if HAVE_NETINET_IN_H
  434. # include <netinet/in.h>
  435. # endif
  436. #if HAVE_ARPA_NAMESER_H
  437. # include <arpa/nameser.h>
  438. # endif
  439. ])
  440. AC_CHECK_HEADERS([dl.h])
  441. AC_CHECK_HEADERS([dlfcn.h])
  442. echo Checking libraries
  443. dnl Checks for library functions.
  444. AC_FUNC_STRFTIME
  445. AC_CHECK_FUNCS(strdup strndup strerror)
  446. AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
  447. AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
  448. AC_CHECK_FUNCS(stat _stat signal)
  449. dnl Checking the standard string functions availability
  450. AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
  451. NEED_TRIO=1)
  452. dnl Checking for va_copy availability
  453. AC_MSG_CHECKING([for va_copy])
  454. AC_TRY_LINK([#include <stdarg.h>
  455. va_list ap1,ap2;], [va_copy(ap1,ap2);],
  456. have_va_copy=yes,
  457. have_va_copy=no)
  458. AC_MSG_RESULT($have_va_copy)
  459. if test x"$have_va_copy" = x"yes"; then
  460. AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
  461. else
  462. AC_MSG_CHECKING([for __va_copy])
  463. AC_TRY_LINK([#include <stdarg.h>
  464. va_list ap1,ap2;], [__va_copy(ap1,ap2);],
  465. have___va_copy=yes,
  466. have___va_copy=no)
  467. AC_MSG_RESULT($have___va_copy)
  468. if test x"$have___va_copy" = x"yes"; then
  469. AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
  470. fi
  471. fi
  472. dnl Checks for inet libraries:
  473. AC_SEARCH_LIBS(gethostent, [nsl])
  474. AC_SEARCH_LIBS(setsockopt, [socket net network])
  475. AC_SEARCH_LIBS(connect, [inet])
  476. dnl Determine what socket length (socklen_t) data type is
  477. AC_MSG_CHECKING([for type of socket length (socklen_t)])
  478. AC_TRY_COMPILE2([
  479. #include <stddef.h>
  480. #include <sys/types.h>
  481. #include <sys/socket.h>],[
  482. (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
  483. AC_MSG_RESULT(socklen_t *)
  484. XML_SOCKLEN_T=socklen_t],[
  485. AC_TRY_COMPILE2([
  486. #include <stddef.h>
  487. #include <sys/types.h>
  488. #include <sys/socket.h>],[
  489. (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
  490. AC_MSG_RESULT(size_t *)
  491. XML_SOCKLEN_T=size_t],[
  492. AC_TRY_COMPILE2([
  493. #include <stddef.h>
  494. #include <sys/types.h>
  495. #include <sys/socket.h>],[
  496. (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
  497. AC_MSG_RESULT(int *)
  498. XML_SOCKLEN_T=int],[
  499. AC_MSG_WARN(could not determine)
  500. XML_SOCKLEN_T="int"])])])
  501. AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
  502. dnl ***********************Checking for availability of IPv6*******************
  503. AC_MSG_CHECKING([whether to enable IPv6])
  504. AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
  505. if test "$with_minimum" = "yes"
  506. then
  507. enable_ipv6=no
  508. fi
  509. if test $enable_ipv6 = yes; then
  510. have_ipv6=no
  511. AC_TRY_COMPILE([
  512. #include <sys/types.h>
  513. #include <sys/socket.h>
  514. ], [
  515. struct sockaddr_storage ss;
  516. socket(AF_INET6, SOCK_STREAM, 0)
  517. ],
  518. have_ipv6=yes,
  519. have_ipv6=no
  520. )
  521. AC_MSG_RESULT($have_ipv6)
  522. if test $have_ipv6 = yes; then
  523. AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
  524. have_broken_ss_family=no
  525. dnl *********************************************************************
  526. dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
  527. dnl a ss_family member, but rather __ss_family. Let's detect that
  528. dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
  529. dnl platforms. However, we should only do this if ss_family is not
  530. dnl present.
  531. dnl ********************************************************************
  532. AC_MSG_CHECKING([struct sockaddr::ss_family])
  533. AC_TRY_COMPILE([
  534. #include <sys/types.h>
  535. #include <sys/socket.h>
  536. ], [
  537. struct sockaddr_storage ss ;
  538. ss.ss_family = 0 ;
  539. ],
  540. have_ss_family=yes,
  541. have_ss_family=no
  542. )
  543. AC_MSG_RESULT($have_ss_family)
  544. if test x$have_ss_family = xno ; then
  545. AC_MSG_CHECKING([broken struct sockaddr::ss_family])
  546. AC_TRY_COMPILE([
  547. #include <sys/types.h>
  548. #include <sys/socket.h>
  549. ], [
  550. struct sockaddr_storage ss ;
  551. ss.__ss_family = 0 ;
  552. ],
  553. have_broken_ss_family=yes,
  554. have_broken_ss_family=no
  555. )
  556. AC_MSG_RESULT($have_broken_ss_family)
  557. if test x$have_broken_ss_family = xyes ; then
  558. AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
  559. [Whether struct sockaddr::__ss_family exists])
  560. AC_DEFINE(ss_family, __ss_family,
  561. [ss_family is not defined here, use __ss_family instead])
  562. else
  563. AC_MSG_WARN(ss_family and __ss_family not found)
  564. fi
  565. fi
  566. have_getaddrinfo=no
  567. AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
  568. if test $have_getaddrinfo != yes; then
  569. for lib in bsd socket inet; do
  570. AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
  571. done
  572. fi
  573. if test $have_getaddrinfo = yes; then
  574. AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
  575. fi
  576. fi
  577. fi
  578. dnl ******************************End IPv6 checks******************************
  579. dnl Checks for isnan in libm if not in libc
  580. AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
  581. [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
  582. AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
  583. [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
  584. XML_LIBDIR='-L${libdir}'
  585. XML_INCLUDEDIR='-I${includedir}/libxml2'
  586. dnl
  587. dnl Extra flags
  588. dnl
  589. XML_CFLAGS=""
  590. RDL_LIBS=""
  591. dnl
  592. dnl Workaround for native compilers
  593. dnl HP : http://bugs.gnome.org/db/31/3163.html
  594. dnl DEC : Enable NaN/Inf
  595. dnl
  596. if test "${GCC}" != "yes" ; then
  597. case "${host}" in
  598. hppa*-*-hpux* )
  599. CFLAGS="${CFLAGS} -Wp,-H30000"
  600. ;;
  601. *-dec-osf* )
  602. CFLAGS="${CFLAGS} -ieee"
  603. ;;
  604. alpha*-*-linux* )
  605. CFLAGS="${CFLAGS} -ieee"
  606. ;;
  607. esac
  608. else
  609. if test "$with_fexceptions" = "yes"
  610. then
  611. #
  612. # Not activated by default because this inflates the code size
  613. # Used to allow propagation of C++ exceptions through the library
  614. #
  615. CFLAGS="${CFLAGS} -fexceptions"
  616. fi
  617. CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
  618. case "${host}" in
  619. alpha*-*-linux* )
  620. CFLAGS="${CFLAGS} -mieee"
  621. ;;
  622. alpha*-*-osf* )
  623. CFLAGS="${CFLAGS} -mieee"
  624. ;;
  625. esac
  626. fi
  627. case ${host} in
  628. *-*-solaris*)
  629. XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
  630. ;;
  631. hppa*-hp-mpeix)
  632. NEED_TRIO=1
  633. ;;
  634. *-*-mingw* | *-*-cygwin* | *-*-msvc* )
  635. # If the host is Windows, and shared libraries are disabled, we
  636. # need to add -DLIBXML_STATIC to CFLAGS in order for linking to
  637. # work properly (without it, xmlexports.h would force the use of
  638. # DLL imports, which obviously aren't present in a static
  639. # library).
  640. if test "x$enable_shared" = "xno"; then
  641. XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
  642. CFLAGS="$CFLAGS -DLIBXML_STATIC"
  643. fi
  644. ;;
  645. esac
  646. dnl
  647. dnl check for python
  648. dnl
  649. PYTHON_VERSION=
  650. PYTHON_INCLUDES=
  651. PYTHON_SITE_PACKAGES=
  652. PYTHON_TESTS=
  653. pythondir=
  654. if test "$with_python" != "no" ; then
  655. if test -x "$with_python/bin/python"
  656. then
  657. echo Found python in $with_python/bin/python
  658. PYTHON="$with_python/bin/python"
  659. else
  660. if test -x "$with_python"
  661. then
  662. echo Found python in $with_python
  663. PYTHON="$with_python"
  664. else
  665. if test -x "$PYTHON"
  666. then
  667. echo Found python in environment PYTHON=$PYTHON
  668. with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
  669. else
  670. AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
  671. fi
  672. fi
  673. fi
  674. if test "$PYTHON" != ""
  675. then
  676. PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
  677. echo Found Python version $PYTHON_VERSION
  678. fi
  679. if test "$PYTHON_VERSION" != ""
  680. then
  681. if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
  682. -d $with_python/lib/python$PYTHON_VERSION/site-packages
  683. then
  684. PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
  685. PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
  686. else
  687. if test -r $prefix/include/python$PYTHON_VERSION/Python.h
  688. then
  689. PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
  690. PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
  691. else
  692. if test -r /usr/include/python$PYTHON_VERSION/Python.h
  693. then
  694. PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
  695. PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
  696. else
  697. echo could not find python$PYTHON_VERSION/Python.h
  698. fi
  699. fi
  700. if test ! -d "$PYTHON_SITE_PACKAGES"
  701. then
  702. PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
  703. fi
  704. fi
  705. PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`
  706. fi
  707. if test "$with_python" != ""
  708. then
  709. pythondir='$(PYTHON_SITE_PACKAGES)'
  710. else
  711. pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
  712. fi
  713. else
  714. PYTHON=
  715. fi
  716. AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
  717. if test "$PYTHON_INCLUDES" != ""
  718. then
  719. PYTHON_SUBDIR=python
  720. else
  721. PYTHON_SUBDIR=
  722. fi
  723. AC_SUBST(pythondir)
  724. AC_SUBST(PYTHON_SUBDIR)
  725. AC_SUBST(PYTHON_LIBS)
  726. dnl check for dso support
  727. WITH_MODULES=0
  728. TEST_MODULES=
  729. if test "$with_modules" != "no" ; then
  730. case "$host" in
  731. *-*-cygwin*)
  732. MODULE_EXTENSION=".dll"
  733. AC_CHECK_LIB(cygwin, dlopen, [
  734. WITH_MODULES=1
  735. MODULE_PLATFORM_LIBS=
  736. AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
  737. ])
  738. ;;
  739. *-*-mingw*)
  740. MODULE_EXTENSION=".dll"
  741. WITH_MODULES=1
  742. ;;
  743. *)
  744. AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
  745. AC_CHECK_LIB(dld, shl_load, [
  746. MODULE_PLATFORM_LIBS="-ldld"
  747. libxml_have_shl_load=yes], [
  748. AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
  749. AC_CHECK_LIB(dl, dlopen, [
  750. MODULE_PLATFORM_LIBS="-ldl"
  751. libxml_have_dlopen=yes])])])])
  752. if test "${libxml_have_shl_load}" = "yes"; then
  753. MODULE_EXTENSION=".sl"
  754. WITH_MODULES=1
  755. AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
  756. fi
  757. if test "${libxml_have_dlopen}" = "yes"; then
  758. case "${host}" in
  759. *-*-hpux* )
  760. MODULE_EXTENSION=".sl"
  761. ;;
  762. * )
  763. MODULE_EXTENSION=".so"
  764. ;;
  765. esac
  766. WITH_MODULES=1
  767. AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
  768. fi
  769. ;;
  770. esac
  771. fi
  772. if test "${WITH_MODULES}" = "1"; then
  773. TEST_MODULES="ModuleTests"
  774. fi
  775. AC_SUBST(WITH_MODULES)
  776. AC_SUBST(MODULE_PLATFORM_LIBS)
  777. AC_SUBST(MODULE_EXTENSION)
  778. AC_SUBST(TEST_MODULES)
  779. dnl
  780. dnl Tester makes use of readline if present
  781. dnl
  782. dnl
  783. dnl specific tests to setup DV and Bill's devel environments with debug etc ...
  784. dnl (-Wunreachable-code)
  785. dnl
  786. if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
  787. [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
  788. [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]]
  789. then
  790. if test "$with_minimum" != "yes"
  791. then
  792. if test "${with_mem_debug}" = "" ; then
  793. echo Activating memory debugging
  794. with_mem_debug="yes"
  795. with_run_debug="yes"
  796. fi
  797. if test "${with_docbook}" = "" ; then
  798. with_docbook="yes"
  799. fi
  800. fi
  801. if test "${GCC}" = "yes" ; then
  802. CFLAGS="-g -O -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
  803. fi
  804. STATIC_BINARIES="-static"
  805. dnl -Wcast-qual -ansi
  806. else
  807. STATIC_BINARIES=
  808. fi
  809. AC_SUBST(STATIC_BINARIES)
  810. dnl
  811. dnl Check for trio string functions
  812. dnl
  813. if test "${NEED_TRIO}" = "1" ; then
  814. echo Adding trio library for string functions
  815. WITH_TRIO=1
  816. else
  817. WITH_TRIO=0
  818. fi
  819. AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1")
  820. AC_SUBST(WITH_TRIO)
  821. dnl
  822. dnl Allow to enable/disable various pieces
  823. dnl
  824. echo Checking configuration requirements
  825. dnl
  826. dnl Thread-related stuff
  827. dnl
  828. THREAD_LIBS=""
  829. BASE_THREAD_LIBS=""
  830. WITH_THREADS=0
  831. THREAD_CFLAGS=""
  832. TEST_THREADS=""
  833. THREADS_W32=""
  834. if test "$with_threads" = "no" ; then
  835. echo Disabling multithreaded support
  836. else
  837. echo Enabling multithreaded support
  838. dnl Use pthread by default
  839. if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then
  840. AC_CHECK_HEADER(pthread.h,
  841. AC_CHECK_LIB(pthread, pthread_join,[
  842. THREAD_LIBS="-lpthread"
  843. AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
  844. AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
  845. WITH_THREADS="1"]))
  846. fi
  847. case $host_os in
  848. *mingw32*) if test "$THREAD_LIBS" != "-lpthread"; then
  849. WITH_THREADS="1"
  850. THREADS_W32="Win32"
  851. THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
  852. fi
  853. ;;
  854. *cygwin*) THREAD_LIBS=""
  855. ;;
  856. *beos*) WITH_THREADS="1"
  857. THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
  858. ;;
  859. *linux*)
  860. if test "${GCC}" = "yes" ; then
  861. GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
  862. GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'`
  863. GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'`
  864. if test "${THREAD_LIBS}" = "-lpthread" ; then
  865. if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null
  866. then
  867. THREAD_LIBS=""
  868. BASE_THREAD_LIBS="-lpthread"
  869. else
  870. if expr ${GCC_MAJOR} \> 3 > /dev/null
  871. then
  872. THREAD_LIBS=""
  873. BASE_THREAD_LIBS="-lpthread"
  874. else
  875. echo old GCC disabling weak symbols for pthread
  876. fi
  877. fi
  878. fi
  879. fi
  880. ;;
  881. esac
  882. if test "$WITH_THREADS" = "1" ; then
  883. THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
  884. TEST_THREADS="Threadtests"
  885. fi
  886. fi
  887. if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
  888. THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
  889. fi
  890. AC_SUBST(THREAD_LIBS)
  891. AC_SUBST(BASE_THREAD_LIBS)
  892. AC_SUBST(WITH_THREADS)
  893. AC_SUBST(THREAD_CFLAGS)
  894. AC_SUBST(TEST_THREADS)
  895. AC_SUBST(THREADS_W32)
  896. dnl
  897. dnl xmllint shell history
  898. dnl
  899. if test "$with_history" = "yes" ; then
  900. echo Enabling xmllint shell history
  901. dnl check for terminal library. this is a very cool solution
  902. dnl from octave's configure.in
  903. unset tcap
  904. for termlib in ncurses curses termcap terminfo termlib; do
  905. AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
  906. test -n "$tcap" && break
  907. done
  908. AC_CHECK_HEADER(readline/history.h,
  909. AC_CHECK_LIB(history, append_history,[
  910. RDL_LIBS="-lhistory"
  911. AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
  912. AC_CHECK_HEADER(readline/readline.h,
  913. AC_CHECK_LIB(readline, readline,[
  914. RDL_LIBS="-lreadline $RDL_LIBS $tcap"
  915. AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
  916. if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
  917. CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
  918. RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
  919. fi
  920. fi
  921. dnl
  922. dnl Tree functions
  923. dnl
  924. if test "$with_tree" = "no" ; then
  925. echo Disabling DOM like tree manipulation APIs
  926. WITH_TREE=0
  927. else
  928. WITH_TREE=1
  929. fi
  930. AC_SUBST(WITH_TREE)
  931. if test "$with_ftp" = "no" ; then
  932. echo Disabling FTP support
  933. WITH_FTP=0
  934. FTP_OBJ=
  935. else
  936. WITH_FTP=1
  937. FTP_OBJ=nanoftp.o
  938. fi
  939. AC_SUBST(WITH_FTP)
  940. AC_SUBST(FTP_OBJ)
  941. if test "$with_http" = "no" ; then
  942. echo Disabling HTTP support
  943. WITH_HTTP=0
  944. HTTP_OBJ=
  945. else
  946. WITH_HTTP=1
  947. HTTP_OBJ=nanohttp.o
  948. fi
  949. AC_SUBST(WITH_HTTP)
  950. AC_SUBST(HTTP_OBJ)
  951. if test "$with_legacy" = "no" ; then
  952. echo Disabling deprecated APIs
  953. WITH_LEGACY=0
  954. else
  955. WITH_LEGACY=1
  956. fi
  957. AC_SUBST(WITH_LEGACY)
  958. if test "$with_reader" = "no" ; then
  959. echo Disabling the xmlReader parsing interface
  960. WITH_READER=0
  961. READER_TEST=
  962. else
  963. WITH_READER=1
  964. READER_TEST=Readertests
  965. if test "$with_push" = "no" ; then
  966. echo xmlReader requires Push interface - enabling it
  967. with_push=yes
  968. fi
  969. fi
  970. AC_SUBST(WITH_READER)
  971. AC_SUBST(READER_TEST)
  972. if test "$with_writer" = "no" ; then
  973. echo Disabling the xmlWriter saving interface
  974. WITH_WRITER=0
  975. # WRITER_TEST=
  976. else
  977. WITH_WRITER=1
  978. # WRITER_TEST=Writertests
  979. if test "$with_push" = "no" ; then
  980. echo xmlWriter requires Push interface - enabling it
  981. with_push=yes
  982. fi
  983. if test "$with_output" = "no" ; then
  984. echo xmlWriter requires Output interface - enabling it
  985. with_output=yes
  986. fi
  987. fi
  988. AC_SUBST(WITH_WRITER)
  989. #AC_SUBST(WRITER_TEST)
  990. if test "$with_pattern" = "no" ; then
  991. echo Disabling the xmlPattern parsing interface
  992. WITH_PATTERN=0
  993. TEST_PATTERN=
  994. else
  995. WITH_PATTERN=1
  996. TEST_PATTERN=Patterntests
  997. fi
  998. AC_SUBST(WITH_PATTERN)
  999. AC_SUBST(TEST_PATTERN)
  1000. if test "$with_sax1" = "no" ; then
  1001. echo Disabling the older SAX1 interface
  1002. WITH_SAX1=0
  1003. TEST_SAX=
  1004. else
  1005. WITH_SAX1=1
  1006. TEST_SAX=SAXtests
  1007. fi
  1008. AC_SUBST(WITH_SAX1)
  1009. AC_SUBST(TEST_SAX)
  1010. if test "$with_push" = "no" ; then
  1011. echo Disabling the PUSH parser interfaces
  1012. WITH_PUSH=0
  1013. TEST_PUSH=
  1014. else
  1015. WITH_PUSH=1
  1016. TEST_PUSH="XMLPushtests"
  1017. fi
  1018. AC_SUBST(WITH_PUSH)
  1019. AC_SUBST(TEST_PUSH)
  1020. if test "$with_html" = "no" ; then
  1021. echo Disabling HTML support
  1022. WITH_HTML=0
  1023. HTML_OBJ=
  1024. TEST_HTML=
  1025. else
  1026. WITH_HTML=1
  1027. HTML_OBJ="HTMLparser.o HTMLtree.o"
  1028. TEST_HTML=HTMLtests
  1029. if test "$with_push" != "no" ; then
  1030. TEST_PHTML=HTMLPushtests
  1031. else
  1032. TEST_PHTML=
  1033. fi
  1034. fi
  1035. AC_SUBST(WITH_HTML)
  1036. AC_SUBST(HTML_OBJ)
  1037. AC_SUBST(TEST_HTML)
  1038. AC_SUBST(TEST_PHTML)
  1039. if test "$with_valid" = "no" ; then
  1040. echo Disabling DTD validation support
  1041. WITH_VALID=0
  1042. TEST_VALID=
  1043. TEST_VTIME=
  1044. else
  1045. WITH_VALID=1
  1046. TEST_VALID=Validtests
  1047. TEST_VTIME=VTimingtests
  1048. fi
  1049. AC_SUBST(WITH_VALID)
  1050. AC_SUBST(TEST_VALID)
  1051. AC_SUBST(TEST_VTIME)
  1052. if test "$with_catalog" = "no" ; then
  1053. echo Disabling Catalog support
  1054. WITH_CATALOG=0
  1055. CATALOG_OBJ=
  1056. TEST_CATALOG=
  1057. else
  1058. WITH_CATALOG=1
  1059. CATALOG_OBJ="catalog.o"
  1060. TEST_CATALOG=Catatests
  1061. fi
  1062. AC_SUBST(WITH_CATALOG)
  1063. AC_SUBST(CATALOG_OBJ)
  1064. AC_SUBST(TEST_CATALOG)
  1065. if test "$with_docbook" = "no" ; then
  1066. echo Disabling Docbook support
  1067. WITH_DOCB=0
  1068. DOCB_OBJ=
  1069. else
  1070. WITH_DOCB=1
  1071. DOCB_OBJ="DOCBparser.o"
  1072. fi
  1073. AC_SUBST(WITH_DOCB)
  1074. AC_SUBST(DOCB_OBJ)
  1075. if test "$with_xptr" = "no" ; then
  1076. echo Disabling XPointer support
  1077. WITH_XPTR=0
  1078. XPTR_OBJ=
  1079. TEST_XPTR=
  1080. else
  1081. WITH_XPTR=1
  1082. XPTR_OBJ=xpointer.o
  1083. TEST_XPTR=XPtrtests
  1084. if test "$with_xpath" = "no" ; then
  1085. echo XPointer requires XPath support - enabling it
  1086. with_xpath=yes
  1087. fi
  1088. fi
  1089. AC_SUBST(WITH_XPTR)
  1090. AC_SUBST(XPTR_OBJ)
  1091. AC_SUBST(TEST_XPTR)
  1092. if test "$with_c14n" = "no" ; then
  1093. echo Disabling C14N support
  1094. WITH_C14N=0
  1095. C14N_OBJ=
  1096. TEST_C14N=
  1097. else
  1098. WITH_C14N=1
  1099. C14N_OBJ="c14n.c"
  1100. TEST_C14N=C14Ntests
  1101. if test "$with_xpath" = "no" ; then
  1102. echo C14N requires XPath support - enabling it
  1103. with_xpath=yes
  1104. fi
  1105. fi
  1106. AC_SUBST(WITH_C14N)
  1107. AC_SUBST(C14N_OBJ)
  1108. AC_SUBST(TEST_C14N)
  1109. if test "$with_xinclude" = "no" ; then
  1110. echo Disabling XInclude support
  1111. WITH_XINCLUDE=0
  1112. XINCLUDE_OBJ=
  1113. with_xinclude="no"
  1114. TEST_XINCLUDE=
  1115. else
  1116. WITH_XINCLUDE=1
  1117. XINCLUDE_OBJ=xinclude.o
  1118. TEST_XINCLUDE=XIncludetests
  1119. if test "$with_xpath" = "no" ; then
  1120. echo XInclude requires XPath support - enabling it
  1121. with_xpath=yes
  1122. fi
  1123. fi
  1124. AC_SUBST(WITH_XINCLUDE)
  1125. AC_SUBST(XINCLUDE_OBJ)
  1126. AC_SUBST(TEST_XINCLUDE)
  1127. if test "$with_xpath" = "no" ; then
  1128. echo Disabling XPATH support
  1129. WITH_XPATH=0
  1130. XPATH_OBJ=
  1131. TEST_XPATH=
  1132. else
  1133. WITH_XPATH=1
  1134. XPATH_OBJ=xpath.o
  1135. TEST_XPATH=XPathtests
  1136. fi
  1137. AC_SUBST(WITH_XPATH)
  1138. AC_SUBST(XPATH_OBJ)
  1139. AC_SUBST(TEST_XPATH)
  1140. dnl
  1141. dnl output functions
  1142. dnl
  1143. if test "$with_output" = "no" ; then
  1144. echo Disabling serialization/saving support
  1145. WITH_OUTPUT=0
  1146. else
  1147. WITH_OUTPUT=1
  1148. fi
  1149. AC_SUBST(WITH_OUTPUT)
  1150. WITH_ICONV=0
  1151. if test "$with_iconv" = "no" ; then
  1152. echo Disabling ICONV support
  1153. else
  1154. if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
  1155. CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
  1156. # Export this since our headers include iconv.h
  1157. XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
  1158. ICONV_LIBS="-L$with_iconv/lib"
  1159. fi
  1160. AC_CHECK_HEADER(iconv.h,
  1161. AC_MSG_CHECKING(for iconv)
  1162. AC_TRY_LINK([#include <stdlib.h>
  1163. #include <iconv.h>],[
  1164. iconv_t cd = iconv_open ("","");
  1165. iconv (cd, NULL, NULL, NULL, NULL);],[
  1166. AC_MSG_RESULT(yes)
  1167. WITH_ICONV=1],[
  1168. AC_MSG_RESULT(no)
  1169. AC_MSG_CHECKING(for iconv in -liconv)
  1170. _ldflags="${LDFLAGS}"
  1171. _libs="${LIBS}"
  1172. LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
  1173. LIBS="${LIBS} -liconv"
  1174. AC_TRY_LINK([#include <stdlib.h>
  1175. #include <iconv.h>],[
  1176. iconv_t cd = iconv_open ("","");
  1177. iconv (cd, NULL, NULL, NULL, NULL);],[
  1178. AC_MSG_RESULT(yes)
  1179. WITH_ICONV=1
  1180. ICONV_LIBS="${ICONV_LIBS} -liconv"
  1181. LIBS="${_libs}"
  1182. LDFLAGS="${_ldflags}"],[
  1183. AC_MSG_RESULT(no)
  1184. LIBS="${_libs}"
  1185. LDFLAGS="${_ldflags}"])]))
  1186. if test "$WITH_ICONV" = "1" ; then
  1187. AC_MSG_CHECKING([for iconv declaration])
  1188. AC_CACHE_VAL(xml_cv_iconv_arg2, [
  1189. AC_TRY_COMPILE([#include <stdlib.h>
  1190. #include <iconv.h>
  1191. extern
  1192. #ifdef __cplusplus
  1193. "C"
  1194. #endif
  1195. #if defined(__STDC__) || defined(__cplusplus)
  1196. size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
  1197. #else
  1198. size_t iconv();
  1199. #endif
  1200. ], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
  1201. xml_cv_iconv_decl="extern size_t iconv (iconv_t cd, $xml_cv_iconv_arg2 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
  1202. AC_MSG_RESULT([${xml_xxx:-
  1203. }$xml_cv_iconv_decl])
  1204. AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2,
  1205. [Define as const if the declaration of iconv() needs const.])
  1206. fi
  1207. fi
  1208. case "$host" in
  1209. *mingw*) M_LIBS=""
  1210. ;;
  1211. *beos*) M_LIBS=""
  1212. ;;
  1213. *haiku*) M_LIBS=""
  1214. ;;
  1215. *) M_LIBS="-lm"
  1216. ;;
  1217. esac
  1218. XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
  1219. XML_LIBTOOLLIBS="libxml2.la"
  1220. AC_SUBST(WITH_ICONV)
  1221. WITH_ISO8859X=1
  1222. if test "$WITH_ICONV" != "1" ; then
  1223. if test "$with_iso8859x" = "no" ; then
  1224. echo Disabling ISO8859X support
  1225. WITH_ISO8859X=0
  1226. fi
  1227. fi
  1228. AC_SUBST(WITH_ISO8859X)
  1229. if test "$with_schematron" = "no" ; then
  1230. echo "Disabling Schematron support"
  1231. WITH_SCHEMATRON=0
  1232. TEST_SCHEMATRON=
  1233. else
  1234. echo "Enabled Schematron support"
  1235. WITH_SCHEMATRON=1
  1236. TEST_SCHEMATRON="Schematrontests"
  1237. with_xpath=yes
  1238. with_pattern=yes
  1239. fi
  1240. AC_SUBST(WITH_SCHEMATRON)
  1241. AC_SUBST(TEST_SCHEMATRON)
  1242. if test "$with_schemas" = "no" ; then
  1243. echo "Disabling Schemas/Relax-NG support"
  1244. WITH_SCHEMAS=0
  1245. TEST_SCHEMAS=
  1246. else
  1247. echo "Enabled Schemas/Relax-NG support"
  1248. WITH_SCHEMAS=1
  1249. TEST_SCHEMAS="Schemastests Relaxtests"
  1250. if test "$PYTHON_INCLUDES" != "" ; then
  1251. PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
  1252. fi
  1253. with_regexps=yes
  1254. fi
  1255. AC_SUBST(WITH_SCHEMAS)
  1256. AC_SUBST(TEST_SCHEMAS)
  1257. if test "$with_regexps" = "no" ; then
  1258. echo Disabling Regexps support
  1259. WITH_REGEXPS=0
  1260. TEST_REGEXPS=
  1261. else
  1262. WITH_REGEXPS=1
  1263. TEST_REGEXPS="Regexptests Automatatests"
  1264. fi
  1265. AC_SUBST(WITH_REGEXPS)
  1266. AC_SUBST(TEST_REGEXPS)
  1267. if test "$with_debug" = "no" ; then
  1268. echo Disabling DEBUG support
  1269. WITH_DEBUG=0
  1270. DEBUG_OBJ=
  1271. TEST_DEBUG=
  1272. else
  1273. WITH_DEBUG=1
  1274. DEBUG_OBJ=debugXML.o
  1275. TEST_DEBUG=Scripttests
  1276. fi
  1277. AC_SUBST(WITH_DEBUG)
  1278. AC_SUBST(DEBUG_OBJ)
  1279. AC_SUBST(TEST_DEBUG)
  1280. if test "$with_mem_debug" = "yes" ; then
  1281. if test "$with_thread_alloc" = "yes" ; then
  1282. echo Disabling memory debug - cannot use mem-debug with thread-alloc!
  1283. WITH_MEM_DEBUG=0
  1284. else
  1285. echo Enabling memory debug support
  1286. WITH_MEM_DEBUG=1
  1287. fi
  1288. else
  1289. WITH_MEM_DEBUG=0
  1290. fi
  1291. AC_SUBST(WITH_MEM_DEBUG)
  1292. if test "$with_run_debug" = "yes" ; then
  1293. echo Enabling runtime debug support
  1294. WITH_RUN_DEBUG=1
  1295. else
  1296. WITH_RUN_DEBUG=0
  1297. fi
  1298. AC_SUBST(WITH_RUN_DEBUG)
  1299. WIN32_EXTRA_LIBADD=
  1300. WIN32_EXTRA_LDFLAGS=
  1301. CYGWIN_EXTRA_LDFLAGS=
  1302. CYGWIN_EXTRA_PYTHON_LIBADD=
  1303. case "$host" in
  1304. *-*-mingw*)
  1305. CPPFLAGS="$CPPFLAGS -DWIN32"
  1306. WIN32_EXTRA_LIBADD="-lws2_32"
  1307. WIN32_EXTRA_LDFLAGS="-no-undefined"
  1308. AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
  1309. AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
  1310. AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
  1311. ;;
  1312. *-*-cygwin*)
  1313. CYGWIN_EXTRA_LDFLAGS="-no-undefined"
  1314. if test "${PYTHON}" != ""
  1315. then
  1316. CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
  1317. fi
  1318. ;;
  1319. esac
  1320. AC_SUBST(WIN32_EXTRA_LIBADD)
  1321. AC_SUBST(WIN32_EXTRA_LDFLAGS)
  1322. AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
  1323. AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
  1324. if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
  1325. then
  1326. echo Enabling code coverage for GCC
  1327. CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
  1328. LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
  1329. else
  1330. echo Disabling code coverage for GCC
  1331. fi
  1332. AC_SUBST(CPPFLAGS)
  1333. AC_SUBST(CFLAGS)
  1334. AC_SUBST(LDFLAGS)
  1335. AC_SUBST(XML_CFLAGS)
  1336. AC_SUBST(XML_LIBDIR)
  1337. AC_SUBST(XML_LIBS)
  1338. AC_SUBST(XML_LIBTOOLLIBS)
  1339. AC_SUBST(ICONV_LIBS)
  1340. AC_SUBST(XML_INCLUDEDIR)
  1341. AC_SUBST(HTML_DIR)
  1342. AC_SUBST(HAVE_ISNAN)
  1343. AC_SUBST(HAVE_ISINF)
  1344. AC_SUBST(PYTHON)
  1345. AC_SUBST(PYTHON_VERSION)
  1346. AC_SUBST(PYTHON_INCLUDES)
  1347. AC_SUBST(PYTHON_SITE_PACKAGES)
  1348. AC_SUBST(M_LIBS)
  1349. AC_SUBST(RDL_LIBS)
  1350. dnl for the spec file
  1351. RELDATE=`date +'%a %b %e %Y'`
  1352. AC_SUBST(RELDATE)
  1353. AC_SUBST(PYTHON_TESTS)
  1354. rm -f COPYING.LIB COPYING
  1355. ln -s Copyright COPYING
  1356. # keep on one line for cygwin c.f. #130896
  1357. AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py)
  1358. chmod +x xml2-config python/setup.py
  1359. echo Done configuring