1 dnl Process this file with autoconf to produce a configuration script.
3 AC_INIT(libxslt/xslt.c)
4 AM_CONFIG_HEADER(config.h)
8 dnl libxslt is the main part of the package
9 dnl libexslt is an extension
11 LIBXSLT_MAJOR_VERSION=1
12 LIBXSLT_MINOR_VERSION=1
13 LIBXSLT_MICRO_VERSION=12
15 LIBEXSLT_MAJOR_VERSION=0
16 LIBEXSLT_MINOR_VERSION=8
17 LIBEXSLT_MICRO_VERSION=10
18 LIBXML_REQUIRED_VERSION=2.6.15 # needs new API xmlNewDocPI
21 LIBXSLT_VERSION=$LIBXSLT_MAJOR_VERSION.$LIBXSLT_MINOR_VERSION.$LIBXSLT_MICRO_VERSION
22 LIBXSLT_VERSION_INFO=`expr $LIBXSLT_MAJOR_VERSION + $LIBXSLT_MINOR_VERSION`:$LIBXSLT_MICRO_VERSION:$LIBXSLT_MINOR_VERSION
24 LIBXSLT_VERSION_NUMBER=`expr $LIBXSLT_MAJOR_VERSION \* 10000 + $LIBXSLT_MINOR_VERSION \* 100 + $LIBXSLT_MICRO_VERSION`
25 LIBXSLT_MAJOR_MINOR_VERSION=$LIBXSLT_MAJOR_VERSION.$LIBXSLT_MINOR_VERSION
27 if test -f CVS/Entries; then
28 extra=`grep ChangeLog CVS/Entries | grep -v LIBXSLT | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
30 if test "$extra" != ""
32 LIBXSLT_VERSION_EXTRA="-CVS$extra"
36 AC_SUBST(LIBXSLT_MAJOR_VERSION)
37 AC_SUBST(LIBXSLT_MINOR_VERSION)
38 AC_SUBST(LIBXSLT_MICRO_VERSION)
39 AC_SUBST(LIBXSLT_VERSION)
40 AC_SUBST(LIBXSLT_VERSION_INFO)
41 AC_SUBST(LIBXSLT_VERSION_NUMBER)
42 AC_SUBST(LIBXSLT_VERSION_EXTRA)
43 AC_SUBST(LIBXSLT_MAJOR_MINOR_VERSION)
46 dnl libexslt is an extension library
49 LIBEXSLT_VERSION=$LIBEXSLT_MAJOR_VERSION.$LIBEXSLT_MINOR_VERSION.$LIBEXSLT_MICRO_VERSION
50 LIBEXSLT_VERSION_INFO=`expr $LIBEXSLT_MAJOR_VERSION + $LIBEXSLT_MINOR_VERSION`:$LIBEXSLT_MICRO_VERSION:$LIBEXSLT_MINOR_VERSION
52 LIBEXSLT_VERSION_NUMBER=`expr $LIBEXSLT_MAJOR_VERSION \* 10000 + $LIBEXSLT_MINOR_VERSION \* 100 + $LIBEXSLT_MICRO_VERSION`
54 if test -f CVS/Entries; then
55 LIBEXSLT_VERSION_EXTRA=-CVS`grep ChangeLog CVS/Entries | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
58 AC_SUBST(LIBEXSLT_MAJOR_VERSION)
59 AC_SUBST(LIBEXSLT_MINOR_VERSION)
60 AC_SUBST(LIBEXSLT_MICRO_VERSION)
61 AC_SUBST(LIBEXSLT_VERSION)
62 AC_SUBST(LIBEXSLT_VERSION_INFO)
63 AC_SUBST(LIBEXSLT_VERSION_NUMBER)
64 AC_SUBST(LIBEXSLT_VERSION_EXTRA)
66 VERSION=${LIBXSLT_VERSION}
68 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
72 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
75 dnl Specific dir for HTML output ?
78 if test "x$with_html_dir" = "x" ; then
79 HTML_DIR='$(prefix)/doc'
81 HTML_DIR=$with_html_dir
86 dnl Check the environment
93 AC_PATH_PROG(RM, rm, /bin/rm)
94 AC_PATH_PROG(MV, mv, /bin/mv)
95 AC_PATH_PROG(TAR, tar, /bin/tar)
104 AC_CHECK_HEADERS(sys/types.h sys/time.h stdlib.h unistd.h string.h)
105 AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h ansidecl.h)
106 AC_CHECK_HEADERS(sys/timeb.h time.h sys/stat.h sys/select.h stdarg.h)
107 AC_CHECK_FUNCS(stat _stat)
108 AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
109 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
111 AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
112 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
114 AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow,
115 [M_LIBS="-lm"; AC_DEFINE(HAVE_POW)]))
117 AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor,
118 [M_LIBS="-lm"; AC_DEFINE(HAVE_FLOOR)]))
120 AC_CHECK_FUNC(fabs, , AC_CHECK_LIB(m, fabs,
121 [M_LIBS="-lm"; AC_DEFINE(HAVE_FABS)]))
122 AC_CHECK_FUNCS(gettimeofday)
123 AC_CHECK_FUNCS(mktime localtime localtime_r asctime time gmtime_r ftime)
125 dnl Checking the standard string functions availability
126 AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
130 dnl Check for trio string functions
133 if test "${NEED_TRIO}" = "1" ; then
134 echo Reusing trio library for string functions
142 dnl Some packages need to be checked against version numbers so we
143 dnl define a function here for later use
145 AC_DEFUN([VERSION_TO_NUMBER],
146 [`$1 | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`])
149 dnl Perl is just needed for generating some data for XSLtmark
152 AC_CHECK_PROG(PERL, perl, perl, false)
153 AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
162 PYTHON_SITE_PACKAGES=
164 AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found])
165 if test "$with_python" != "no" ; then
166 if test -x "$with_python/bin/python"
168 echo Found python in $with_python/bin/python
169 PYTHON="$with_python/bin/python"
171 if test -x "$with_python"
173 echo Found python in $with_python
174 PYTHON="$with_python"
176 AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
179 if test "$PYTHON" != ""
181 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
182 echo Found Python version $PYTHON_VERSION
183 LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1
185 if test "$LIBXML2_PYTHON" = "1"
187 echo Found libxml2-python module
189 echo Warning: Missing libxml2-python
192 if test "$PYTHON_VERSION" != ""
194 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
195 -d $with_python/lib/python$PYTHON_VERSION/site-packages
197 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
198 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
200 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
202 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
203 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
205 if test -r /usr/include/python$PYTHON_VERSION/Python.h
207 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
208 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
210 echo could not find python$PYTHON_VERSION/Python.h
213 if test ! -d "$PYTHON_SITE_PACKAGES"
215 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
219 if test "$with_python" != ""
221 pythondir='$(PYTHON_SITE_PACKAGES)'
223 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
226 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
227 if test "$PYTHON_INCLUDES" != ""
234 AC_SUBST(PYTHON_SUBDIR)
236 AC_ARG_WITH(crypto, [ --with-crypto Add crypto support to exslt (on)])
238 if test "$with_crypto" = "no" ; then
239 echo Disabling crypto support
243 AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
244 if test "$LIBGCRYPT_CONFIG" != "no" ; then
245 LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version`
246 if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42")
250 echo gcrypt library version < 1.1.42 - Crypto extensions will not be available.
252 LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
253 LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
254 AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
255 echo Crypto extensions will be available.
261 echo Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.
264 AC_SUBST(WITH_CRYPTO)
265 AC_SUBST(LIBGCRYPT_CFLAGS)
266 AC_SUBST(LIBGCRYPT_LIBS)
269 dnl Debug for DV (-Wunreachable-code)
271 if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ]] || \
272 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xsltest" ]]
274 if test "${with_mem_debug}" = "" ;
278 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 "
279 if test "`uname -i`" != "x86_64" ;
281 STATIC_BINARIES="-static"
285 if test "$LOGNAME" = "veillard"
287 LIBXML_SRC="/u/veillard/XML"
288 EXTRA_LIBS="$EXTRA_LIBS -ldl"
293 AC_SUBST(STATIC_BINARIES)
295 AC_ARG_WITH(debug, [ --with-debug Add the debugging code (on)])
296 if test "$with_debug" = "no" ; then
297 echo Disabling debug support
302 AC_SUBST(WITH_XSLT_DEBUG)
304 AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
305 if test "$with_mem_debug" = "yes" ; then
306 echo Enabling memory debug support
311 AC_SUBST(WITH_MEM_DEBUG)
314 dnl Is debugger support requested
316 AC_ARG_WITH(with_debugger, [ --with-debugger Add the debugging support (on)])
317 if test "$with_debugger" = "no" ; then
318 echo Disabling debugger
321 echo Enabling debugger
323 AC_DEFINE(WITH_DEBUGGER)
325 AC_SUBST(WITH_DEBUGGER)
328 dnl The following new parameters were added to offer
329 dnl the ability to specify the location of the libxml
330 dnl library during linking and compilation.
332 dnl original work - Mathieu Lacage 30/03/2000
333 dnl some tweaking - David Härdeman 30/10/2001
336 LIBXML_CONFIG_PREFIX=""
339 AC_ARG_WITH(libxml-prefix,
340 [ --with-libxml-prefix=[PFX] Specify location of libxml config],
341 LIBXML_CONFIG_PREFIX=$withval
344 AC_ARG_WITH(libxml-include-prefix,
345 [ --with-libxml-include-prefix=[PFX] Specify location of libxml headers],
346 LIBXML_CFLAGS="-I$withval"
349 AC_ARG_WITH(libxml-libs-prefix,
350 [ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs],
351 LIBXML_LIBS="-L$withval"
354 AC_ARG_WITH(libxml-src,
355 [ --with-libxml-src=[DIR] For libxml thats not installed yet (sets all three above)],
356 LIBXML_SRC="$withval"
361 dnl where is xml2-config
364 AC_SUBST(LIBXML_REQUIRED_VERSION)
365 AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
366 if test "x$LIBXML_CONFIG_PREFIX" != "x"
368 XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config
370 XML_CONFIG=xml2-config
374 dnl imported from libxml2, c.f. #77827
376 if test "${GCC}" != "yes" ; then
379 CFLAGS="${CFLAGS} -Wp,-H30000"
382 CFLAGS="${CFLAGS} -ieee"
386 CFLAGS="${CFLAGS} -Wall"
389 CFLAGS="${CFLAGS} -mieee"
392 CFLAGS="${CFLAGS} -mieee"
398 dnl Override other variables if LIBXML_SRC is set
401 if test "x$LIBXML_SRC" != "x"
407 XML_CONFIG=${SRC_DIR}/xml2-config
408 LIBXML_CFLAGS="-I${SRC_DIR}/include"
409 LIBXML_LIBS="-L${SRC_DIR}"
412 AC_MSG_ERROR([libxml source dir not found (${LIBXML_SRC}), typo?])
417 dnl make sure xml2-config is executable,
418 dnl test version and init our variables
421 if ${XML_CONFIG} --libs print > /dev/null 2>&1
423 XMLVERS=`$XML_CONFIG --version`
424 if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
426 LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
427 LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
428 AC_MSG_RESULT($XMLVERS found)
430 AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
433 AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
442 [ --with-plugins Add plugin extension support (on)])
443 if test "$with_plugins" = ""
448 if test "$with_plugins" = "yes" ; then
449 AC_MSG_CHECKING([libxml2 module support])
450 WITH_MODULES="`$XML_CONFIG --modules`"
451 if test "${WITH_MODULES}" = "1"; then
461 AC_SUBST(WITH_MODULES)
462 AM_CONDITIONAL(WITH_MODULES, test "$WITH_MODULES" == "1")
465 dnl setup default module path
467 module_prefix=$prefix
468 test "x$module_prefix" = xNONE && module_prefix=$ac_default_prefix
469 LIBXSLT_DEFAULT_PLUGINS_PATH="\"$module_prefix/lib/libxslt/$LIBXSLT_MAJOR_VERSION.$LIBXSLT_MINOR_VERSION\""
470 AC_SUBST(LIBXSLT_DEFAULT_PLUGINS_PATH)
473 dnl In build tree I use a static version with memory debug enabled
475 if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
476 if test "`uname -i`" != "x86_64" ;
478 LIBXML_LIBS="../../XML/.libs/libxml2.a -lpthread -lz"
481 XSLTPROCDV="xsltproc.dv"
482 INSTALLED_XSLT_LIB=""
483 LIBXML_SRC="../../XML/"
490 WIN32_EXTRA_LIBADD="-lwsock32"
491 WIN32_EXTRA_LDFLAGS="-no-undefined"
492 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
493 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
494 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
497 AC_SUBST(WIN32_EXTRA_LIBADD)
498 AC_SUBST(WIN32_EXTRA_LDFLAGS)
504 AC_SUBST(LIBXML_LIBS)
505 AC_SUBST(LIBXML_CFLAGS)
507 AC_SUBST(PYTHON_VERSION)
508 AC_SUBST(PYTHON_INCLUDES)
509 AC_SUBST(PYTHON_SITE_PACKAGES)
511 XSLT_LIBDIR='-L${libdir}'
512 XSLT_INCLUDEDIR='-I${includedir}'
513 XSLT_LIBS="-lxslt $LIBXML_LIBS $M_LIBS"
514 AC_SUBST(XSLT_LIBDIR)
515 AC_SUBST(XSLT_INCLUDEDIR)
518 EXSLT_LIBDIR='-L${libdir}'
519 EXSLT_INCLUDEDIR='-I${includedir}'
520 EXSLT_LIBS="-lexslt $XSLT_LIBS $LIBGCRYPT_LIBS"
521 AC_SUBST(EXSLT_LIBDIR)
522 AC_SUBST(EXSLT_INCLUDEDIR)
525 EXTRA_LIBS="$EXTRA_LIBS $LIBXML_LIBS $M_LIBS"
530 dnl for the spec file
531 RELDATE=`date +'%a %b %e %Y'`
535 rm -f COPYING.LIB COPYING
536 $LN_S Copyright COPYING
546 libxslt/xsltwin32config.h
548 libexslt/exsltconfig.h
551 python/tests/Makefile
557 tests/general/Makefile
558 tests/reports/Makefile
559 tests/extensions/Makefile
560 tests/namespaces/Makefile
562 tests/numbers/Makefile
563 tests/documents/Makefile
564 tests/xmlspec/Makefile
565 tests/multiple/Makefile
566 tests/XSLTMark/Makefile
567 tests/docbook/Makefile
569 tests/exslt/common/Makefile
570 tests/exslt/functions/Makefile
571 tests/exslt/math/Makefile
572 tests/exslt/sets/Makefile
573 tests/exslt/strings/Makefile
574 tests/exslt/date/Makefile