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=18
15 LIBEXSLT_MAJOR_VERSION=0
16 LIBEXSLT_MINOR_VERSION=8
17 LIBEXSLT_MICRO_VERSION=13
18 LIBXML_REQUIRED_VERSION=2.6.27
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")
161 PYTHON_SITE_PACKAGES=
163 AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found])
164 if test "$with_python" != "no" ; then
165 if test -x "$with_python/bin/python"
167 echo Found python in $with_python/bin/python
168 PYTHON="$with_python/bin/python"
170 if test -x "$with_python"
172 echo Found python in $with_python
173 PYTHON="$with_python"
177 echo Found python in environment PYTHON=$PYTHON
178 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
180 AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
184 if test "$PYTHON" != ""
186 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
187 echo Found Python version $PYTHON_VERSION
188 LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1
190 if test "$LIBXML2_PYTHON" = "1"
192 echo Found libxml2-python module
194 echo Warning: Missing libxml2-python
197 if test "$PYTHON_VERSION" != ""
199 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
200 -d $with_python/lib/python$PYTHON_VERSION/site-packages
202 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
203 PYTHON_SITE_PACKAGES='$(libdir)/lib/python$(PYTHON_VERSION)/site-packages'
205 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
207 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
208 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
210 if test -r /usr/include/python$PYTHON_VERSION/Python.h
212 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
213 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
215 echo could not find python$PYTHON_VERSION/Python.h
218 if test ! -d "$PYTHON_SITE_PACKAGES"
220 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
224 if test "$with_python" != ""
226 pythondir='$(PYTHON_SITE_PACKAGES)'
228 pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
231 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
232 if test "$PYTHON_INCLUDES" != ""
239 AC_SUBST(PYTHON_SUBDIR)
241 AC_ARG_WITH(crypto, [ --with-crypto Add crypto support to exslt (on)])
243 if test "$with_crypto" = "no" ; then
244 echo Disabling crypto support
248 AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
249 if test "$LIBGCRYPT_CONFIG" != "no" ; then
250 LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version`
251 if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42")
255 echo gcrypt library version < 1.1.42 - Crypto extensions will not be available.
257 LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
258 LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
259 AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
260 echo Crypto extensions will be available.
266 echo Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.
269 AC_SUBST(WITH_CRYPTO)
270 AC_SUBST(LIBGCRYPT_CFLAGS)
271 AC_SUBST(LIBGCRYPT_LIBS)
274 dnl Debug for DV (-Wunreachable-code)
276 if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ]] || \
277 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xsltest" ]]
279 if test "${with_mem_debug}" = "" ;
283 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 "
284 if test "`uname -i`" != "x86_64" ;
286 STATIC_BINARIES="-static"
290 if test "$LOGNAME" = "veillard"
292 LIBXML_SRC="/u/veillard/XML"
293 EXTRA_LIBS="$EXTRA_LIBS -ldl"
298 AC_SUBST(STATIC_BINARIES)
300 AC_ARG_WITH(debug, [ --with-debug Add the debugging code (on)])
301 if test "$with_debug" = "no" ; then
302 echo Disabling debug support
307 AC_SUBST(WITH_XSLT_DEBUG)
309 AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
310 if test "$with_mem_debug" = "yes" ; then
311 echo Enabling memory debug support
316 AC_SUBST(WITH_MEM_DEBUG)
319 dnl Is debugger support requested
321 AC_ARG_WITH(with_debugger, [ --with-debugger Add the debugging support (on)])
322 if test "$with_debugger" = "no" ; then
323 echo Disabling debugger
326 echo Enabling debugger
328 AC_DEFINE(WITH_DEBUGGER)
330 AC_SUBST(WITH_DEBUGGER)
333 dnl The following new parameters were added to offer
334 dnl the ability to specify the location of the libxml
335 dnl library during linking and compilation.
337 dnl original work - Mathieu Lacage 30/03/2000
338 dnl some tweaking - David Härdeman 30/10/2001
341 LIBXML_CONFIG_PREFIX=""
344 AC_ARG_WITH(libxml-prefix,
345 [ --with-libxml-prefix=[PFX] Specify location of libxml config],
346 LIBXML_CONFIG_PREFIX=$withval
349 AC_ARG_WITH(libxml-include-prefix,
350 [ --with-libxml-include-prefix=[PFX] Specify location of libxml headers],
351 LIBXML_CFLAGS="-I$withval"
354 AC_ARG_WITH(libxml-libs-prefix,
355 [ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs],
356 LIBXML_LIBS="-L$withval"
359 AC_ARG_WITH(libxml-src,
360 [ --with-libxml-src=[DIR] For libxml thats not installed yet (sets all three above)],
361 LIBXML_SRC="$withval"
366 dnl where is xml2-config
369 AC_SUBST(LIBXML_REQUIRED_VERSION)
370 AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
371 if test "x$LIBXML_CONFIG_PREFIX" != "x"
373 XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config
375 XML_CONFIG=xml2-config
379 dnl imported from libxml2, c.f. #77827
381 if test "${GCC}" != "yes" ; then
384 CFLAGS="${CFLAGS} -Wp,-H30000"
387 CFLAGS="${CFLAGS} -ieee"
391 CFLAGS="${CFLAGS} -Wall"
394 CFLAGS="${CFLAGS} -mieee"
397 CFLAGS="${CFLAGS} -mieee"
403 dnl Override other variables if LIBXML_SRC is set
406 if test "x$LIBXML_SRC" != "x"
412 XML_CONFIG=${SRC_DIR}/xml2-config
413 LIBXML_CFLAGS="-I${SRC_DIR}/include"
414 LIBXML_LIBS="-L${SRC_DIR}"
417 AC_MSG_ERROR([libxml source dir not found (${LIBXML_SRC}), typo?])
422 dnl make sure xml2-config is executable,
423 dnl test version and init our variables
426 if ${XML_CONFIG} --libs print > /dev/null 2>&1
428 XMLVERS=`$XML_CONFIG --version`
429 if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
431 LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
432 LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
433 AC_MSG_RESULT($XMLVERS found)
435 AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
438 AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
447 [ --with-plugins Add plugin extension support (on)])
448 if test "$with_plugins" = ""
453 AC_MSG_CHECKING([whether shared libraries will be built (required for plugins)])
454 if test "$enable_shared" = "no" -a "$with_plugins" = "yes"; then
456 AC_MSG_WARN([Disabling plugin support.])
457 AC_MSG_WARN([Plugins require that shared libraries be built.])
463 if test "$with_plugins" = "yes" ; then
464 AC_MSG_CHECKING([libxml2 module support])
465 WITH_MODULES="`$XML_CONFIG --modules`"
466 if test "${WITH_MODULES}" = "1"; then
476 AC_SUBST(WITH_MODULES)
477 AM_CONDITIONAL(WITH_MODULES, test "$WITH_MODULES" == "1")
480 dnl setup default module path
482 module_prefix=$prefix
483 test "x$module_prefix" = xNONE && module_prefix=$ac_default_prefix
484 LIBXSLT_DEFAULT_PLUGINS_PATH="$module_prefix/lib/libxslt-plugins"
485 AC_SUBST(LIBXSLT_DEFAULT_PLUGINS_PATH)
488 dnl In build tree I use a static version with memory debug enabled
490 if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
491 if test "`uname -i`" != "x86_64" -a -e $HOME/XML/.libs/libxml2.a ;
493 LIBXML_LIBS="$HOME/XML/.libs/libxml2.a -lpthread -lz"
496 XSLTPROCDV="xsltproc.dv"
497 INSTALLED_XSLT_LIB=""
498 LIBXML_SRC="$HOME/XML/"
505 WIN32_EXTRA_LIBADD="-lwsock32"
506 WIN32_EXTRA_LDFLAGS="-no-undefined"
507 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
508 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
509 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
512 AC_SUBST(WIN32_EXTRA_LIBADD)
513 AC_SUBST(WIN32_EXTRA_LDFLAGS)
519 AC_SUBST(LIBXML_LIBS)
520 AC_SUBST(LIBXML_CFLAGS)
522 AC_SUBST(PYTHON_VERSION)
523 AC_SUBST(PYTHON_INCLUDES)
524 AC_SUBST(PYTHON_SITE_PACKAGES)
526 XSLT_LIBDIR='-L${libdir}'
527 XSLT_INCLUDEDIR='-I${includedir}'
528 XSLT_LIBS="-lxslt $LIBXML_LIBS $M_LIBS"
529 AC_SUBST(XSLT_LIBDIR)
530 AC_SUBST(XSLT_INCLUDEDIR)
533 EXSLT_LIBDIR='-L${libdir}'
534 EXSLT_INCLUDEDIR='-I${includedir}'
535 EXSLT_LIBS="-lexslt $XSLT_LIBS $LIBGCRYPT_LIBS"
536 AC_SUBST(EXSLT_LIBDIR)
537 AC_SUBST(EXSLT_INCLUDEDIR)
540 EXTRA_LIBS="$EXTRA_LIBS $LIBXML_LIBS $M_LIBS"
545 dnl for the spec file
546 RELDATE=`date +'%a %b %e %Y'`
550 rm -f COPYING.LIB COPYING
551 $LN_S Copyright COPYING
561 libxslt/xsltwin32config.h
563 libexslt/exsltconfig.h
566 python/tests/Makefile
572 tests/general/Makefile
573 tests/reports/Makefile
574 tests/extensions/Makefile
575 tests/namespaces/Makefile
577 tests/numbers/Makefile
578 tests/documents/Makefile
579 tests/xmlspec/Makefile
580 tests/multiple/Makefile
581 tests/xinclude/Makefile
582 tests/XSLTMark/Makefile
583 tests/docbook/Makefile
585 tests/exslt/common/Makefile
586 tests/exslt/functions/Makefile
587 tests/exslt/math/Makefile
588 tests/exslt/sets/Makefile
589 tests/exslt/strings/Makefile
590 tests/exslt/date/Makefile
591 tests/exslt/dynamic/Makefile
592 tests/plugins/Makefile