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=15
15 LIBEXSLT_MAJOR_VERSION=0
16 LIBEXSLT_MINOR_VERSION=8
17 LIBEXSLT_MICRO_VERSION=12
18 LIBXML_REQUIRED_VERSION=2.6.17 # if you need module support.
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
179 AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
183 if test "$PYTHON" != ""
185 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
186 echo Found Python version $PYTHON_VERSION
187 LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1
189 if test "$LIBXML2_PYTHON" = "1"
191 echo Found libxml2-python module
193 echo Warning: Missing libxml2-python
196 if test "$PYTHON_VERSION" != ""
198 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
199 -d $with_python/lib/python$PYTHON_VERSION/site-packages
201 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
202 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
204 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
206 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
207 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
209 if test -r /usr/include/python$PYTHON_VERSION/Python.h
211 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
212 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
214 echo could not find python$PYTHON_VERSION/Python.h
217 if test ! -d "$PYTHON_SITE_PACKAGES"
219 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
223 if test "$with_python" != ""
225 pythondir='$(PYTHON_SITE_PACKAGES)'
227 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
230 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
231 if test "$PYTHON_INCLUDES" != ""
238 AC_SUBST(PYTHON_SUBDIR)
240 AC_ARG_WITH(crypto, [ --with-crypto Add crypto support to exslt (on)])
242 if test "$with_crypto" = "no" ; then
243 echo Disabling crypto support
247 AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
248 if test "$LIBGCRYPT_CONFIG" != "no" ; then
249 LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version`
250 if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42")
254 echo gcrypt library version < 1.1.42 - Crypto extensions will not be available.
256 LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
257 LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
258 AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
259 echo Crypto extensions will be available.
265 echo Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.
268 AC_SUBST(WITH_CRYPTO)
269 AC_SUBST(LIBGCRYPT_CFLAGS)
270 AC_SUBST(LIBGCRYPT_LIBS)
273 dnl Debug for DV (-Wunreachable-code)
275 if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ]] || \
276 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xsltest" ]]
278 if test "${with_mem_debug}" = "" ;
282 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 "
283 if test "`uname -i`" != "x86_64" ;
285 STATIC_BINARIES="-static"
289 if test "$LOGNAME" = "veillard"
291 LIBXML_SRC="/u/veillard/XML"
292 EXTRA_LIBS="$EXTRA_LIBS -ldl"
297 AC_SUBST(STATIC_BINARIES)
299 AC_ARG_WITH(debug, [ --with-debug Add the debugging code (on)])
300 if test "$with_debug" = "no" ; then
301 echo Disabling debug support
306 AC_SUBST(WITH_XSLT_DEBUG)
308 AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
309 if test "$with_mem_debug" = "yes" ; then
310 echo Enabling memory debug support
315 AC_SUBST(WITH_MEM_DEBUG)
318 dnl Is debugger support requested
320 AC_ARG_WITH(with_debugger, [ --with-debugger Add the debugging support (on)])
321 if test "$with_debugger" = "no" ; then
322 echo Disabling debugger
325 echo Enabling debugger
327 AC_DEFINE(WITH_DEBUGGER)
329 AC_SUBST(WITH_DEBUGGER)
332 dnl The following new parameters were added to offer
333 dnl the ability to specify the location of the libxml
334 dnl library during linking and compilation.
336 dnl original work - Mathieu Lacage 30/03/2000
337 dnl some tweaking - David Härdeman 30/10/2001
340 LIBXML_CONFIG_PREFIX=""
343 AC_ARG_WITH(libxml-prefix,
344 [ --with-libxml-prefix=[PFX] Specify location of libxml config],
345 LIBXML_CONFIG_PREFIX=$withval
348 AC_ARG_WITH(libxml-include-prefix,
349 [ --with-libxml-include-prefix=[PFX] Specify location of libxml headers],
350 LIBXML_CFLAGS="-I$withval"
353 AC_ARG_WITH(libxml-libs-prefix,
354 [ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs],
355 LIBXML_LIBS="-L$withval"
358 AC_ARG_WITH(libxml-src,
359 [ --with-libxml-src=[DIR] For libxml thats not installed yet (sets all three above)],
360 LIBXML_SRC="$withval"
365 dnl where is xml2-config
368 AC_SUBST(LIBXML_REQUIRED_VERSION)
369 AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
370 if test "x$LIBXML_CONFIG_PREFIX" != "x"
372 XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config
374 XML_CONFIG=xml2-config
378 dnl imported from libxml2, c.f. #77827
380 if test "${GCC}" != "yes" ; then
383 CFLAGS="${CFLAGS} -Wp,-H30000"
386 CFLAGS="${CFLAGS} -ieee"
390 CFLAGS="${CFLAGS} -Wall"
393 CFLAGS="${CFLAGS} -mieee"
396 CFLAGS="${CFLAGS} -mieee"
402 dnl Override other variables if LIBXML_SRC is set
405 if test "x$LIBXML_SRC" != "x"
411 XML_CONFIG=${SRC_DIR}/xml2-config
412 LIBXML_CFLAGS="-I${SRC_DIR}/include"
413 LIBXML_LIBS="-L${SRC_DIR}"
416 AC_MSG_ERROR([libxml source dir not found (${LIBXML_SRC}), typo?])
421 dnl make sure xml2-config is executable,
422 dnl test version and init our variables
425 if ${XML_CONFIG} --libs print > /dev/null 2>&1
427 XMLVERS=`$XML_CONFIG --version`
428 if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
430 LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
431 LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
432 AC_MSG_RESULT($XMLVERS found)
434 AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
437 AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
446 [ --with-plugins Add plugin extension support (on)])
447 if test "$with_plugins" = ""
452 AC_MSG_CHECKING([whether shared libraries will be built (required for plugins)])
453 if test "$enable_shared" = "no" -a "$with_plugins" = "yes"; then
455 AC_MSG_WARN([Disabling plugin support.])
456 AC_MSG_WARN([Plugins require that shared libraries be built.])
462 if test "$with_plugins" = "yes" ; then
463 AC_MSG_CHECKING([libxml2 module support])
464 WITH_MODULES="`$XML_CONFIG --modules`"
465 if test "${WITH_MODULES}" = "1"; then
475 AC_SUBST(WITH_MODULES)
476 AM_CONDITIONAL(WITH_MODULES, test "$WITH_MODULES" == "1")
479 dnl setup default module path
481 module_prefix=$prefix
482 test "x$module_prefix" = xNONE && module_prefix=$ac_default_prefix
483 LIBXSLT_DEFAULT_PLUGINS_PATH="$module_prefix/lib/libxslt-plugins"
484 AC_SUBST(LIBXSLT_DEFAULT_PLUGINS_PATH)
487 dnl In build tree I use a static version with memory debug enabled
489 if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
490 if test "`uname -i`" != "x86_64" -a -e $HOME/XML/.libs/libxml2.a ;
492 LIBXML_LIBS="$HOME/XML/.libs/libxml2.a -lpthread -lz"
495 XSLTPROCDV="xsltproc.dv"
496 INSTALLED_XSLT_LIB=""
497 LIBXML_SRC="$HOME/XML/"
504 WIN32_EXTRA_LIBADD="-lwsock32"
505 WIN32_EXTRA_LDFLAGS="-no-undefined"
506 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
507 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
508 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
511 AC_SUBST(WIN32_EXTRA_LIBADD)
512 AC_SUBST(WIN32_EXTRA_LDFLAGS)
518 AC_SUBST(LIBXML_LIBS)
519 AC_SUBST(LIBXML_CFLAGS)
521 AC_SUBST(PYTHON_VERSION)
522 AC_SUBST(PYTHON_INCLUDES)
523 AC_SUBST(PYTHON_SITE_PACKAGES)
525 XSLT_LIBDIR='-L${libdir}'
526 XSLT_INCLUDEDIR='-I${includedir}'
527 XSLT_LIBS="-lxslt $LIBXML_LIBS $M_LIBS"
528 AC_SUBST(XSLT_LIBDIR)
529 AC_SUBST(XSLT_INCLUDEDIR)
532 EXSLT_LIBDIR='-L${libdir}'
533 EXSLT_INCLUDEDIR='-I${includedir}'
534 EXSLT_LIBS="-lexslt $XSLT_LIBS $LIBGCRYPT_LIBS"
535 AC_SUBST(EXSLT_LIBDIR)
536 AC_SUBST(EXSLT_INCLUDEDIR)
539 EXTRA_LIBS="$EXTRA_LIBS $LIBXML_LIBS $M_LIBS"
544 dnl for the spec file
545 RELDATE=`date +'%a %b %e %Y'`
549 rm -f COPYING.LIB COPYING
550 $LN_S Copyright COPYING
560 libxslt/xsltwin32config.h
562 libexslt/exsltconfig.h
565 python/tests/Makefile
571 tests/general/Makefile
572 tests/reports/Makefile
573 tests/extensions/Makefile
574 tests/namespaces/Makefile
576 tests/numbers/Makefile
577 tests/documents/Makefile
578 tests/xmlspec/Makefile
579 tests/multiple/Makefile
580 tests/xinclude/Makefile
581 tests/XSLTMark/Makefile
582 tests/docbook/Makefile
584 tests/exslt/common/Makefile
585 tests/exslt/functions/Makefile
586 tests/exslt/math/Makefile
587 tests/exslt/sets/Makefile
588 tests/exslt/strings/Makefile
589 tests/exslt/date/Makefile
590 tests/exslt/dynamic/Makefile
591 tests/plugins/Makefile