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

Revision 21535, 14.0 KB checked in by ghudson, 19 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21534, 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=12
14PACKAGE=libxslt
15LIBEXSLT_MAJOR_VERSION=0
16LIBEXSLT_MINOR_VERSION=8
17LIBEXSLT_MICRO_VERSION=10
18LIBXML_REQUIRED_VERSION=2.6.15 # needs new API xmlNewDocPI
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_r ftime)
122
123dnl Checking the standard string functions availability
124AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
125               NEED_TRIO=1)
126
127dnl
128dnl Check for trio string functions
129dnl
130
131if test "${NEED_TRIO}" = "1" ; then
132    echo Reusing trio library for string functions
133    WITH_TRIO=1
134else   
135    WITH_TRIO=0
136fi
137AC_SUBST(WITH_TRIO)
138
139dnl
140dnl Some packages need to be checked against version numbers so we
141dnl define a function here for later use
142dnl
143AC_DEFUN(VERSION_TO_NUMBER,
144[`$1 | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`])
145
146dnl
147dnl Perl is just needed for generating some data for XSLtmark
148dnl
149
150AC_CHECK_PROG(PERL, perl, perl, false)
151AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
152
153dnl
154dnl check for python
155dnl
156
157PYTHON=
158PYTHON_VERSION=
159PYTHON_INCLUDES=
160PYTHON_SITE_PACKAGES=
161pythondir=
162AC_ARG_WITH(python, [  --with-python[=DIR]    Build Python bindings if found])
163if test "$with_python" != "no" ; then
164    if test -x "$with_python/bin/python"
165    then
166        echo Found python in $with_python/bin/python
167        PYTHON="$with_python/bin/python"
168    else
169        if test -x "$with_python"
170        then
171            echo Found python in $with_python
172            PYTHON="$with_python"
173        else
174            AC_PATH_PROG(PYTHON, python python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
175        fi
176    fi
177    if test "$PYTHON" != ""
178    then
179        PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
180        echo Found Python version $PYTHON_VERSION
181        LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1
182except: print 0"`
183        if test "$LIBXML2_PYTHON" = "1"
184        then
185            echo Found libxml2-python module
186        else
187            echo Warning: Missing libxml2-python
188        fi
189    fi
190    if test "$PYTHON_VERSION" != ""
191    then
192        if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
193           -d $with_python/lib/python$PYTHON_VERSION/site-packages
194        then
195            PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
196            PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
197        else
198            if test -r $prefix/include/python$PYTHON_VERSION/Python.h
199            then
200                PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
201                PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
202            else
203                if test -r /usr/include/python$PYTHON_VERSION/Python.h
204                then
205                    PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
206                    PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
207                else
208                    echo could not find python$PYTHON_VERSION/Python.h
209                fi
210            fi
211            if test ! -d "$PYTHON_SITE_PACKAGES"
212            then
213                    PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
214            fi
215        fi
216    fi
217    if test "$with_python" != ""
218    then
219        pythondir='$(PYTHON_SITE_PACKAGES)'
220    else
221        pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
222    fi
223fi
224AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
225if test "$PYTHON_INCLUDES" != ""
226then
227    PYTHON_SUBDIR=python
228else
229    PYTHON_SUBDIR=
230fi
231AC_SUBST(pythondir)
232AC_SUBST(PYTHON_SUBDIR)
233
234AC_ARG_WITH(crypto, [  --with-crypto           Add crypto support to exslt (on)])
235WITH_CRYPTO=0
236if test "$with_crypto" = "no" ; then
237    echo Disabling crypto support
238    LIBGCRYPT_CFLAGS=""
239    LIBGCRYPT_LIBS=""
240else
241    AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
242    if test "$LIBGCRYPT_CONFIG" != "no" ; then
243      LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version`
244      if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42")
245      then
246        LIBGCRYPT_CFLAGS=""
247        LIBGCRYPT_LIBS=""
248        echo gcrypt library version < 1.1.42 - Crypto extensions will not be available.
249      else
250        LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
251        LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
252        AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
253        echo Crypto extensions will be available.
254                WITH_CRYPTO=1
255      fi
256    else
257      LIBGCRYPT_CFLAGS=""
258      LIBGCRYPT_LIBS=""
259      echo Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.
260    fi
261fi
262AC_SUBST(WITH_CRYPTO)
263AC_SUBST(LIBGCRYPT_CFLAGS)
264AC_SUBST(LIBGCRYPT_LIBS)
265
266dnl
267dnl Debug for DV (-Wunreachable-code)
268dnl
269if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ]] || \
270   [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomecvs/xsltest" ]]
271   then
272    if test "${with_mem_debug}" = "" ;
273    then
274        with_mem_debug="yes"
275    fi
276    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 "
277    if test "`uname -i`" != "x86_64" ;
278    then
279        STATIC_BINARIES="-static"
280    else
281        STATIC_BINARIES=
282    fi
283    if test "$LOGNAME" = "veillard"
284    then
285        LIBXML_SRC="/u/veillard/XML"
286    fi
287else
288    STATIC_BINARIES=
289fi
290AC_SUBST(STATIC_BINARIES)
291
292AC_ARG_WITH(debug, [  --with-debug            Add the debugging code (on)])
293if test "$with_debug" = "no" ; then
294    echo Disabling debug support
295    WITH_XSLT_DEBUG=0
296else   
297    WITH_XSLT_DEBUG=1
298fi
299AC_SUBST(WITH_XSLT_DEBUG)
300
301AC_ARG_WITH(mem_debug, [  --with-mem-debug        Add the memory debugging module (off)])
302if test "$with_mem_debug" = "yes" ; then
303    echo Enabling memory debug support
304    WITH_MEM_DEBUG=1
305else   
306    WITH_MEM_DEBUG=0
307fi
308AC_SUBST(WITH_MEM_DEBUG)
309
310dnl
311dnl Is debugger support requested
312dnl
313AC_ARG_WITH(with_debugger, [  --with-debugger        Add the debugging support (on)])
314if test "$with_debugger" = "no" ; then
315    echo Disabling debugger
316    WITH_DEBUGGER=0
317else
318    echo Enabling debugger
319    WITH_DEBUGGER=1
320    AC_DEFINE(WITH_DEBUGGER)
321fi
322AC_SUBST(WITH_DEBUGGER)
323
324dnl
325dnl The following new parameters were added to offer
326dnl the ability to specify the location of the libxml
327dnl library during linking and compilation.
328dnl
329dnl original work - Mathieu Lacage 30/03/2000
330dnl some tweaking - David Härdeman 30/10/2001
331dnl
332
333LIBXML_CONFIG_PREFIX=""
334LIBXML_SRC=""
335
336AC_ARG_WITH(libxml-prefix,
337        [  --with-libxml-prefix=[PFX]           Specify location of libxml config],
338        LIBXML_CONFIG_PREFIX=$withval
339)
340       
341AC_ARG_WITH(libxml-include-prefix,
342        [  --with-libxml-include-prefix=[PFX]   Specify location of libxml headers],
343        LIBXML_CFLAGS="-I$withval"
344)
345
346AC_ARG_WITH(libxml-libs-prefix,
347        [  --with-libxml-libs-prefix=[PFX]      Specify location of libxml libs],
348        LIBXML_LIBS="-L$withval"
349)
350
351AC_ARG_WITH(libxml-src,
352        [  --with-libxml-src=[DIR]              For libxml thats not installed yet (sets all three above)],
353        LIBXML_SRC="$withval"
354)
355AC_SUBST(LIBXML_SRC)
356
357dnl
358dnl where is xml2-config
359dnl
360
361AC_SUBST(LIBXML_REQUIRED_VERSION)
362AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
363if test "x$LIBXML_CONFIG_PREFIX" != "x"
364then
365        XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config
366else
367        XML_CONFIG=xml2-config
368fi
369
370dnl
371dnl imported from libxml2, c.f. #77827
372dnl
373if test "${GCC}" != "yes" ; then
374    case "${host}" in
375          *-*-hpux* )
376               CFLAGS="${CFLAGS} -Wp,-H30000"
377               ;;
378          *-dec-osf* )
379               CFLAGS="${CFLAGS} -ieee"
380               ;;
381    esac
382else
383    CFLAGS="${CFLAGS} -Wall"
384    case "${host}" in
385          alpha*-*-linux* )
386               CFLAGS="${CFLAGS} -mieee"
387               ;;
388          alpha*-*-osf* )
389               CFLAGS="${CFLAGS} -mieee"
390               ;;
391    esac
392fi
393
394dnl
395dnl Override other variables if LIBXML_SRC is set
396dnl
397
398if test "x$LIBXML_SRC" != "x"
399then
400        CWD=`pwd`
401        if cd $LIBXML_SRC
402        then
403                SRC_DIR=`pwd`
404                XML_CONFIG=${SRC_DIR}/xml2-config
405                LIBXML_CFLAGS="-I${SRC_DIR}/include"
406                LIBXML_LIBS="-L${SRC_DIR}"
407                cd $CWD
408        else
409                AC_MSG_ERROR([libxml source dir not found (${LIBXML_SRC}), typo?])
410        fi
411fi
412
413dnl
414dnl make sure xml2-config is executable,
415dnl test version and init our variables
416dnl
417
418if ${XML_CONFIG} --libs print > /dev/null 2>&1
419then
420        XMLVERS=`$XML_CONFIG --version`
421        if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
422        then
423                LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
424                LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
425                AC_MSG_RESULT($XMLVERS found)
426        else
427                AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
428        fi
429else
430        AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
431fi
432
433
434AC_SUBST(CFLAGS)
435AC_SUBST(CPPFLAGS)
436AC_SUBST(LDFLAGS)
437
438dnl
439dnl In build tree I use a static version with memory debug enabled
440dnl
441if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
442    if test "`uname -i`" != "x86_64" ;
443    then
444        LIBXML_LIBS="../../XML/.libs/libxml2.a -lpthread -lz"
445    fi
446    DV_LINK="1"
447    XSLTPROCDV="xsltproc.dv"
448    INSTALLED_XSLT_LIB=""
449    LIBXML_SRC="../../XML/"
450fi
451
452WIN32_EXTRA_LIBADD=
453WIN32_EXTRA_LDFLAGS=
454case "$host" in
455 *-*-mingw*)
456 WIN32_EXTRA_LIBADD="-lwsock32"
457 WIN32_EXTRA_LDFLAGS="-no-undefined"
458 AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
459 AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
460 AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
461 ;;
462esac
463AC_SUBST(WIN32_EXTRA_LIBADD)
464AC_SUBST(WIN32_EXTRA_LDFLAGS)
465
466
467AC_SUBST(XSLTPROCDV)
468AC_SUBST(PYTHONSODV)
469AC_SUBST(XML_CONFIG)
470AC_SUBST(LIBXML_LIBS)
471AC_SUBST(LIBXML_CFLAGS)
472AC_SUBST(PYTHON)
473AC_SUBST(PYTHON_VERSION)
474AC_SUBST(PYTHON_INCLUDES)
475AC_SUBST(PYTHON_SITE_PACKAGES)
476
477XSLT_LIBDIR='-L${libdir}'
478XSLT_INCLUDEDIR='-I${includedir}'
479XSLT_LIBS="-lxslt $LIBXML_LIBS $M_LIBS"
480AC_SUBST(XSLT_LIBDIR)
481AC_SUBST(XSLT_INCLUDEDIR)
482AC_SUBST(XSLT_LIBS)
483
484EXSLT_LIBDIR='-L${libdir}'
485EXSLT_INCLUDEDIR='-I${includedir}'
486EXSLT_LIBS="-lexslt $XSLT_LIBS $LIBGCRYPT_LIBS"
487AC_SUBST(EXSLT_LIBDIR)
488AC_SUBST(EXSLT_INCLUDEDIR)
489AC_SUBST(EXSLT_LIBS)
490
491EXTRA_LIBS="$LIBXML_LIBS $M_LIBS"
492AC_SUBST(EXTRA_LIBS)
493
494AC_SUBST(M_LIBS)
495
496dnl for the spec file
497RELDATE=`date +'%a %b %e %Y'`
498AC_SUBST(RELDATE)
499
500( cd $srcdir
501rm -f COPYING.LIB COPYING
502$LN_S Copyright COPYING
503)
504
505
506AC_OUTPUT([
507Makefile
508libxslt.pc
509libexslt.pc
510libxslt/Makefile
511libxslt/xsltconfig.h
512libxslt/xsltwin32config.h
513libexslt/Makefile
514libexslt/exsltconfig.h
515xsltproc/Makefile
516python/Makefile
517python/tests/Makefile
518tests/Makefile
519tests/docs/Makefile
520tests/REC1/Makefile
521tests/REC2/Makefile
522tests/REC/Makefile
523tests/general/Makefile
524tests/reports/Makefile
525tests/extensions/Makefile
526tests/namespaces/Makefile
527tests/keys/Makefile
528tests/numbers/Makefile
529tests/documents/Makefile
530tests/xmlspec/Makefile
531tests/multiple/Makefile
532tests/XSLTMark/Makefile
533tests/docbook/Makefile
534tests/exslt/Makefile
535tests/exslt/common/Makefile
536tests/exslt/functions/Makefile
537tests/exslt/math/Makefile
538tests/exslt/sets/Makefile
539tests/exslt/strings/Makefile
540tests/exslt/date/Makefile
541doc/Makefile
542xslt-config
543libxslt.spec
544])
Note: See TracBrowser for help on using the repository browser.