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=29
11 LIBEXSLT_MAJOR_VERSION=0
12 LIBEXSLT_MINOR_VERSION=7
13 LIBEXSLT_MICRO_VERSION=19
14 LIBXML_REQUIRED_VERSION=2.5.6
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)
124 dnl Checking the standard string functions availability
125 AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
128 dnl Check for trio string functions
131 if test "${NEED_TRIO}" = "1" ; then
132 echo Reusing trio library for string functions
140 dnl Perl is just needed for generating some data for XSLtmark
143 AC_CHECK_PROG(PERL, perl, perl, false)
144 AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
153 PYTHON_SITE_PACKAGES=
154 AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found])
155 if test "$with_python" != "no" ; then
156 if test -x "$with_python/bin/python"
158 echo Found python in $with_python/bin/python
159 PYTHON="$with_python/bin/python"
161 if test -x "$with_python"
163 echo Found python in $with_python
164 PYTHON="$with_python"
166 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
169 if test "$PYTHON" != ""
171 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
172 echo Found Python version $PYTHON_VERSION
173 LIBXML2_PYTHON=`python -c "try : import libxml2 ; print 1
175 if test "$LIBXML2_PYTHON" = "1"
177 echo Found libxml2-python module
179 echo Warning: Missing libxml2-python
182 if test "$PYTHON_VERSION" != ""
184 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
185 -d $with_python/lib/python$PYTHON_VERSION/site-packages
187 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
188 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
190 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
192 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
193 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
195 if test -r /usr/include/python$PYTHON_VERSION/Python.h
197 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
198 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
200 echo could not find python$PYTHON_VERSION/Python.h
203 if ! test -d "$PYTHON_SITE_PACKAGES"
205 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
210 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
211 if test "$PYTHON_INCLUDES" != ""
217 AC_SUBST(PYTHON_SUBDIR)
220 dnl Debug for DV (-Wunreachable-code)
222 if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
223 if test "${with_mem_debug}" = "" ; then
226 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 "
227 STATIC_BINARIES="-static"
231 AC_SUBST(STATIC_BINARIES)
233 AC_ARG_WITH(debug, [ --with-debug Add the debugging code (on)])
234 if test "$with_debug" = "no" ; then
235 echo Disabling debug support
240 AC_SUBST(WITH_XSLT_DEBUG)
242 AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
243 if test "$with_mem_debug" = "yes" ; then
244 echo Enabling memory debug support
249 AC_SUBST(WITH_MEM_DEBUG)
252 dnl Is debugger support requested
254 AC_ARG_WITH(with_debugger, [ --with-debugger Add the debugging support (on)])
255 if test "$with_debugger" = "no" ; then
256 echo Disabling debugger
259 echo Enabling debugger
261 AC_DEFINE(WITH_DEBUGGER)
263 AM_CONDITIONAL(WITH_DEBUGGER, test "${WITH_DEBUGGER}" = "1")
264 AC_SUBST(WITH_DEBUGGER)
267 dnl The following new parameters were added to offer
268 dnl the ability to specify the location of the libxml
269 dnl library during linking and compilation.
271 dnl original work - Mathieu Lacage 30/03/2000
272 dnl some tweaking - David Härdeman 30/10/2001
275 LIBXML_CONFIG_PREFIX=""
278 AC_ARG_WITH(libxml-prefix,
279 [ --with-libxml-prefix=[PFX] Specify location of libxml config],
280 LIBXML_CONFIG_PREFIX=$withval
283 AC_ARG_WITH(libxml-include-prefix,
284 [ --with-libxml-include-prefix=[PFX] Specify location of libxml headers],
285 LIBXML_CFLAGS="-I$withval"
288 AC_ARG_WITH(libxml-libs-prefix,
289 [ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs],
290 LIBXML_LIBS="-L$withval"
293 AC_ARG_WITH(libxml-src,
294 [ --with-libxml-src=[DIR] For libxml thats not installed yet (sets all three above)],
295 LIBXML_SRC="$withval"
299 dnl where is xml2-config
302 AC_SUBST(LIBXML_REQUIRED_VERSION)
303 AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
304 if test "x$LIBXML_CONFIG_PREFIX" != "x"
306 XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config
308 XML_CONFIG=xml2-config
312 dnl imported from libxml2, c.f. #77827
314 if test "${GCC}" != "yes" ; then
317 CFLAGS="${CFLAGS} -Wp,-H30000"
320 CFLAGS="${CFLAGS} -ieee"
324 CFLAGS="${CFLAGS} -Wall"
327 CFLAGS="${CFLAGS} -mieee"
330 CFLAGS="${CFLAGS} -mieee"
336 dnl Override other variables if LIBXML_SRC is set
339 if test "x$LIBXML_SRC" != "x"
345 XML_CONFIG=${SRC_DIR}/xml2-config
346 LIBXML_CFLAGS="-I${SRC_DIR}/include"
347 LIBXML_LIBS="-L${SRC_DIR}"
350 AC_MSG_ERROR([libxml source dir not found (${LIBXML_SRC}), typo?])
355 dnl make sure xml2-config is executable,
356 dnl test version and init our variables
359 AC_DEFUN(VERSION_TO_NUMBER,
360 [`$1 | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`])
361 if ${XML_CONFIG} --libs print > /dev/null 2>&1
363 XMLVERS=`$XML_CONFIG --version`
364 if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
366 LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
367 LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
368 AC_MSG_RESULT($XMLVERS found)
370 AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
373 AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
382 # Some fun with prelinking :-(
383 # try to check if there is already an installed shared lib of the same level
385 INSTALLED_XSLT_LIB=""
388 shared_xslt_lib="$prefix/lib/libxslt.so.$LIBXSLT_MAJOR_VERSION"
389 shared_xslt_la="$prefix/lib/libxslt.la"
390 if test -f $shared_xslt_lib -a -f $shared_xslt_la
392 INSTALLED_XSLT_LIB="-L$libdir -lxslt"
395 AC_SUBST(INSTALLED_XSLT_LIB)
398 dnl In build tree I use a static version with memory debug enabled
400 if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
401 LIBXML_LIBS="../../XML/.libs/libxml2.a -lpthread -lz"
403 XSLTPROCDV="xsltproc.dv"
404 INSTALLED_XSLT_LIB=""
405 # PYTHONSODV="libxsltmod.so.dv"
411 AC_SUBST(LIBXML_LIBS)
412 AC_SUBST(LIBXML_CFLAGS)
414 AC_SUBST(PYTHON_VERSION)
415 AC_SUBST(PYTHON_INCLUDES)
416 AC_SUBST(PYTHON_SITE_PACKAGES)
418 XSLT_LIBDIR='-L${libdir}'
420 XSLT_INCLUDEDIR='-I${includedir}'
421 XSLT_LIBS="-lxslt $LIBXML_LIBS $M_LIBS"
422 EXTRA_LIBS="$LIBXML_LIBS $M_LIBS"
424 AC_SUBST(XSLT_LIBDIR)
425 AC_SUBST(XSLT_INCLUDEDIR)
430 dnl for the spec file
431 RELDATE=`date +'%a %b %e %Y'`
434 rm -f COPYING.LIB COPYING
435 ln -s Copyright COPYING
443 libxslt/xsltwin32config.h
446 libexslt/exsltconfig.h
449 python/tests/Makefile
455 tests/general/Makefile
456 tests/reports/Makefile
457 tests/extensions/Makefile
458 tests/namespaces/Makefile
460 tests/numbers/Makefile
461 tests/documents/Makefile
462 tests/xmlspec/Makefile
463 tests/multiple/Makefile
464 tests/XSLTMark/Makefile
465 tests/docbook/Makefile
467 tests/exslt/common/Makefile
468 tests/exslt/functions/Makefile
469 tests/exslt/math/Makefile
470 tests/exslt/sets/Makefile
471 tests/exslt/strings/Makefile
472 tests/exslt/date/Makefile