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

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