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=1
9 LIBXSLT_MICRO_VERSION=1
11 LIBEXSLT_MAJOR_VERSION=0
12 LIBEXSLT_MINOR_VERSION=8
13 LIBEXSLT_MICRO_VERSION=1
14 LIBXML_REQUIRED_VERSION=2.6.3
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)
45 VERSION=${LIBXSLT_VERSION}
47 AM_CONFIG_HEADER(config.h)
48 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
51 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
54 dnl Specific dir for HTML output ?
57 if test "x$with_html_dir" = "x" ; then
58 HTML_DIR='$(prefix)/doc'
60 HTML_DIR=$with_html_dir
65 dnl Check the environment
78 AC_CHECK_HEADERS(sys/types.h sys/time.h stdlib.h unistd.h string.h)
79 AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h ansidecl.h)
80 AC_CHECK_HEADERS(sys/timeb.h time.h sys/stat.h stdarg.h)
81 AC_CHECK_FUNCS(stat _stat)
82 AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
83 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
85 AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
86 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
88 AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow,
89 [M_LIBS="-lm"; AC_DEFINE(HAVE_POW)]))
91 AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor,
92 [M_LIBS="-lm"; AC_DEFINE(HAVE_FLOOR)]))
94 AC_CHECK_FUNC(fabs, , AC_CHECK_LIB(m, fabs,
95 [M_LIBS="-lm"; AC_DEFINE(HAVE_FABS)]))
96 AC_CHECK_FUNCS(gettimeofday)
97 AC_CHECK_FUNCS(mktime localtime asctime time gmtime ftime)
99 dnl Checking the standard string functions availability
100 AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
103 dnl Check for trio string functions
106 if test "${NEED_TRIO}" = "1" ; then
107 echo Reusing trio library for string functions
115 dnl Perl is just needed for generating some data for XSLtmark
118 AC_CHECK_PROG(PERL, perl, perl, false)
119 AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
128 PYTHON_SITE_PACKAGES=
130 AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found])
131 if test "$with_python" != "no" ; then
132 if test -x "$with_python/bin/python"
134 echo Found python in $with_python/bin/python
135 PYTHON="$with_python/bin/python"
137 if test -x "$with_python"
139 echo Found python in $with_python
140 PYTHON="$with_python"
142 AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
145 if test "$PYTHON" != ""
147 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
148 echo Found Python version $PYTHON_VERSION
149 LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1
151 if test "$LIBXML2_PYTHON" = "1"
153 echo Found libxml2-python module
155 echo Warning: Missing libxml2-python
158 if test "$PYTHON_VERSION" != ""
160 if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
161 -d $with_python/lib/python$PYTHON_VERSION/site-packages
163 PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
164 PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
166 if test -r $prefix/include/python$PYTHON_VERSION/Python.h
168 PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
169 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
171 if test -r /usr/include/python$PYTHON_VERSION/Python.h
173 PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
174 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
176 echo could not find python$PYTHON_VERSION/Python.h
179 if ! test -d "$PYTHON_SITE_PACKAGES"
181 PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
185 if test "$with_python" != ""
187 pythondir='$(PYTHON_SITE_PACKAGES)'
189 pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
192 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
193 if test "$PYTHON_INCLUDES" != ""
200 AC_SUBST(PYTHON_SUBDIR)
203 dnl Debug for DV (-Wunreachable-code)
205 if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ]] || \
206 [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/libxslt" ]]
208 if test "${with_mem_debug}" = "" ; then
211 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 "
212 STATIC_BINARIES="-static"
216 AC_SUBST(STATIC_BINARIES)
218 AC_ARG_WITH(debug, [ --with-debug Add the debugging code (on)])
219 if test "$with_debug" = "no" ; then
220 echo Disabling debug support
225 AC_SUBST(WITH_XSLT_DEBUG)
227 AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
228 if test "$with_mem_debug" = "yes" ; then
229 echo Enabling memory debug support
234 AC_SUBST(WITH_MEM_DEBUG)
237 dnl Is debugger support requested
239 AC_ARG_WITH(with_debugger, [ --with-debugger Add the debugging support (on)])
240 if test "$with_debugger" = "no" ; then
241 echo Disabling debugger
244 echo Enabling debugger
246 AC_DEFINE(WITH_DEBUGGER)
248 AC_SUBST(WITH_DEBUGGER)
251 dnl The following new parameters were added to offer
252 dnl the ability to specify the location of the libxml
253 dnl library during linking and compilation.
255 dnl original work - Mathieu Lacage 30/03/2000
256 dnl some tweaking - David Härdeman 30/10/2001
259 LIBXML_CONFIG_PREFIX=""
262 AC_ARG_WITH(libxml-prefix,
263 [ --with-libxml-prefix=[PFX] Specify location of libxml config],
264 LIBXML_CONFIG_PREFIX=$withval
267 AC_ARG_WITH(libxml-include-prefix,
268 [ --with-libxml-include-prefix=[PFX] Specify location of libxml headers],
269 LIBXML_CFLAGS="-I$withval"
272 AC_ARG_WITH(libxml-libs-prefix,
273 [ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs],
274 LIBXML_LIBS="-L$withval"
277 AC_ARG_WITH(libxml-src,
278 [ --with-libxml-src=[DIR] For libxml thats not installed yet (sets all three above)],
279 LIBXML_SRC="$withval"
284 dnl where is xml2-config
287 AC_SUBST(LIBXML_REQUIRED_VERSION)
288 AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
289 if test "x$LIBXML_CONFIG_PREFIX" != "x"
291 XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config
293 XML_CONFIG=xml2-config
297 dnl imported from libxml2, c.f. #77827
299 if test "${GCC}" != "yes" ; then
302 CFLAGS="${CFLAGS} -Wp,-H30000"
305 CFLAGS="${CFLAGS} -ieee"
309 CFLAGS="${CFLAGS} -Wall"
312 CFLAGS="${CFLAGS} -mieee"
315 CFLAGS="${CFLAGS} -mieee"
321 dnl Override other variables if LIBXML_SRC is set
324 if test "x$LIBXML_SRC" != "x"
330 XML_CONFIG=${SRC_DIR}/xml2-config
331 LIBXML_CFLAGS="-I${SRC_DIR}/include"
332 LIBXML_LIBS="-L${SRC_DIR}"
335 AC_MSG_ERROR([libxml source dir not found (${LIBXML_SRC}), typo?])
340 dnl make sure xml2-config is executable,
341 dnl test version and init our variables
344 AC_DEFUN(VERSION_TO_NUMBER,
345 [`$1 | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`])
346 if ${XML_CONFIG} --libs print > /dev/null 2>&1
348 XMLVERS=`$XML_CONFIG --version`
349 if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
351 LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
352 LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
353 AC_MSG_RESULT($XMLVERS found)
355 AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
358 AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
367 dnl In build tree I use a static version with memory debug enabled
369 if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
370 LIBXML_LIBS="../../XML/.libs/libxml2.a -lpthread -lz"
372 XSLTPROCDV="xsltproc.dv"
373 INSTALLED_XSLT_LIB=""
374 # PYTHONSODV="libxsltmod.so.dv"
381 WIN32_EXTRA_LIBADD="-lwsock32"
382 WIN32_EXTRA_LDFLAGS="-no-undefined"
383 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
384 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
385 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
388 AC_SUBST(WIN32_EXTRA_LIBADD)
389 AC_SUBST(WIN32_EXTRA_LDFLAGS)
395 AC_SUBST(LIBXML_LIBS)
396 AC_SUBST(LIBXML_CFLAGS)
398 AC_SUBST(PYTHON_VERSION)
399 AC_SUBST(PYTHON_INCLUDES)
400 AC_SUBST(PYTHON_SITE_PACKAGES)
402 XSLT_LIBDIR='-L${libdir}'
403 XSLT_INCLUDEDIR='-I${includedir}'
404 XSLT_LIBS="-lxslt $LIBXML_LIBS $M_LIBS"
405 AC_SUBST(XSLT_LIBDIR)
406 AC_SUBST(XSLT_INCLUDEDIR)
409 EXSLT_LIBDIR='-L${libdir}'
410 EXSLT_INCLUDEDIR='-I${includedir}'
411 EXSLT_LIBS="-lexslt $XSLT_LIBS"
412 AC_SUBST(EXSLT_LIBDIR)
413 AC_SUBST(EXSLT_INCLUDEDIR)
416 EXTRA_LIBS="$LIBXML_LIBS $M_LIBS"
421 dnl for the spec file
422 RELDATE=`date +'%a %b %e %Y'`
426 rm -f COPYING.LIB COPYING
427 $LN_S Copyright COPYING
437 libxslt/xsltwin32config.h
439 libexslt/exsltconfig.h
442 python/tests/Makefile
448 tests/general/Makefile
449 tests/reports/Makefile
450 tests/extensions/Makefile
451 tests/namespaces/Makefile
453 tests/numbers/Makefile
454 tests/documents/Makefile
455 tests/xmlspec/Makefile
456 tests/multiple/Makefile
457 tests/XSLTMark/Makefile
458 tests/docbook/Makefile
460 tests/exslt/common/Makefile
461 tests/exslt/functions/Makefile
462 tests/exslt/math/Makefile
463 tests/exslt/sets/Makefile
464 tests/exslt/strings/Makefile
465 tests/exslt/date/Makefile