source: trunk/third/libxslt/configure.in @ 20733

Revision 20733, 13.8 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r20732, which included commits to RCS files with non-trunk default branches.
Line 
1dnl Process this file with autoconf to produce a configuration script.
2AC_PREREQ(2.2)
3AC_INIT(libxslt/xslt.c)
4AM_CONFIG_HEADER(config.h)
5AC_CANONICAL_HOST
6
7dnl
8dnl libxslt is the main part of the package
9dnl libexslt is an extension
10dnl
11LIBXSLT_MAJOR_VERSION=1
12LIBXSLT_MINOR_VERSION=1
13LIBXSLT_MICRO_VERSION=10
14PACKAGE=libxslt
15LIBEXSLT_MAJOR_VERSION=0
16LIBEXSLT_MINOR_VERSION=8
17LIBEXSLT_MICRO_VERSION=8
18LIBXML_REQUIRED_VERSION=2.6.8
19
20
21LIBXSLT_VERSION=$LIBXSLT_MAJOR_VERSION.$LIBXSLT_MINOR_VERSION.$LIBXSLT_MICRO_VERSION
22LIBXSLT_VERSION_INFO=`expr $LIBXSLT_MAJOR_VERSION + $LIBXSLT_MINOR_VERSION`:$LIBXSLT_MICRO_VERSION:$LIBXSLT_MINOR_VERSION
23
24LIBXSLT_VERSION_NUMBER=`expr $LIBXSLT_MAJOR_VERSION \* 10000 + $LIBXSLT_MINOR_VERSION \* 100 + $LIBXSLT_MICRO_VERSION`
25
26if test -f CVS/Entries; then
27  extra=`grep ChangeLog CVS/Entries | grep -v LIBXSLT | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
28  echo extra=$extra
29  if test "$extra" != ""
30  then
31      LIBXSLT_VERSION_EXTRA="-CVS$extra"
32  fi
33fi
34
35AC_SUBST(LIBXSLT_MAJOR_VERSION)
36AC_SUBST(LIBXSLT_MINOR_VERSION)
37AC_SUBST(LIBXSLT_MICRO_VERSION)
38AC_SUBST(LIBXSLT_VERSION)
39AC_SUBST(LIBXSLT_VERSION_INFO)
40AC_SUBST(LIBXSLT_VERSION_NUMBER)
41AC_SUBST(LIBXSLT_VERSION_EXTRA)
42
43dnl
44dnl libexslt is an extension library
45dnl
46
47LIBEXSLT_VERSION=$LIBEXSLT_MAJOR_VERSION.$LIBEXSLT_MINOR_VERSION.$LIBEXSLT_MICRO_VERSION
48LIBEXSLT_VERSION_INFO=`expr $LIBEXSLT_MAJOR_VERSION + $LIBEXSLT_MINOR_VERSION`:$LIBEXSLT_MICRO_VERSION:$LIBEXSLT_MINOR_VERSION
49
50LIBEXSLT_VERSION_NUMBER=`expr $LIBEXSLT_MAJOR_VERSION \* 10000 + $LIBEXSLT_MINOR_VERSION \* 100 + $LIBEXSLT_MICRO_VERSION`
51
52if test -f CVS/Entries; then
53  LIBEXSLT_VERSION_EXTRA=-CVS`grep ChangeLog CVS/Entries | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
54fi
55
56AC_SUBST(LIBEXSLT_MAJOR_VERSION)
57AC_SUBST(LIBEXSLT_MINOR_VERSION)
58AC_SUBST(LIBEXSLT_MICRO_VERSION)
59AC_SUBST(LIBEXSLT_VERSION)
60AC_SUBST(LIBEXSLT_VERSION_INFO)
61AC_SUBST(LIBEXSLT_VERSION_NUMBER)
62AC_SUBST(LIBEXSLT_VERSION_EXTRA)
63
64VERSION=${LIBXSLT_VERSION}
65
66AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
67
68# AM_MAINTAINER_MODE
69
70AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
71
72dnl
73dnl Specific dir for HTML output ?
74dnl
75
76if test "x$with_html_dir" = "x" ; then
77  HTML_DIR='$(prefix)/doc'
78else
79  HTML_DIR=$with_html_dir
80fi
81AC_SUBST(HTML_DIR)
82
83dnl
84dnl Check the environment
85dnl
86
87AC_ISC_POSIX
88AC_PROG_CC
89AC_PROG_INSTALL
90AC_PROG_CPP
91AC_PATH_PROG(RM, rm, /bin/rm)
92AC_PATH_PROG(MV, mv, /bin/mv)
93AC_PATH_PROG(TAR, tar, /bin/tar)
94
95AC_STDC_HEADERS
96AM_PROG_LIBTOOL
97
98dnl
99dnl Math detection
100dnl
101
102AC_CHECK_HEADERS(sys/types.h sys/time.h stdlib.h unistd.h string.h)
103AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h ansidecl.h)
104AC_CHECK_HEADERS(sys/timeb.h time.h sys/stat.h sys/select.h stdarg.h)
105AC_CHECK_FUNCS(stat _stat)
106AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
107  [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
108
109AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
110  [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
111
112AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow,
113  [M_LIBS="-lm"; AC_DEFINE(HAVE_POW)]))
114
115AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor,
116  [M_LIBS="-lm"; AC_DEFINE(HAVE_FLOOR)]))
117
118AC_CHECK_FUNC(fabs, , AC_CHECK_LIB(m, fabs,
119  [M_LIBS="-lm"; AC_DEFINE(HAVE_FABS)]))
120AC_CHECK_FUNCS(gettimeofday)
121AC_CHECK_FUNCS(mktime localtime localtime_r asctime time gmtime ftime)
122
123dnl Checking the standard string functions availability
124AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
125               NEED_TRIO=1)
126dnl
127dnl Check for trio string functions
128dnl
129
130if test "${NEED_TRIO}" = "1" ; then
131    echo Reusing trio library for string functions
132    WITH_TRIO=1
133else   
134    WITH_TRIO=0
135fi
136AC_SUBST(WITH_TRIO)
137
138dnl
139dnl Some packages need to be checked against version numbers so we
140dnl define a function here for later use
141dnl
142AC_DEFUN(VERSION_TO_NUMBER,
143[`$1 | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`])
144
145dnl
146dnl Perl is just needed for generating some data for XSLtmark
147dnl
148
149AC_CHECK_PROG(PERL, perl, perl, false)
150AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
151
152dnl
153dnl check for python
154dnl
155
156PYTHON=
157PYTHON_VERSION=
158PYTHON_INCLUDES=
159PYTHON_SITE_PACKAGES=
160pythondir=
161AC_ARG_WITH(python, [  --with-python[=DIR]    Build Python bindings if found])
162if test "$with_python" != "no" ; then
163    if test -x "$with_python/bin/python"
164    then
165        echo Found python in $with_python/bin/python
166        PYTHON="$with_python/bin/python"
167    else
168        if test -x "$with_python"
169        then
170            echo Found python in $with_python
171            PYTHON="$with_python"
172        else
173            AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
174        fi
175    fi
176    if test "$PYTHON" != ""
177    then
178        PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
179        echo Found Python version $PYTHON_VERSION
180        LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1
181except: print 0"`
182        if test "$LIBXML2_PYTHON" = "1"
183        then
184            echo Found libxml2-python module
185        else
186            echo Warning: Missing libxml2-python
187        fi
188    fi
189    if test "$PYTHON_VERSION" != ""
190    then
191        if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
192           -d $with_python/lib/python$PYTHON_VERSION/site-packages
193        then
194            PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
195            PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
196        else
197            if test -r $prefix/include/python$PYTHON_VERSION/Python.h
198            then
199                PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
200                PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
201            else
202                if test -r /usr/include/python$PYTHON_VERSION/Python.h
203                then
204                    PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
205                    PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
206                else
207                    echo could not find python$PYTHON_VERSION/Python.h
208                fi
209            fi
210            if test ! -d "$PYTHON_SITE_PACKAGES"
211            then
212                    PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
213            fi
214        fi
215    fi
216    if test "$with_python" != ""
217    then
218        pythondir='$(PYTHON_SITE_PACKAGES)'
219    else
220        pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
221    fi
222fi
223AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
224if test "$PYTHON_INCLUDES" != ""
225then
226    PYTHON_SUBDIR=python
227else
228    PYTHON_SUBDIR=
229fi
230AC_SUBST(pythondir)
231AC_SUBST(PYTHON_SUBDIR)
232
233AC_ARG_WITH(crypto, [  --with-crypto           Add crypto support to exslt (on)])
234WITH_CRYPTO=0
235if test "$with_crypto" = "no" ; then
236    echo Disabling crypto support
237    LIBGCRYPT_CFLAGS=""
238    LIBGCRYPT_LIBS=""
239else
240    AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
241    if test "$LIBGCRYPT_CONFIG" != "no" ; then
242      LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version`
243      if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42")
244      then
245        LIBGCRYPT_CFLAGS=""
246        LIBGCRYPT_LIBS=""
247        echo gcrypt library version < 1.1.42 - Crypto extensions will not be available.
248      else
249        LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
250        LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
251        AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
252        echo Crypto extensions will be available.
253                WITH_CRYPTO=1
254      fi
255    else
256      LIBGCRYPT_CFLAGS=""
257      LIBGCRYPT_LIBS=""
258      echo Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.
259    fi
260fi
261AC_SUBST(WITH_CRYPTO)
262AC_SUBST(LIBGCRYPT_CFLAGS)
263AC_SUBST(LIBGCRYPT_LIBS)
264
265dnl
266dnl Debug for DV (-Wunreachable-code)
267dnl
268if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ]] || \
269   [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xsltest" ]]
270   then
271    if test "${with_mem_debug}" = "" ;
272    then
273        with_mem_debug="yes"
274    fi
275    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 "
276    STATIC_BINARIES="-static"
277    if test "$LOGNAME" = "veillard"
278    then
279        LIBXML_SRC="/u/veillard/XML"
280    fi
281else
282    STATIC_BINARIES=
283fi
284AC_SUBST(STATIC_BINARIES)
285
286AC_ARG_WITH(debug, [  --with-debug            Add the debugging code (on)])
287if test "$with_debug" = "no" ; then
288    echo Disabling debug support
289    WITH_XSLT_DEBUG=0
290else   
291    WITH_XSLT_DEBUG=1
292fi
293AC_SUBST(WITH_XSLT_DEBUG)
294
295AC_ARG_WITH(mem_debug, [  --with-mem-debug        Add the memory debugging module (off)])
296if test "$with_mem_debug" = "yes" ; then
297    echo Enabling memory debug support
298    WITH_MEM_DEBUG=1
299else   
300    WITH_MEM_DEBUG=0
301fi
302AC_SUBST(WITH_MEM_DEBUG)
303
304dnl
305dnl Is debugger support requested
306dnl
307AC_ARG_WITH(with_debugger, [  --with-debugger        Add the debugging support (on)])
308if test "$with_debugger" = "no" ; then
309    echo Disabling debugger
310    WITH_DEBUGGER=0
311else
312    echo Enabling debugger
313    WITH_DEBUGGER=1
314    AC_DEFINE(WITH_DEBUGGER)
315fi
316AC_SUBST(WITH_DEBUGGER)
317
318dnl
319dnl The following new parameters were added to offer
320dnl the ability to specify the location of the libxml
321dnl library during linking and compilation.
322dnl
323dnl original work - Mathieu Lacage 30/03/2000
324dnl some tweaking - David Härdeman 30/10/2001
325dnl
326
327LIBXML_CONFIG_PREFIX=""
328LIBXML_SRC=""
329
330AC_ARG_WITH(libxml-prefix,
331        [  --with-libxml-prefix=[PFX]           Specify location of libxml config],
332        LIBXML_CONFIG_PREFIX=$withval
333)
334       
335AC_ARG_WITH(libxml-include-prefix,
336        [  --with-libxml-include-prefix=[PFX]   Specify location of libxml headers],
337        LIBXML_CFLAGS="-I$withval"
338)
339
340AC_ARG_WITH(libxml-libs-prefix,
341        [  --with-libxml-libs-prefix=[PFX]      Specify location of libxml libs],
342        LIBXML_LIBS="-L$withval"
343)
344
345AC_ARG_WITH(libxml-src,
346        [  --with-libxml-src=[DIR]              For libxml thats not installed yet (sets all three above)],
347        LIBXML_SRC="$withval"
348)
349AC_SUBST(LIBXML_SRC)
350
351dnl
352dnl where is xml2-config
353dnl
354
355AC_SUBST(LIBXML_REQUIRED_VERSION)
356AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
357if test "x$LIBXML_CONFIG_PREFIX" != "x"
358then
359        XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config
360else
361        XML_CONFIG=xml2-config
362fi
363
364dnl
365dnl imported from libxml2, c.f. #77827
366dnl
367if test "${GCC}" != "yes" ; then
368    case "${host}" in
369          *-*-hpux* )
370               CFLAGS="${CFLAGS} -Wp,-H30000"
371               ;;
372          *-dec-osf* )
373               CFLAGS="${CFLAGS} -ieee"
374               ;;
375    esac
376else
377    CFLAGS="${CFLAGS} -Wall"
378    case "${host}" in
379          alpha*-*-linux* )
380               CFLAGS="${CFLAGS} -mieee"
381               ;;
382          alpha*-*-osf* )
383               CFLAGS="${CFLAGS} -mieee"
384               ;;
385    esac
386fi
387
388dnl
389dnl Override other variables if LIBXML_SRC is set
390dnl
391
392if test "x$LIBXML_SRC" != "x"
393then
394        CWD=`pwd`
395        if cd $LIBXML_SRC
396        then
397                SRC_DIR=`pwd`
398                XML_CONFIG=${SRC_DIR}/xml2-config
399                LIBXML_CFLAGS="-I${SRC_DIR}/include"
400                LIBXML_LIBS="-L${SRC_DIR}"
401                cd $CWD
402        else
403                AC_MSG_ERROR([libxml source dir not found (${LIBXML_SRC}), typo?])
404        fi
405fi
406
407dnl
408dnl make sure xml2-config is executable,
409dnl test version and init our variables
410dnl
411
412if ${XML_CONFIG} --libs print > /dev/null 2>&1
413then
414        XMLVERS=`$XML_CONFIG --version`
415        if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
416        then
417                LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
418                LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
419                AC_MSG_RESULT($XMLVERS found)
420        else
421                AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
422        fi
423else
424        AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
425fi
426
427
428AC_SUBST(CFLAGS)
429AC_SUBST(CPPFLAGS)
430AC_SUBST(LDFLAGS)
431
432dnl
433dnl In build tree I use a static version with memory debug enabled
434dnl
435if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
436    LIBXML_LIBS="../../XML/.libs/libxml2.a -lpthread -lz"
437    DV_LINK="1"
438    XSLTPROCDV="xsltproc.dv"
439    INSTALLED_XSLT_LIB=""
440    LIBXML_SRC="../../XML/"
441fi
442
443WIN32_EXTRA_LIBADD=
444WIN32_EXTRA_LDFLAGS=
445case "$host" in
446 *-*-mingw*)
447 WIN32_EXTRA_LIBADD="-lwsock32"
448 WIN32_EXTRA_LDFLAGS="-no-undefined"
449 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
450 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
451 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
452 ;;
453esac
454AC_SUBST(WIN32_EXTRA_LIBADD)
455AC_SUBST(WIN32_EXTRA_LDFLAGS)
456
457
458AC_SUBST(XSLTPROCDV)
459AC_SUBST(PYTHONSODV)
460AC_SUBST(XML_CONFIG)
461AC_SUBST(LIBXML_LIBS)
462AC_SUBST(LIBXML_CFLAGS)
463AC_SUBST(PYTHON)
464AC_SUBST(PYTHON_VERSION)
465AC_SUBST(PYTHON_INCLUDES)
466AC_SUBST(PYTHON_SITE_PACKAGES)
467
468XSLT_LIBDIR='-L${libdir}'
469XSLT_INCLUDEDIR='-I${includedir}'
470XSLT_LIBS="-lxslt $LIBXML_LIBS $M_LIBS"
471AC_SUBST(XSLT_LIBDIR)
472AC_SUBST(XSLT_INCLUDEDIR)
473AC_SUBST(XSLT_LIBS)
474
475EXSLT_LIBDIR='-L${libdir}'
476EXSLT_INCLUDEDIR='-I${includedir}'
477EXSLT_LIBS="-lexslt $XSLT_LIBS $LIBGCRYPT_LIBS"
478AC_SUBST(EXSLT_LIBDIR)
479AC_SUBST(EXSLT_INCLUDEDIR)
480AC_SUBST(EXSLT_LIBS)
481
482EXTRA_LIBS="$LIBXML_LIBS $M_LIBS"
483AC_SUBST(EXTRA_LIBS)
484
485AC_SUBST(M_LIBS)
486
487dnl for the spec file
488RELDATE=`date +'%a %b %e %Y'`
489AC_SUBST(RELDATE)
490
491( cd $srcdir
492rm -f COPYING.LIB COPYING
493$LN_S Copyright COPYING
494)
495
496
497AC_OUTPUT([
498Makefile
499libxslt.pc
500libexslt.pc
501libxslt/Makefile
502libxslt/xsltconfig.h
503libxslt/xsltwin32config.h
504libexslt/Makefile
505libexslt/exsltconfig.h
506xsltproc/Makefile
507python/Makefile
508python/tests/Makefile
509tests/Makefile
510tests/docs/Makefile
511tests/REC1/Makefile
512tests/REC2/Makefile
513tests/REC/Makefile
514tests/general/Makefile
515tests/reports/Makefile
516tests/extensions/Makefile
517tests/namespaces/Makefile
518tests/keys/Makefile
519tests/numbers/Makefile
520tests/documents/Makefile
521tests/xmlspec/Makefile
522tests/multiple/Makefile
523tests/XSLTMark/Makefile
524tests/docbook/Makefile
525tests/exslt/Makefile
526tests/exslt/common/Makefile
527tests/exslt/functions/Makefile
528tests/exslt/math/Makefile
529tests/exslt/sets/Makefile
530tests/exslt/strings/Makefile
531tests/exslt/date/Makefile
532doc/Makefile
533xslt-config
534libxslt.spec
535])
Note: See TracBrowser for help on using the repository browser.