]>
Commit | Line | Data |
---|---|---|
5e9f2524 VS |
1 | dnl configuration script for expat |
2 | dnl Process this file with autoconf to produce a configure script. | |
3 | dnl | |
4 | dnl Copyright 2000 Clark Cooper | |
5 | dnl | |
6 | dnl This file is part of EXPAT. | |
7 | dnl | |
8 | dnl EXPAT is free software; you can redistribute it and/or modify it | |
9 | dnl under the terms of the License (based on the MIT/X license) contained | |
10 | dnl in the file COPYING that comes with this distribution. | |
11 | dnl | |
12 | ||
11a3e7b6 VZ |
13 | dnl Ensure that Expat is configured with autoconf 2.58 or newer |
14 | AC_PREREQ(2.58) | |
5e9f2524 VS |
15 | |
16 | dnl Get the version number of Expat, using m4's esyscmd() command to run | |
17 | dnl the command at m4-generation time. This allows us to create an m4 | |
18 | dnl symbol holding the correct version number. AC_INIT() requires the | |
19 | dnl version number at m4-time, rather than when ./configure is run, so | |
20 | dnl all this must happen as part of m4, not as part of the shell code | |
21 | dnl contained in ./configure. | |
22 | dnl | |
23 | dnl NOTE: esyscmd() is a GNU M4 extension. Thus, we wrap it in an appropriate | |
24 | dnl test. I believe this test will work, but I don't have a place with non- | |
25 | dnl GNU M4 to test it right now. | |
26 | define([expat_version], ifdef([__gnu__], | |
27 | [esyscmd(conftools/get-version.sh lib/expat.h)], | |
11a3e7b6 VZ |
28 | [2.1.x])) |
29 | AC_INIT(expat, expat_version, expat-bugs@libexpat.org) | |
5e9f2524 VS |
30 | undefine([expat_version]) |
31 | ||
32 | AC_CONFIG_SRCDIR(Makefile.in) | |
33 | AC_CONFIG_AUX_DIR(conftools) | |
11a3e7b6 | 34 | AC_CONFIG_MACRO_DIR([m4]) |
5e9f2524 VS |
35 | |
36 | ||
37 | dnl | |
38 | dnl Increment LIBREVISION if source code has changed at all | |
39 | dnl | |
40 | dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0 | |
41 | dnl | |
42 | dnl If the API changes compatibly (i.e. simply adding a new function | |
43 | dnl without changing or removing earlier interfaces), then increment LIBAGE. | |
44 | dnl | |
45 | dnl If the API changes incompatibly set LIBAGE back to 0 | |
46 | dnl | |
47 | ||
11a3e7b6 | 48 | LIBCURRENT=7 |
5e9f2524 | 49 | LIBREVISION=0 |
11a3e7b6 | 50 | LIBAGE=6 |
5e9f2524 VS |
51 | |
52 | AC_CONFIG_HEADER(expat_config.h) | |
53 | ||
5e9f2524 VS |
54 | sinclude(conftools/ac_c_bigendian_cross.m4) |
55 | ||
4301e38a DE |
56 | |
57 | dnl Check for many C compilers (have to do this before libtool stuff) | |
58 | AC_BAKEFILE_PROG_CC | |
59 | ||
5e9f2524 VS |
60 | AC_LIBTOOL_WIN32_DLL |
61 | AC_PROG_LIBTOOL | |
62 | ||
63 | AC_SUBST(LIBCURRENT) | |
64 | AC_SUBST(LIBREVISION) | |
65 | AC_SUBST(LIBAGE) | |
66 | ||
67 | dnl Checks for programs. | |
11a3e7b6 | 68 | AC_PROG_CXX |
5e9f2524 VS |
69 | AC_PROG_INSTALL |
70 | ||
71 | if test "$GCC" = yes ; then | |
72 | dnl | |
73 | dnl Be careful about adding the -fexceptions option; some versions of | |
74 | dnl GCC don't support it and it causes extra warnings that are only | |
75 | dnl distracting; avoid. | |
76 | dnl | |
77 | OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes" | |
78 | CFLAGS="$OLDCFLAGS -fexceptions" | |
11a3e7b6 VZ |
79 | AC_MSG_CHECKING(whether $CC accepts -fexceptions) |
80 | AC_TRY_LINK( , , | |
5e9f2524 VS |
81 | AC_MSG_RESULT(yes), |
82 | AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS") | |
11a3e7b6 | 83 | CXXFLAGS=`echo "$CFLAGS" | sed 's/ -Wmissing-prototypes -Wstrict-prototypes//'` |
5e9f2524 VS |
84 | fi |
85 | ||
86 | dnl Checks for header files. | |
87 | AC_HEADER_STDC | |
5e9f2524 VS |
88 | |
89 | dnl Checks for typedefs, structures, and compiler characteristics. | |
90 | ||
91 | dnl Note: Avoid using AC_C_BIGENDIAN because it does not | |
92 | dnl work in a cross compile. | |
93 | AC_C_BIGENDIAN_CROSS | |
94 | ||
95 | AC_C_CONST | |
5e9f2524 | 96 | AC_TYPE_SIZE_T |
11a3e7b6 | 97 | AC_CHECK_FUNCS(memmove bcopy) |
5e9f2524 | 98 | |
11a3e7b6 VZ |
99 | dnl Only needed for xmlwf: |
100 | AC_CHECK_HEADERS(fcntl.h unistd.h) | |
101 | AC_TYPE_OFF_T | |
5e9f2524 VS |
102 | AC_FUNC_MMAP |
103 | ||
104 | if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then | |
105 | FILEMAP=unixfilemap | |
106 | else | |
107 | FILEMAP=readfilemap | |
108 | fi | |
109 | AC_SUBST(FILEMAP) | |
110 | ||
11a3e7b6 VZ |
111 | dnl Needed for the test support code; this was found at |
112 | dnl http://lists.gnu.org/archive/html/bug-autoconf/2002-07/msg00028.html | |
113 | ||
114 | # AC_CPP_FUNC | |
115 | # ------------------ # | |
116 | # Checks to see if ANSI C99 CPP variable __func__ works. | |
117 | # If not, perhaps __FUNCTION__ works instead. | |
118 | # If not, we'll just define __func__ to "". | |
119 | AC_DEFUN([AC_CPP_FUNC], | |
120 | [AC_REQUIRE([AC_PROG_CC_STDC])dnl | |
121 | AC_CACHE_CHECK([for an ANSI C99-conforming __func__], ac_cv_cpp_func, | |
122 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], | |
123 | [[char *foo = __func__;]])], | |
124 | [ac_cv_cpp_func=yes], | |
125 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], | |
126 | [[char *foo = __FUNCTION__;]])], | |
127 | [ac_cv_cpp_func=__FUNCTION__], | |
128 | [ac_cv_cpp_func=no])])]) | |
129 | if test $ac_cv_cpp_func = __FUNCTION__; then | |
130 | AC_DEFINE(__func__,__FUNCTION__, | |
131 | [Define to __FUNCTION__ or "" if `__func__' does not conform to | |
132 | ANSI C.]) | |
133 | elif test $ac_cv_cpp_func = no; then | |
134 | AC_DEFINE(__func__,"", | |
135 | [Define to __FUNCTION__ or "" if `__func__' does not conform to | |
136 | ANSI C.]) | |
137 | fi | |
138 | ])# AC_CPP_FUNC | |
139 | ||
140 | AC_CPP_FUNC | |
141 | ||
5e9f2524 | 142 | |
11a3e7b6 | 143 | dnl Some basic configuration: |
5e9f2524 VS |
144 | AC_DEFINE([XML_NS], 1, |
145 | [Define to make XML Namespaces functionality available.]) | |
146 | AC_DEFINE([XML_DTD], 1, | |
147 | [Define to make parameter entity parsing functionality available.]) | |
148 | AC_DEFINE([XML_CONTEXT_BYTES], 1024, | |
149 | [Define to specify how much context to retain around the current parse point.]) | |
150 | ||
11a3e7b6 | 151 | AC_CONFIG_FILES([Makefile expat.pc]) |
5e9f2524 VS |
152 | AC_OUTPUT |
153 | ||
154 | abs_srcdir="`cd $srcdir && pwd`" | |
155 | abs_builddir="`pwd`" | |
156 | if test "$abs_srcdir" != "$abs_builddir"; then | |
1772d112 | 157 | ${MAKE:-make} mkdir-init |
5e9f2524 | 158 | fi |