Release of libxslt-1.1.26
[platform/upstream/libxslt.git] / configure.in
1 dnl Process this file with autoconf to produce a configuration script.
2 AC_PREREQ(2.2)
3 AC_INIT(libxslt/xslt.c)
4 AM_CONFIG_HEADER(config.h)
5 AC_CANONICAL_HOST
6 AC_GNU_SOURCE
7
8 dnl
9 dnl libxslt is the main part of the package
10 dnl libexslt is an extension
11 dnl
12 LIBXSLT_MAJOR_VERSION=1
13 LIBXSLT_MINOR_VERSION=1
14 LIBXSLT_MICRO_VERSION=26
15 PACKAGE=libxslt
16 LIBEXSLT_MAJOR_VERSION=0
17 LIBEXSLT_MINOR_VERSION=8
18 LIBEXSLT_MICRO_VERSION=15
19 LIBXML_REQUIRED_VERSION=2.6.27
20
21
22 LIBXSLT_VERSION=$LIBXSLT_MAJOR_VERSION.$LIBXSLT_MINOR_VERSION.$LIBXSLT_MICRO_VERSION
23 LIBXSLT_VERSION_INFO=`expr $LIBXSLT_MAJOR_VERSION + $LIBXSLT_MINOR_VERSION`:$LIBXSLT_MICRO_VERSION:$LIBXSLT_MINOR_VERSION
24
25 LIBXSLT_VERSION_NUMBER=`expr $LIBXSLT_MAJOR_VERSION \* 10000 + $LIBXSLT_MINOR_VERSION \* 100 + $LIBXSLT_MICRO_VERSION`
26 LIBXSLT_MAJOR_MINOR_VERSION=$LIBXSLT_MAJOR_VERSION.$LIBXSLT_MINOR_VERSION
27
28 if test -f CVS/Entries; then
29   extra=`grep ChangeLog CVS/Entries | grep -v LIBXSLT | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
30   echo extra=$extra
31   if test "$extra" != ""
32   then
33       LIBXSLT_VERSION_EXTRA="-CVS$extra"
34   fi
35 else if test -d .svn ; then
36   extra=`svn info | grep Revision | sed 's+Revision: ++'`
37   echo extra=$extra
38   if test "$extra" != ""
39   then
40       LIBXSLT_VERSION_EXTRA="-SVN$extra"
41   fi
42 else if test -d .git ; then
43   extra=`git describe | sed 's+LIBXSLT[[0-9.]]*-++'`
44   echo extra=$extra
45   if test "$extra" != ""
46   then
47       LIBXSLT_VERSION_EXTRA="-GIT$extra"
48   fi
49 fi
50 fi
51 fi
52
53 AC_SUBST(LIBXSLT_MAJOR_VERSION)
54 AC_SUBST(LIBXSLT_MINOR_VERSION)
55 AC_SUBST(LIBXSLT_MICRO_VERSION)
56 AC_SUBST(LIBXSLT_VERSION)
57 AC_SUBST(LIBXSLT_VERSION_INFO)
58 AC_SUBST(LIBXSLT_VERSION_NUMBER)
59 AC_SUBST(LIBXSLT_VERSION_EXTRA)
60 AC_SUBST(LIBXSLT_MAJOR_MINOR_VERSION)
61
62 dnl
63 dnl libexslt is an extension library
64 dnl
65
66 LIBEXSLT_VERSION=$LIBEXSLT_MAJOR_VERSION.$LIBEXSLT_MINOR_VERSION.$LIBEXSLT_MICRO_VERSION
67 LIBEXSLT_VERSION_INFO=`expr $LIBEXSLT_MAJOR_VERSION + $LIBEXSLT_MINOR_VERSION`:$LIBEXSLT_MICRO_VERSION:$LIBEXSLT_MINOR_VERSION
68
69 LIBEXSLT_VERSION_NUMBER=`expr $LIBEXSLT_MAJOR_VERSION \* 10000 + $LIBEXSLT_MINOR_VERSION \* 100 + $LIBEXSLT_MICRO_VERSION`
70
71 if test -f CVS/Entries; then
72   LIBEXSLT_VERSION_EXTRA=-CVS`grep ChangeLog CVS/Entries | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
73 fi
74
75 AC_SUBST(LIBEXSLT_MAJOR_VERSION)
76 AC_SUBST(LIBEXSLT_MINOR_VERSION)
77 AC_SUBST(LIBEXSLT_MICRO_VERSION)
78 AC_SUBST(LIBEXSLT_VERSION)
79 AC_SUBST(LIBEXSLT_VERSION_INFO)
80 AC_SUBST(LIBEXSLT_VERSION_NUMBER)
81 AC_SUBST(LIBEXSLT_VERSION_EXTRA)
82
83 VERSION=${LIBXSLT_VERSION}
84
85 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
86
87 # AM_MAINTAINER_MODE
88
89 dnl
90 dnl Specific dir for HTML output ?
91 dnl
92
93 AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
94             [path to base html directory, default $datadir/doc/html]),
95             [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
96
97 AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
98             [directory used under html-dir, default $PACKAGE-$VERSION/html]),
99             [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
100             [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
101
102 AC_SUBST(HTML_DIR)
103
104 dnl
105 dnl Check the environment
106 dnl
107
108 AC_ISC_POSIX
109 AC_PROG_CC
110 AC_PROG_INSTALL
111 AC_PROG_CPP
112 AC_PATH_PROG(RM, rm, /bin/rm)
113 AC_PATH_PROG(MV, mv, /bin/mv)
114 AC_PATH_PROG(TAR, tar, /bin/tar)
115 AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
116 AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
117
118 AC_STDC_HEADERS
119
120 AC_LIBTOOL_WIN32_DLL
121 AM_PROG_LIBTOOL
122
123
124 AC_CHECK_HEADERS(sys/types.h sys/time.h stdlib.h unistd.h string.h)
125
126 dnl
127 dnl if the system support linker version scripts for symbol versioning
128 dnl then add it
129 dnl
130 VERSION_SCRIPT_FLAGS=
131 $(/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null) && \
132     VERSION_SCRIPT_FLAGS=-Wl,--version-script=
133 test "`uname`" == "SunOS" && \
134     VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
135 AC_SUBST(VERSION_SCRIPT_FLAGS)
136 AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
137
138 dnl Look for pthread.h, needed for testThreads
139 THREAD_LIBS=""
140 AC_CHECK_HEADER(pthread.h,
141     AC_CHECK_LIB(pthread, pthread_join,[
142        AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
143        AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
144        THREAD_LIBS="-lpthread"]))
145
146 AC_SUBST(THREAD_LIBS)
147
148 dnl
149 dnl Detect supported locale
150 dnl
151
152 XSLT_LOCALE_XLOCALE=0
153 XSLT_LOCALE_WINAPI=0
154
155 AC_CHECK_HEADERS([locale.h xlocale.h])
156 if test $ac_cv_header_xlocale_h = yes; then
157 dnl
158 dnl Check for generic locale_t declaration
159 dnl
160 AC_MSG_CHECKING([if xlocale program link])
161 AC_LINK_IFELSE(AC_LANG_PROGRAM([[
162 #ifdef HAVE_LOCALE_H
163 #include <locale.h>
164 #endif
165 #ifdef HAVE_XLOCALE_H
166 #include <xlocale.h>
167 #endif
168 #ifdef HAVE_STRING_H
169 #include <string.h>
170 #endif
171 #ifdef HAVE_STDLIB_H
172 #include <stdlib.h>
173 #endif
174
175 #ifdef __GLIBC__
176 typedef __locale_t xsltLocale;
177 #else
178 typedef locale_t xsltLocale;
179 #endif
180 #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ <= 2
181 #define newlocale __newlocale
182 #define freelocale __freelocale
183 #define strxfrm_l __strxfrm_l
184 #define LC_COLLATE_MASK (1 << LC_COLLATE)
185 #endif
186 ]],[[
187     xsltLocale locale;
188     const char *src[[2]] = { "\xc3\x84rger", "Zeppelin" };
189     char *dst[[2]];
190     size_t len, r;
191     int i;
192
193     locale = newlocale(LC_COLLATE_MASK, "en_US.utf8", NULL);
194     if (locale == NULL) exit(1);
195     for (i=0; i<2; ++i) {
196         len = strxfrm_l(NULL, src[[i]], 0, locale) + 1;
197         dst[[i]] = malloc(len);
198         if(dst[[i]] == NULL) exit(1);
199         r = strxfrm_l(dst[[i]], src[[i]], len, locale);
200         if(r >= len) exit(1);
201     }
202     if (strcmp(dst[[0]], dst[[1]]) >= 0) exit(1);
203
204     exit(0);
205     return(0);
206 ]]),
207   [AC_MSG_RESULT(yes); XSLT_LOCALE_XLOCALE=1],
208   [AC_MSG_RESULT(no)]
209 )
210 else
211   case "$host" in
212     *-*-mingw*)
213       AC_MSG_NOTICE([using winapi locale])
214       XSLT_LOCALE_WINAPI=1;;
215   esac
216 fi
217
218 AC_SUBST(XSLT_LOCALE_XLOCALE)
219 AC_SUBST(XSLT_LOCALE_WINAPI)
220
221 dnl
222 dnl Math detection
223 dnl
224
225 AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h ansidecl.h)
226 AC_CHECK_HEADERS(sys/timeb.h time.h sys/stat.h sys/select.h stdarg.h)
227 AC_CHECK_FUNCS(stat _stat)
228 AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
229   [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
230
231 AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
232   [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
233
234 AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow,
235   [M_LIBS="-lm"; AC_DEFINE(HAVE_POW)]))
236
237 AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor,
238   [M_LIBS="-lm"; AC_DEFINE(HAVE_FLOOR)]))
239
240 AC_CHECK_FUNC(fabs, , AC_CHECK_LIB(m, fabs,
241   [M_LIBS="-lm"; AC_DEFINE(HAVE_FABS)]))
242 AC_CHECK_FUNCS(gettimeofday)
243 AC_CHECK_FUNCS(mktime localtime localtime_r asctime time gmtime_r ftime)
244
245 dnl Checking the standard string functions availability
246 AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
247                NEED_TRIO=1)
248
249 dnl
250 dnl Check for trio string functions
251 dnl
252
253 if test "${NEED_TRIO}" = "1" ; then
254     echo Reusing trio library for string functions
255     WITH_TRIO=1
256 else    
257     WITH_TRIO=0
258 fi
259 AC_SUBST(WITH_TRIO)
260
261 dnl
262 dnl Some packages need to be checked against version numbers so we
263 dnl define a function here for later use
264 dnl
265 AC_DEFUN([VERSION_TO_NUMBER],
266 [`$1 | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`])
267
268 dnl
269 dnl Perl is just needed for generating some data for XSLtmark
270 dnl
271
272 AC_CHECK_PROG(PERL, perl, perl, false)
273 AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
274
275 dnl
276 dnl check for python
277 dnl
278
279 PYTHON_VERSION=
280 PYTHON_INCLUDES=
281 PYTHON_SITE_PACKAGES=
282 pythondir=
283 AC_ARG_WITH(python, [  --with-python[=DIR]    Build Python bindings if found])
284 if test "$with_python" != "no" ; then
285     if test -x "$with_python/bin/python"
286     then
287         echo Found python in $with_python/bin/python
288         PYTHON="$with_python/bin/python"
289     else
290         if test -x "$with_python"
291         then
292             echo Found python in $with_python
293             PYTHON="$with_python"
294         else
295             if test -x "$PYTHON"
296             then
297                 echo Found python in environment PYTHON=$PYTHON
298                 with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
299             else
300                 AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
301             fi
302         fi
303     fi
304     if test "$PYTHON" != ""
305     then
306         echo "PYTHON is pointing at $PYTHON"
307         PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
308         echo Found Python version $PYTHON_VERSION
309         LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1
310 except: print 0"`
311         if test "$LIBXML2_PYTHON" = "1"
312         then
313             echo Found libxml2-python module
314         else
315             echo Warning: Missing libxml2-python
316         fi
317     fi
318     if test "$PYTHON_VERSION" != ""
319     then
320         if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
321            -d $with_python/lib/python$PYTHON_VERSION/site-packages
322         then
323             PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
324             PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
325         else
326             if test -r $prefix/include/python$PYTHON_VERSION/Python.h
327             then
328                 PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
329                 PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
330             else
331                 if test -r /usr/include/python$PYTHON_VERSION/Python.h
332                 then
333                     PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
334                     PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
335                 else
336                     echo could not find python$PYTHON_VERSION/Python.h
337                 fi
338             fi
339             if test ! -d "$PYTHON_SITE_PACKAGES"
340             then
341                     PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
342             fi
343         fi
344     fi
345     if test "$with_python" != ""
346     then
347         pythondir='$(PYTHON_SITE_PACKAGES)'
348     else
349         pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
350     fi
351 fi
352 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
353 if test "$PYTHON_INCLUDES" != ""
354 then
355     PYTHON_SUBDIR=python
356 else
357     PYTHON_SUBDIR=
358 fi
359 AC_SUBST(pythondir)
360 AC_SUBST(PYTHON_SUBDIR)
361
362 AC_ARG_WITH(crypto, [  --with-crypto           Add crypto support to exslt (on)])
363 WITH_CRYPTO=0
364 if test "$with_crypto" = "no" ; then
365     echo Disabling crypto support
366     LIBGCRYPT_CFLAGS=""
367     LIBGCRYPT_LIBS=""
368 else
369     AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
370     if test "$LIBGCRYPT_CONFIG" != "no" ; then
371       LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version`
372       if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42")
373       then
374         LIBGCRYPT_CFLAGS=""
375         LIBGCRYPT_LIBS=""
376         echo 'gcrypt library version < 1.1.42 - Crypto extensions will not be available.'
377       else
378         LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
379         LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
380         AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
381         echo 'Crypto extensions will be available.'
382                 WITH_CRYPTO=1
383       fi
384     else
385       LIBGCRYPT_CFLAGS=""
386       LIBGCRYPT_LIBS=""
387       echo 'Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.'
388     fi
389 fi
390 AC_SUBST(WITH_CRYPTO)
391 AC_SUBST(LIBGCRYPT_CFLAGS)
392 AC_SUBST(LIBGCRYPT_LIBS)
393
394 dnl
395 dnl Debug for DV (-Wunreachable-code)
396 dnl
397 if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ]] || \
398    [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxslt" ]]
399    then
400     if test "${with_mem_debug}" = "" ;
401     then
402         with_mem_debug="yes"
403     fi
404     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 "
405     if test "`uname -m`" != "x86_64" ;
406     then
407         STATIC_BINARIES="-static"
408     else
409         STATIC_BINARIES="-static"
410     fi
411     if test "$LOGNAME" = "veillard"
412     then
413         LIBXML_SRC="/u/veillard/XML"
414         EXTRA_LIBS="$EXTRA_LIBS -ldl"
415     fi
416 else
417     STATIC_BINARIES=
418 fi
419 AC_SUBST(STATIC_BINARIES)
420
421 AC_ARG_WITH(debug, [  --with-debug            Add the debugging code (on)])
422 if test "$with_debug" = "no" ; then
423     echo Disabling debug support
424     WITH_XSLT_DEBUG=0
425 else    
426     WITH_XSLT_DEBUG=1
427 fi
428 AC_SUBST(WITH_XSLT_DEBUG)
429
430 AC_ARG_WITH(mem_debug, [  --with-mem-debug        Add the memory debugging module (off)])
431 if test "$with_mem_debug" = "yes" ; then
432     echo Enabling memory debug support
433     WITH_MEM_DEBUG=1
434 else    
435     WITH_MEM_DEBUG=0
436 fi
437 AC_SUBST(WITH_MEM_DEBUG)
438
439 dnl 
440 dnl Is debugger support requested
441 dnl
442 AC_ARG_WITH(debugger, [  --with-debugger        Add the debugging support (on)])
443 if test "$with_debugger" = "no" ; then
444     echo Disabling debugger
445     WITH_DEBUGGER=0
446 else
447     echo Enabling debugger
448     WITH_DEBUGGER=1
449     AC_DEFINE(WITH_DEBUGGER)
450 fi
451 AC_SUBST(WITH_DEBUGGER)
452
453 dnl
454 dnl The following new parameters were added to offer
455 dnl the ability to specify the location of the libxml
456 dnl library during linking and compilation.
457 dnl
458 dnl original work - Mathieu Lacage 30/03/2000
459 dnl some tweaking - David Härdeman 30/10/2001
460 dnl
461
462 LIBXML_CONFIG_PREFIX=""
463 LIBXML_SRC=""
464
465 AC_ARG_WITH(libxml-prefix,
466         [  --with-libxml-prefix=[PFX]           Specify location of libxml config],
467         LIBXML_CONFIG_PREFIX=$withval
468 )
469         
470 AC_ARG_WITH(libxml-include-prefix,
471         [  --with-libxml-include-prefix=[PFX]   Specify location of libxml headers],
472         LIBXML_CFLAGS="-I$withval"
473 )
474
475 AC_ARG_WITH(libxml-libs-prefix,
476         [  --with-libxml-libs-prefix=[PFX]      Specify location of libxml libs],
477         LIBXML_LIBS="-L$withval"
478 )
479
480 AC_ARG_WITH(libxml-src,
481         [  --with-libxml-src=[DIR]              For libxml thats not installed yet (sets all three above)],
482         LIBXML_SRC="$withval"
483 )
484 AC_SUBST(LIBXML_SRC)
485
486 dnl
487 dnl where is xml2-config
488 dnl
489
490 AC_SUBST(LIBXML_REQUIRED_VERSION)
491 AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION) 
492 if test "x$LIBXML_CONFIG_PREFIX" != "x"
493 then
494         XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config
495 else
496         XML_CONFIG=xml2-config
497 fi
498
499 dnl
500 dnl imported from libxml2, c.f. #77827 
501 dnl
502 if test "${GCC}" != "yes" ; then
503     case "${host}" in
504           *-*-hpux* )
505                CFLAGS="${CFLAGS} -Wp,-H30000"
506                ;;
507           *-dec-osf* )
508                CFLAGS="${CFLAGS} -ieee"
509                ;;
510     esac
511 else
512     CFLAGS="${CFLAGS} -Wall"
513     case "${host}" in
514           alpha*-*-linux* )
515                CFLAGS="${CFLAGS} -mieee"
516                ;;
517           alpha*-*-osf* )
518                CFLAGS="${CFLAGS} -mieee"
519                ;;
520     esac
521 fi
522
523 dnl
524 dnl Override other variables if LIBXML_SRC is set
525 dnl
526
527 if test "x$LIBXML_SRC" != "x"
528 then
529         CWD=`pwd`
530         if cd $LIBXML_SRC
531         then
532                 SRC_DIR=`pwd`
533                 XML_CONFIG=${SRC_DIR}/xml2-config
534                 LIBXML_CFLAGS="-I${SRC_DIR}/include"
535                 LIBXML_LIBS="-L${SRC_DIR}"
536                 cd $CWD
537         else
538                 AC_MSG_ERROR([libxml source dir not found (${LIBXML_SRC}), typo?])
539         fi
540 fi
541
542 dnl
543 dnl make sure xml2-config is executable,
544 dnl test version and init our variables
545 dnl
546
547 if ${XML_CONFIG} --libs print > /dev/null 2>&1
548 then
549         XMLVERS=`$XML_CONFIG --version`
550         if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
551         then
552                 LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
553                 LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
554                 AC_MSG_RESULT($XMLVERS found)
555         else
556                 AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
557         fi
558 else
559         AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
560 fi
561
562
563 AC_SUBST(CFLAGS)
564 AC_SUBST(CPPFLAGS)
565 AC_SUBST(LDFLAGS)
566
567 AC_ARG_WITH(plugins,
568 [  --with-plugins          Add plugin extension support (on)])
569 if test "$with_plugins" = ""
570 then
571     with_plugins=yes
572 fi
573
574 AC_MSG_CHECKING([whether shared libraries will be built (required for plugins)])
575 if test "$enable_shared" = "no" -a "$with_plugins" = "yes"; then
576          AC_MSG_RESULT(no)
577          AC_MSG_WARN([Disabling plugin support.])
578          AC_MSG_WARN([Plugins require that shared libraries be built.])
579          with_plugins=no
580 else
581          AC_MSG_RESULT(yes)
582 fi
583
584 if test "$with_plugins" = "yes" ; then
585   AC_MSG_CHECKING([libxml2 module support])
586   WITH_MODULES="`$XML_CONFIG --modules`"
587   if test "${WITH_MODULES}" = "1"; then
588     AC_MSG_RESULT(yes)
589   else
590     AC_MSG_RESULT(no)
591     WITH_MODULES="0"
592   fi
593 else
594   WITH_MODULES="0"
595 fi
596
597 AC_SUBST(WITH_MODULES)
598 AM_CONDITIONAL(WITH_MODULES, test "$WITH_MODULES" = "1")
599
600 dnl
601 dnl setup default module path
602 dnl
603 module_prefix=$prefix
604 test "x$module_prefix" = xNONE && module_prefix=$ac_default_prefix
605 LIBXSLT_DEFAULT_PLUGINS_PATH="$module_prefix/lib/libxslt-plugins"
606 AC_SUBST(LIBXSLT_DEFAULT_PLUGINS_PATH)
607
608 dnl
609 dnl In build tree I use a static version with memory debug enabled
610 dnl
611 if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
612 dnl    if test "`uname -i`" != "x86_64" -a -e $HOME/XML/.libs/libxml2.a ;
613     if test -e $HOME/XML/.libs/libxml2.a ;
614     then
615         LIBXML_LIBS="$HOME/XML/.libs/libxml2.a -lpthread -lz"
616     fi
617     DV_LINK="1"
618     XSLTPROCDV="xsltproc.dv"
619     INSTALLED_XSLT_LIB=""
620     LIBXML_SRC="$HOME/XML/"
621 fi
622
623 WIN32_EXTRA_LIBADD=
624 WIN32_EXTRA_LDFLAGS=
625 case "$host" in
626  *-*-cygwin*)
627  WIN32_EXTRA_LDFLAGS="-no-undefined"
628  ;;
629  *-*-mingw*)
630  WIN32_EXTRA_LIBADD="-lwsock32"
631  WIN32_EXTRA_LDFLAGS="-no-undefined"
632  AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
633  AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
634  AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
635  ;;
636 esac
637 AC_SUBST(WIN32_EXTRA_LIBADD)
638 AC_SUBST(WIN32_EXTRA_LDFLAGS)
639
640
641 AC_SUBST(XSLTPROCDV)
642 AC_SUBST(PYTHONSODV)
643 AC_SUBST(XML_CONFIG)
644 AC_SUBST(LIBXML_LIBS)
645 AC_SUBST(LIBXML_CFLAGS)
646 AC_SUBST(PYTHON)
647 AC_SUBST(PYTHON_VERSION)
648 AC_SUBST(PYTHON_INCLUDES)
649 AC_SUBST(PYTHON_SITE_PACKAGES)
650
651 XSLT_LIBDIR='-L${libdir}'
652 XSLT_INCLUDEDIR='-I${includedir}'
653 XSLT_LIBS="-lxslt $LIBXML_LIBS $M_LIBS"
654 AC_SUBST(XSLT_LIBDIR)
655 AC_SUBST(XSLT_INCLUDEDIR)
656 AC_SUBST(XSLT_LIBS)
657
658 EXSLT_LIBDIR='-L${libdir}'
659 EXSLT_INCLUDEDIR='-I${includedir}'
660 EXSLT_LIBS="-lexslt $XSLT_LIBS $LIBGCRYPT_LIBS"
661 AC_SUBST(EXSLT_LIBDIR)
662 AC_SUBST(EXSLT_INCLUDEDIR)
663 AC_SUBST(EXSLT_LIBS)
664
665 EXTRA_LIBS="$EXTRA_LIBS $LIBXML_LIBS $M_LIBS"
666 AC_SUBST(EXTRA_LIBS)
667
668 AC_SUBST(M_LIBS)
669
670 dnl for the spec file
671 RELDATE=`date +'%a %b %e %Y'`
672 AC_SUBST(RELDATE)
673
674 ( cd $srcdir
675 rm -f COPYING.LIB COPYING
676 $LN_S Copyright COPYING
677 )
678
679
680 AC_OUTPUT([
681 Makefile
682 libxslt.pc
683 libexslt.pc
684 libxslt/Makefile
685 libxslt/xsltconfig.h
686 libxslt/xsltwin32config.h
687 libexslt/Makefile
688 libexslt/exsltconfig.h
689 xsltproc/Makefile
690 python/Makefile
691 python/tests/Makefile
692 tests/Makefile
693 tests/docs/Makefile
694 tests/REC1/Makefile
695 tests/REC2/Makefile
696 tests/REC/Makefile
697 tests/general/Makefile
698 tests/reports/Makefile
699 tests/extensions/Makefile
700 tests/namespaces/Makefile
701 tests/keys/Makefile
702 tests/numbers/Makefile
703 tests/documents/Makefile
704 tests/xmlspec/Makefile
705 tests/multiple/Makefile
706 tests/xinclude/Makefile
707 tests/XSLTMark/Makefile
708 tests/docbook/Makefile
709 tests/exslt/Makefile
710 tests/exslt/common/Makefile
711 tests/exslt/functions/Makefile
712 tests/exslt/math/Makefile
713 tests/exslt/sets/Makefile
714 tests/exslt/strings/Makefile
715 tests/exslt/date/Makefile
716 tests/exslt/dynamic/Makefile
717 tests/plugins/Makefile
718 doc/Makefile
719 xslt-config
720 libxslt.spec
721 ])