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=22
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"
34 else if test -d .svn ; then
35 extra=`svn info | grep Revision | sed 's+Revision: ++'`
37 if test "$extra" != ""
39 LIBXSLT_VERSION_EXTRA="-SVN$extra"
44 AC_SUBST(LIBXSLT_MAJOR_VERSION)
45 AC_SUBST(LIBXSLT_MINOR_VERSION)
46 AC_SUBST(LIBXSLT_MICRO_VERSION)
47 AC_SUBST(LIBXSLT_VERSION)
48 AC_SUBST(LIBXSLT_VERSION_INFO)
49 AC_SUBST(LIBXSLT_VERSION_NUMBER)
50 AC_SUBST(LIBXSLT_VERSION_EXTRA)
51 AC_SUBST(LIBXSLT_MAJOR_MINOR_VERSION)
54 dnl libexslt is an extension library
57 LIBEXSLT_VERSION=$LIBEXSLT_MAJOR_VERSION.$LIBEXSLT_MINOR_VERSION.$LIBEXSLT_MICRO_VERSION
58 LIBEXSLT_VERSION_INFO=`expr $LIBEXSLT_MAJOR_VERSION + $LIBEXSLT_MINOR_VERSION`:$LIBEXSLT_MICRO_VERSION:$LIBEXSLT_MINOR_VERSION
60 LIBEXSLT_VERSION_NUMBER=`expr $LIBEXSLT_MAJOR_VERSION \* 10000 + $LIBEXSLT_MINOR_VERSION \* 100 + $LIBEXSLT_MICRO_VERSION`
62 if test -f CVS/Entries; then
63 LIBEXSLT_VERSION_EXTRA=-CVS`grep ChangeLog CVS/Entries | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
66 AC_SUBST(LIBEXSLT_MAJOR_VERSION)
67 AC_SUBST(LIBEXSLT_MINOR_VERSION)
68 AC_SUBST(LIBEXSLT_MICRO_VERSION)
69 AC_SUBST(LIBEXSLT_VERSION)
70 AC_SUBST(LIBEXSLT_VERSION_INFO)
71 AC_SUBST(LIBEXSLT_VERSION_NUMBER)
72 AC_SUBST(LIBEXSLT_VERSION_EXTRA)
74 VERSION=${LIBXSLT_VERSION}
76 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
80 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
83 dnl Specific dir for HTML output ?
86 if test "x$with_html_dir" = "x" ; then
87 HTML_DIR='$(prefix)/doc'
89 HTML_DIR=$with_html_dir
94 dnl Check the environment
101 AC_PATH_PROG(RM, rm, /bin/rm)
102 AC_PATH_PROG(MV, mv, /bin/mv)
103 AC_PATH_PROG(TAR, tar, /bin/tar)
112 AC_CHECK_HEADERS(sys/types.h sys/time.h stdlib.h unistd.h string.h)
113 AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h ansidecl.h)
114 AC_CHECK_HEADERS(sys/timeb.h time.h sys/stat.h sys/select.h stdarg.h)
115 AC_CHECK_FUNCS(stat _stat)
116 AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
117 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
119 AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
120 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
122 AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow,
123 [M_LIBS="-lm"; AC_DEFINE(HAVE_POW)]))
125 AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor,
126 [M_LIBS="-lm"; AC_DEFINE(HAVE_FLOOR)]))
128 AC_CHECK_FUNC(fabs, , AC_CHECK_LIB(m, fabs,
129 [M_LIBS="-lm"; AC_DEFINE(HAVE_FABS)]))
130 AC_CHECK_FUNCS(gettimeofday)
131 AC_CHECK_FUNCS(mktime localtime localtime_r asctime time gmtime_r ftime)
133 dnl Checking the standard string functions availability
134 AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
138 dnl Check for trio string functions
141 if test "${NEED_TRIO}" = "1" ; then
142 echo Reusing trio library for string functions
150 dnl Some packages need to be checked against version numbers so we
151 dnl define a function here for later use
153 AC_DEFUN([VERSION_TO_NUMBER],
154 [`$1 | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`])
157 dnl Perl is just needed for generating some data for XSLtmark
160 AC_CHECK_PROG(PERL, perl, perl, false)
161 AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
169 PYTHON_SITE_PACKAGES=
171 AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found])
172 if test "$with_python" != "no" ; then
173 if test -x "$with_python/bin/python"
175 echo Found python in $with_python/bin/python
176 PYTHON="$with_python/bin/python"
178 if test -x "$with_python"
180 echo Found python in $with_python
181 PYTHON="$with_python"
185 echo Found python in environment PYTHON=$PYTHON
186 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
188 AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
192 if test "$PYTHON" != ""
194 echo "PYTHON is pointing at $PYTHON"
195 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
196 echo Found Python version $PYTHON_VERSION
197 LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1
199 if test "$LIBXML2_PYTHON" = "1"
201 echo Found libxml2-python module
203 echo Warning: Missing libxml2-python
206 if test "$PYTHON_VERSION" != ""
208 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
209 -d $with_python/lib/python$PYTHON_VERSION/site-packages
211 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
212 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
214 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
216 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
217 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
219 if test -r /usr/include/python$PYTHON_VERSION/Python.h
221 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
222 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
224 echo could not find python$PYTHON_VERSION/Python.h
227 if test ! -d "$PYTHON_SITE_PACKAGES"
229 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
233 if test "$with_python" != ""
235 pythondir='$(PYTHON_SITE_PACKAGES)'
237 pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
240 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
241 if test "$PYTHON_INCLUDES" != ""
248 AC_SUBST(PYTHON_SUBDIR)
250 AC_ARG_WITH(crypto, [ --with-crypto Add crypto support to exslt (on)])
252 if test "$with_crypto" = "no" ; then
253 echo Disabling crypto support
257 AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
258 if test "$LIBGCRYPT_CONFIG" != "no" ; then
259 LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version`
260 if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42")
264 echo gcrypt library version < 1.1.42 - Crypto extensions will not be available.
266 LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
267 LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
268 AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
269 echo Crypto extensions will be available.
275 echo Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.
278 AC_SUBST(WITH_CRYPTO)
279 AC_SUBST(LIBGCRYPT_CFLAGS)
280 AC_SUBST(LIBGCRYPT_LIBS)
283 dnl Debug for DV (-Wunreachable-code)
285 if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ]] || \
286 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxslt" ]]
288 if test "${with_mem_debug}" = "" ;
292 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 "
293 if test "`uname -m`" != "x86_64" ;
295 STATIC_BINARIES="-static"
299 if test "$LOGNAME" = "veillard"
301 LIBXML_SRC="/u/veillard/XML"
302 EXTRA_LIBS="$EXTRA_LIBS -ldl"
307 AC_SUBST(STATIC_BINARIES)
309 AC_ARG_WITH(debug, [ --with-debug Add the debugging code (on)])
310 if test "$with_debug" = "no" ; then
311 echo Disabling debug support
316 AC_SUBST(WITH_XSLT_DEBUG)
318 AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
319 if test "$with_mem_debug" = "yes" ; then
320 echo Enabling memory debug support
325 AC_SUBST(WITH_MEM_DEBUG)
328 dnl Is debugger support requested
330 AC_ARG_WITH(with_debugger, [ --with-debugger Add the debugging support (on)])
331 if test "$with_debugger" = "no" ; then
332 echo Disabling debugger
335 echo Enabling debugger
337 AC_DEFINE(WITH_DEBUGGER)
339 AC_SUBST(WITH_DEBUGGER)
342 dnl The following new parameters were added to offer
343 dnl the ability to specify the location of the libxml
344 dnl library during linking and compilation.
346 dnl original work - Mathieu Lacage 30/03/2000
347 dnl some tweaking - David Härdeman 30/10/2001
350 LIBXML_CONFIG_PREFIX=""
353 AC_ARG_WITH(libxml-prefix,
354 [ --with-libxml-prefix=[PFX] Specify location of libxml config],
355 LIBXML_CONFIG_PREFIX=$withval
358 AC_ARG_WITH(libxml-include-prefix,
359 [ --with-libxml-include-prefix=[PFX] Specify location of libxml headers],
360 LIBXML_CFLAGS="-I$withval"
363 AC_ARG_WITH(libxml-libs-prefix,
364 [ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs],
365 LIBXML_LIBS="-L$withval"
368 AC_ARG_WITH(libxml-src,
369 [ --with-libxml-src=[DIR] For libxml thats not installed yet (sets all three above)],
370 LIBXML_SRC="$withval"
375 dnl where is xml2-config
378 AC_SUBST(LIBXML_REQUIRED_VERSION)
379 AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
380 if test "x$LIBXML_CONFIG_PREFIX" != "x"
382 XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config
384 XML_CONFIG=xml2-config
388 dnl imported from libxml2, c.f. #77827
390 if test "${GCC}" != "yes" ; then
393 CFLAGS="${CFLAGS} -Wp,-H30000"
396 CFLAGS="${CFLAGS} -ieee"
400 CFLAGS="${CFLAGS} -Wall"
403 CFLAGS="${CFLAGS} -mieee"
406 CFLAGS="${CFLAGS} -mieee"
412 dnl Override other variables if LIBXML_SRC is set
415 if test "x$LIBXML_SRC" != "x"
421 XML_CONFIG=${SRC_DIR}/xml2-config
422 LIBXML_CFLAGS="-I${SRC_DIR}/include"
423 LIBXML_LIBS="-L${SRC_DIR}"
426 AC_MSG_ERROR([libxml source dir not found (${LIBXML_SRC}), typo?])
431 dnl make sure xml2-config is executable,
432 dnl test version and init our variables
435 if ${XML_CONFIG} --libs print > /dev/null 2>&1
437 XMLVERS=`$XML_CONFIG --version`
438 if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
440 LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
441 LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
442 AC_MSG_RESULT($XMLVERS found)
444 AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
447 AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
456 [ --with-plugins Add plugin extension support (on)])
457 if test "$with_plugins" = ""
462 AC_MSG_CHECKING([whether shared libraries will be built (required for plugins)])
463 if test "$enable_shared" = "no" -a "$with_plugins" = "yes"; then
465 AC_MSG_WARN([Disabling plugin support.])
466 AC_MSG_WARN([Plugins require that shared libraries be built.])
472 if test "$with_plugins" = "yes" ; then
473 AC_MSG_CHECKING([libxml2 module support])
474 WITH_MODULES="`$XML_CONFIG --modules`"
475 if test "${WITH_MODULES}" = "1"; then
485 AC_SUBST(WITH_MODULES)
486 AM_CONDITIONAL(WITH_MODULES, test "$WITH_MODULES" = "1")
489 dnl setup default module path
491 module_prefix=$prefix
492 test "x$module_prefix" = xNONE && module_prefix=$ac_default_prefix
493 LIBXSLT_DEFAULT_PLUGINS_PATH="$module_prefix/lib/libxslt-plugins"
494 AC_SUBST(LIBXSLT_DEFAULT_PLUGINS_PATH)
497 dnl In build tree I use a static version with memory debug enabled
499 if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
500 if test "`uname -i`" != "x86_64" -a -e $HOME/XML/.libs/libxml2.a ;
502 LIBXML_LIBS="$HOME/XML/.libs/libxml2.a -lpthread -lz"
505 XSLTPROCDV="xsltproc.dv"
506 INSTALLED_XSLT_LIB=""
507 LIBXML_SRC="$HOME/XML/"
514 WIN32_EXTRA_LIBADD="-lwsock32"
515 WIN32_EXTRA_LDFLAGS="-no-undefined"
516 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
517 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
518 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
521 AC_SUBST(WIN32_EXTRA_LIBADD)
522 AC_SUBST(WIN32_EXTRA_LDFLAGS)
528 AC_SUBST(LIBXML_LIBS)
529 AC_SUBST(LIBXML_CFLAGS)
531 AC_SUBST(PYTHON_VERSION)
532 AC_SUBST(PYTHON_INCLUDES)
533 AC_SUBST(PYTHON_SITE_PACKAGES)
535 XSLT_LIBDIR='-L${libdir}'
536 XSLT_INCLUDEDIR='-I${includedir}'
537 XSLT_LIBS="-lxslt $LIBXML_LIBS $M_LIBS"
538 AC_SUBST(XSLT_LIBDIR)
539 AC_SUBST(XSLT_INCLUDEDIR)
542 EXSLT_LIBDIR='-L${libdir}'
543 EXSLT_INCLUDEDIR='-I${includedir}'
544 EXSLT_LIBS="-lexslt $XSLT_LIBS $LIBGCRYPT_LIBS"
545 AC_SUBST(EXSLT_LIBDIR)
546 AC_SUBST(EXSLT_INCLUDEDIR)
549 EXTRA_LIBS="$EXTRA_LIBS $LIBXML_LIBS $M_LIBS"
554 dnl for the spec file
555 RELDATE=`date +'%a %b %e %Y'`
559 rm -f COPYING.LIB COPYING
560 $LN_S Copyright COPYING
570 libxslt/xsltwin32config.h
572 libexslt/exsltconfig.h
575 python/tests/Makefile
581 tests/general/Makefile
582 tests/reports/Makefile
583 tests/extensions/Makefile
584 tests/namespaces/Makefile
586 tests/numbers/Makefile
587 tests/documents/Makefile
588 tests/xmlspec/Makefile
589 tests/multiple/Makefile
590 tests/xinclude/Makefile
591 tests/XSLTMark/Makefile
592 tests/docbook/Makefile
594 tests/exslt/common/Makefile
595 tests/exslt/functions/Makefile
596 tests/exslt/math/Makefile
597 tests/exslt/sets/Makefile
598 tests/exslt/strings/Makefile
599 tests/exslt/date/Makefile
600 tests/exslt/dynamic/Makefile
601 tests/plugins/Makefile