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