1 AC_INIT(libxslt/xslt.c)
4 dnl libxslt is the main part of the package
5 dnl libexslt is an extension
7 LIBXSLT_MAJOR_VERSION=1
8 LIBXSLT_MINOR_VERSION=0
9 LIBXSLT_MICRO_VERSION=13
11 LIBEXSLT_MAJOR_VERSION=0
12 LIBEXSLT_MINOR_VERSION=7
13 LIBEXSLT_MICRO_VERSION=5
14 LIBXML_REQUIRED_VERSION=2.4.17
17 LIBXSLT_VERSION=$LIBXSLT_MAJOR_VERSION.$LIBXSLT_MINOR_VERSION.$LIBXSLT_MICRO_VERSION
18 LIBXSLT_VERSION_INFO=`expr $LIBXSLT_MAJOR_VERSION + $LIBXSLT_MINOR_VERSION`:$LIBXSLT_MICRO_VERSION:$LIBXSLT_MINOR_VERSION
20 LIBXSLT_VERSION_NUMBER=`expr $LIBXSLT_MAJOR_VERSION \* 10000 + $LIBXSLT_MINOR_VERSION \* 100 + $LIBXSLT_MICRO_VERSION`
22 AC_SUBST(LIBXSLT_MAJOR_VERSION)
23 AC_SUBST(LIBXSLT_MINOR_VERSION)
24 AC_SUBST(LIBXSLT_MICRO_VERSION)
25 AC_SUBST(LIBXSLT_VERSION)
26 AC_SUBST(LIBXSLT_VERSION_INFO)
27 AC_SUBST(LIBXSLT_VERSION_NUMBER)
30 dnl libexslt is an extension library
33 LIBEXSLT_VERSION=$LIBEXSLT_MAJOR_VERSION.$LIBEXSLT_MINOR_VERSION.$LIBEXSLT_MICRO_VERSION
34 LIBEXSLT_VERSION_INFO=`expr $LIBEXSLT_MAJOR_VERSION + $LIBEXSLT_MINOR_VERSION`:$LIBEXSLT_MICRO_VERSION:$LIBEXSLT_MINOR_VERSION
36 LIBEXSLT_VERSION_NUMBER=`expr $LIBEXSLT_MAJOR_VERSION \* 10000 + $LIBEXSLT_MINOR_VERSION \* 100 + $LIBEXSLT_MICRO_VERSION`
38 AC_SUBST(LIBEXSLT_MAJOR_VERSION)
39 AC_SUBST(LIBEXSLT_MINOR_VERSION)
40 AC_SUBST(LIBEXSLT_MICRO_VERSION)
41 AC_SUBST(LIBEXSLT_VERSION)
42 AC_SUBST(LIBEXSLT_VERSION_INFO)
43 AC_SUBST(LIBEXSLT_VERSION_NUMBER)
46 dnl libxsltbreakpoint is a compatibility obsoleted library
47 dnl it's blocked at 1.0.8 and should be removed in default build in the
51 LIBXSLTBREAK_MAJOR_VERSION=1
52 LIBXSLTBREAK_MINOR_VERSION=0
53 LIBXSLTBREAK_MICRO_VERSION=8
55 LIBXSLTBREAK_VERSION=$LIBXSLTBREAK_MAJOR_VERSION.$LIBXSLTBREAK_MINOR_VERSION.$LIBXSLTBREAK_MICRO_VERSION
56 LIBXSLTBREAK_VERSION_INFO=`expr $LIBXSLTBREAK_MAJOR_VERSION + $LIBXSLTBREAK_MINOR_VERSION`:$LIBXSLTBREAK_MICRO_VERSION:$LIBXSLTBREAK_MINOR_VERSION
58 LIBXSLTBREAK_VERSION_NUMBER=`expr $LIBXSLTBREAK_MAJOR_VERSION \* 10000 + $LIBXSLTBREAK_MINOR_VERSION \* 100 + $LIBXSLTBREAK_MICRO_VERSION`
60 AC_SUBST(LIBXSLTBREAK_MAJOR_VERSION)
61 AC_SUBST(LIBXSLTBREAK_MINOR_VERSION)
62 AC_SUBST(LIBXSLTBREAK_MICRO_VERSION)
63 AC_SUBST(LIBXSLTBREAK_VERSION)
64 AC_SUBST(LIBXSLTBREAK_VERSION_INFO)
65 AC_SUBST(LIBXSLTBREAK_VERSION_NUMBER)
70 VERSION=${LIBXSLT_VERSION}
72 AM_CONFIG_HEADER(config.h)
73 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
76 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
79 dnl Specific dir for HTML output ?
82 if test "x$with_html_dir" = "x" ; then
83 HTML_DIR='$(prefix)/doc'
85 HTML_DIR=$with_html_dir
90 dnl Check the environment
103 AC_CHECK_HEADERS(sys/types.h sys/time.h stdlib.h unistd.h string.h)
104 AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h ansidecl.h)
105 AC_CHECK_HEADERS(sys/timeb.h time.h sys/stat.h stdarg.h)
106 AC_CHECK_FUNCS(stat _stat)
107 AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
108 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
110 AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
111 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
113 AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow,
114 [M_LIBS="-lm"; AC_DEFINE(HAVE_POW)]))
116 AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor,
117 [M_LIBS="-lm"; AC_DEFINE(HAVE_FLOOR)]))
119 AC_CHECK_FUNC(fabs, , AC_CHECK_LIB(m, fabs,
120 [M_LIBS="-lm"; AC_DEFINE(HAVE_FABS)]))
121 AC_CHECK_FUNCS(gettimeofday)
122 AC_CHECK_FUNCS(mktime localtime asctime time gmtime ftime)
125 dnl Perl is just needed for generating some data for XSLtmark
128 AC_CHECK_PROG(PERL, perl, perl, false)
129 AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
138 PYTHON_SITE_PACKAGES=
139 AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found])
140 if test "$with_python" != "no" ; then
141 if test -x "$with_python/bin/python"
143 echo Found python in $with_python/bin/python
144 PYTHON="$with_python/bin/python"
146 AC_PATH_PROG(PYTHON, python python2.2 python2.1 python2.0 python1.6 python1.5)
148 if test "$PYTHON" != ""
150 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
151 echo Found Python version $PYTHON_VERSION
152 LIBXML2_PYTHON=`python -c "try : import libxml2 ; print 1
154 if test "$LIBXML2_PYTHON" = "1"
156 echo Found libxml2-python module
158 echo Missing libxml2-python
161 if test "$PYTHON_VERSION" != "" -a "$LIBXML2_PYTHON" = "1"
163 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
164 -d $with_python/lib/python$PYTHON_VERSION/site-packages
166 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
167 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
169 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
171 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
172 PYTHON_SITE_PACKAGES='$(prefix)/lib/python$(PYTHON_VERSION)/site-packages'
174 if test -r /usr/include/python$PYTHON_VERSION/Python.h
176 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
177 PYTHON_SITE_PACKAGES='$(prefix)/lib/python$(PYTHON_VERSION)/site-packages'
179 echo could not find python$PYTHON_VERSION/Python.h
185 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
188 dnl Debug for DV (-Wunreachable-code)
190 if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
191 if test "${with_mem_debug}" = "" ; then
194 CFLAGS="-Wall -g -O -ansi -pedantic -W -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 "
197 AC_ARG_WITH(debug, [ --with-debug Add the debugging code (on)])
198 if test "$with_debug" = "no" ; then
199 echo Disabling debug support
204 AC_SUBST(WITH_XSLT_DEBUG)
206 AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
207 if test "$with_mem_debug" = "yes" ; then
208 echo Enabling memory debug support
213 AC_SUBST(WITH_MEM_DEBUG)
216 dnl Is debugger support requested
218 AC_ARG_WITH(with_debugger, [ --with-debugger Add the debugging support (on)])
219 if test "$with_debugger" = "no" ; then
220 echo Disabling debugger
223 echo Enabling debugger
225 AC_DEFINE(WITH_DEBUGGER)
227 AM_CONDITIONAL(WITH_DEBUGGER, test "${WITH_DEBUGGER}" = "1")
228 AC_SUBST(WITH_DEBUGGER)
231 dnl The following new parameters were added to offer
232 dnl the ability to specify the location of the libxml
233 dnl library during linking and compilation.
235 dnl original work - Mathieu Lacage 30/03/2000
236 dnl some tweaking - David Härdeman 30/10/2001
239 LIBXML_CONFIG_PREFIX=""
242 AC_ARG_WITH(libxml-prefix,
243 [ --with-libxml-prefix=[PFX] Specify location of libxml config],
244 LIBXML_CONFIG_PREFIX=$withval
247 AC_ARG_WITH(libxml-include-prefix,
248 [ --with-libxml-include-prefix=[PFX] Specify location of libxml headers],
249 LIBXML_CFLAGS="-I$withval"
252 AC_ARG_WITH(libxml-libs-prefix,
253 [ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs],
254 LIBXML_LIBS="-L$withval"
257 AC_ARG_WITH(libxml-src,
258 [ --with-libxml-src=[DIR] For libxml thats not installed yet (sets all three above)],
259 LIBXML_SRC="$withval"
263 dnl where is xml2-config
266 AC_SUBST(LIBXML_REQUIRED_VERSION)
267 AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
268 if test "x$LIBXML_CONFIG_PREFIX" != "x"
270 XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config
272 XML_CONFIG=xml2-config
276 dnl Override other variables if LIBXML_SRC is set
279 if test "x$LIBXML_SRC" != "x"
285 XML_CONFIG=${SRC_DIR}/xml2-config
286 LIBXML_CFLAGS="-I${SRC_DIR}/include"
287 LIBXML_LIBS="-L${SRC_DIR}"
290 AC_MSG_ERROR([libxml source dir not found (${LIBXML_SRC}), typo?])
295 dnl make sure xml2-config is executable,
296 dnl test version and init our variables
299 AC_DEFUN(VERSION_TO_NUMBER,
300 [`$1 | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`])
301 if ${XML_CONFIG} --libs print > /dev/null 2>&1
303 XMLVERS=`$XML_CONFIG --version`
304 if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
306 LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
307 LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
308 AC_MSG_RESULT($XMLVERS found)
310 AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
313 AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
322 # Some fun with prelinking :-(
323 # try to check if there is already an installed shared lib of the same level
325 INSTALLED_XSLT_LIB=""
328 shared_xslt_lib="$prefix/lib/libxslt.so.$LIBXSLT_MAJOR_VERSION"
329 shared_xslt_la="$prefix/lib/libxslt.la"
330 if test -f $shared_xslt_lib -a -f $shared_xslt_la
332 INSTALLED_XSLT_LIB="-L$libdir -lxslt"
335 AC_SUBST(INSTALLED_XSLT_LIB)
338 dnl In build tree I use a static version with memory debug enabled
340 if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
341 LIBXML_LIBS="../../XML/.libs/libxml2.a -lz"
343 XSLTPROCDV="xsltproc.dv"
344 # PYTHONSODV="libxsltmod.so.dv"
350 AC_SUBST(LIBXML_LIBS)
351 AC_SUBST(LIBXML_CFLAGS)
353 AC_SUBST(PYTHON_VERSION)
354 AC_SUBST(PYTHON_INCLUDES)
355 AC_SUBST(PYTHON_SITE_PACKAGES)
357 XSLT_LIBDIR='-L${libdir}'
361 XSLT_LIBDIR="${XSLT_LIBDIR} -R${libdir}"
365 XSLT_INCLUDEDIR='-I${includedir}'
366 XSLT_LIBS="-lxslt $LIBXML_LIBS $M_LIBS"
367 EXTRA_LIBS="$LIBXML_LIBS $M_LIBS"
369 AC_SUBST(XSLT_LIBDIR)
370 AC_SUBST(XSLT_INCLUDEDIR)
375 rm -f rm COPYING.LIB COPYING
376 ln -s Copyright COPYING
384 libxslt/xsltwin32config.h
387 libexslt/exsltconfig.h
390 python/tests/Makefile
396 tests/general/Makefile
397 tests/reports/Makefile
398 tests/extensions/Makefile
399 tests/namespaces/Makefile
400 tests/numbers/Makefile
401 tests/documents/Makefile
402 tests/xmlspec/Makefile
403 tests/multiple/Makefile
404 tests/XSLTMark/Makefile
405 tests/docbook/Makefile
407 tests/exslt/common/Makefile
408 tests/exslt/functions/Makefile
409 tests/exslt/math/Makefile
410 tests/exslt/sets/Makefile
411 tests/exslt/strings/Makefile
412 tests/exslt/date/Makefile