xref: /freebsd/contrib/expat/configure.ac (revision ffd294a1f4c23863c3e515d16dce31d5509bcb01)
1dnl   configuration script for expat
2dnl   Process this file with autoconf to produce a configure script.
3dnl                            __  __            _
4dnl                         ___\ \/ /_ __   __ _| |_
5dnl                        / _ \\  /| '_ \ / _` | __|
6dnl                       |  __//  \| |_) | (_| | |_
7dnl                        \___/_/\_\ .__/ \__,_|\__|
8dnl                                 |_| XML parser
9dnl
10dnl   Copyright (c) 2000      Clark Cooper <coopercc@users.sourceforge.net>
11dnl   Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
12dnl   Copyright (c) 2001-2003 Greg Stein <gstein@users.sourceforge.net>
13dnl   Copyright (c) 2006-2012 Karl Waclawek <karl@waclawek.net>
14dnl   Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
15dnl   Copyright (c) 2017      S. P. Zeidler <spz@netbsd.org>
16dnl   Copyright (c) 2017      Stephen Groat <stephen@groat.us>
17dnl   Copyright (c) 2017-2020 Joe Orton <jorton@redhat.com>
18dnl   Copyright (c) 2018      Yury Gribov <tetra2005@gmail.com>
19dnl   Copyright (c) 2018      Benjamin Peterson <benjamin@python.org>
20dnl   Copyright (c) 2018      Marco Maggi <marco.maggi-ipsu@poste.it>
21dnl   Copyright (c) 2018      KangLin <kl222@126.com>
22dnl   Copyright (c) 2019      Mohammed Khajapasha <mohammed.khajapasha@intel.com>
23dnl   Copyright (c) 2019      Kishore Kunche <kishore.kunche@intel.com>
24dnl   Copyright (c) 2020      Jeffrey Walton <noloader@gmail.com>
25dnl   Copyright (c) 2024      Ferenc Géczi <ferenc.gm@gmail.com>
26dnl   Copyright (c) 2024      Dag-Erling Smørgrav <des@des.dev>
27dnl   Licensed under the MIT license:
28dnl
29dnl   Permission is  hereby granted,  free of charge,  to any  person obtaining
30dnl   a  copy  of  this  software   and  associated  documentation  files  (the
31dnl   "Software"),  to  deal in  the  Software  without restriction,  including
32dnl   without  limitation the  rights  to use,  copy,  modify, merge,  publish,
33dnl   distribute, sublicense, and/or sell copies of the Software, and to permit
34dnl   persons  to whom  the Software  is  furnished to  do so,  subject to  the
35dnl   following conditions:
36dnl
37dnl   The above copyright  notice and this permission notice  shall be included
38dnl   in all copies or substantial portions of the Software.
39dnl
40dnl   THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
41dnl   EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
42dnl   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
43dnl   NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
44dnl   DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
45dnl   OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
46dnl   USE OR OTHER DEALINGS IN THE SOFTWARE.
47
48dnl Ensure that Expat is configured with autoconf 2.69 or newer.
49AC_PREREQ([2.69])
50
51dnl Get the version number of Expat, using m4's esyscmd() command to run
52dnl the command at m4-generation time. This allows us to create an m4
53dnl symbol holding the correct version number. AC_INIT requires the
54dnl version number at m4-time, rather than when ./configure is run, so
55dnl all this must happen as part of m4, not as part of the shell code
56dnl contained in ./configure.
57dnl
58dnl NOTE: esyscmd() is a GNU M4 extension. Thus, we wrap it in an appropriate
59dnl test. I believe this test will work, but I don't have a place with non-
60dnl GNU M4 to test it right now.
61m4_define([expat_version],
62  m4_ifdef([__gnu__],
63           [esyscmd(conftools/get-version.sh lib/expat.h)],
64           [2.2.x]))
65AC_INIT([expat], expat_version, [https://github.com/libexpat/libexpat/issues])
66m4_undefine([expat_version])
67
68AC_CONFIG_SRCDIR([Makefile.in])
69AC_CONFIG_AUX_DIR([conftools])
70AC_CONFIG_MACRO_DIR([m4])
71AC_CANONICAL_HOST
72AM_INIT_AUTOMAKE
73AM_MAINTAINER_MODE([enable])  # to allow argument --disable-maintainer-mode
74
75
76dnl
77dnl Increment LIBREVISION if source code has changed at all
78dnl
79dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0
80dnl
81dnl If the API changes compatibly (i.e. simply adding a new function
82dnl without changing or removing earlier interfaces), then increment LIBAGE.
83dnl
84dnl If the API changes incompatibly set LIBAGE back to 0
85dnl
86
87LIBCURRENT=10  # sync
88LIBREVISION=3  # with
89LIBAGE=9       # CMakeLists.txt!
90
91AC_CONFIG_HEADERS([expat_config.h])
92AH_TOP([#ifndef EXPAT_CONFIG_H
93#define EXPAT_CONFIG_H 1])
94AH_BOTTOM([#endif // ndef EXPAT_CONFIG_H])
95
96AM_PROG_AR
97AC_PROG_INSTALL
98AC_PROG_LN_S
99AC_PROG_MAKE_SET
100
101LT_PREREQ([2.4])
102LT_INIT([win32-dll])
103
104AC_SUBST(LIBCURRENT)
105AC_SUBST(LIBREVISION)
106AC_SUBST(LIBAGE)
107
108AC_LANG([C])
109AC_PROG_CC_C99
110
111AS_IF([test "${ac_cv_prog_cc_c99}" = no],
112  [AC_MSG_ERROR([Expat requires a C99 compiler.])])
113
114AS_IF([test "$GCC" = yes],
115  [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CFLAGS])
116   dnl Be careful about adding the -fexceptions option; some versions of
117   dnl GCC don't support it and it causes extra warnings that are only
118   dnl distracting; avoid.
119   AX_APPEND_COMPILE_FLAGS([-fexceptions], [AM_CFLAGS])
120   AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [AM_CFLAGS])
121   AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [AM_CFLAGS])
122   AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [AM_CFLAGS])
123   AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wno-pedantic-ms-format -Wmisleading-indentation], [AM_CFLAGS])])
124
125AC_LANG_PUSH([C++])
126AC_PROG_CXX
127
128AS_IF([test "$GCC" = yes],
129  [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CXXFLAGS])
130   dnl Be careful about adding the -fexceptions option; some versions of
131   dnl GCC don't support it and it causes extra warnings that are only
132   dnl distracting; avoid.
133   AX_APPEND_COMPILE_FLAGS([-fexceptions], [AM_CXXFLAGS])
134   AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [AM_CXXFLAGS])])
135AC_LANG_POP([C++])
136
137AS_IF([test "$GCC" = yes],
138  [AX_APPEND_LINK_FLAGS([-fno-strict-aliasing],[AM_LDFLAGS])])
139
140dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang (issue #312)
141AS_CASE(["$LD"],[*clang*],
142  [AS_CASE(["${host_os}"],
143     [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])
144
145EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([
146  AX_APPEND_FLAG([-fvisibility=hidden],              [AM_CFLAGS])
147  AS_IF([test "${enable_shared}" = yes],
148        [AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])])])
149
150dnl Checks for typedefs, structures, and compiler characteristics.
151
152dnl We define BYTEORDER to 1234 when the platform is little endian; it
153dnl defines it to 4321 when the  platform is big endian.  We also define
154dnl WORDS_BIGENDIAN to 1 when the platform is big endian.
155dnl
156dnl A  long time  ago (early 2000  years) AC_C_BIGENDIAN  was considered
157dnl wrong when cross compiling, now (2018, GNU Autoconf 2.69) we assume
158dnl it is fine.
159AC_C_BIGENDIAN([AC_DEFINE([WORDS_BIGENDIAN], 1)
160                AS_VAR_SET([BYTEORDER], 4321)],
161               [AS_VAR_SET([BYTEORDER], 1234)])
162AC_DEFINE_UNQUOTED([BYTEORDER], $BYTEORDER, [1234 = LILENDIAN, 4321 = BIGENDIAN])
163
164AC_C_CONST
165
166AC_ARG_WITH([xmlwf],
167  [AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])],
168  [],
169  [with_xmlwf=yes])
170AM_CONDITIONAL([WITH_XMLWF], [test x${with_xmlwf} = xyes])
171
172AC_ARG_WITH([examples],
173  [AS_HELP_STRING([--without-examples], [do not build examples @<:@default=included@:>@])],
174  [],
175  [with_examples=yes])
176AM_CONDITIONAL([WITH_EXAMPLES], [test x${with_examples} = xyes])
177
178AC_ARG_WITH([tests],
179  [AS_HELP_STRING([--without-tests], [do not build tests @<:@default=included@:>@])],
180  [],
181  [with_tests=yes])
182AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes])
183
184AS_IF([test x${with_tests} = xyes],
185      [AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])])
186
187AS_VAR_SET([EXPATCFG_ON_MINGW],[no])
188AS_CASE("${host_os}",
189  [mingw*],
190  [AS_VAR_SET([EXPATCFG_ON_MINGW],[yes])
191   AC_MSG_NOTICE([detected OS: MinGW])])
192AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes])
193
194dnl Note: Prefix "_INTERNAL_" here means exclusive use inside of file configure.ac
195AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null])
196AM_CONDITIONAL([_INTERNAL_UNICODE_WCHAR_T], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE_WCHAR_T >/dev/null])
197AM_CONDITIONAL([_INTERNAL_MIN_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null])
198AM_CONDITIONAL([_INTERNAL_LARGE_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_LARGE_SIZE >/dev/null])
199
200LT_LIB_M
201
202AC_ARG_WITH([libbsd],
203  [AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])],
204  [],
205  [with_libbsd=no])
206AS_IF([test "x${with_libbsd}" != xno],
207  [AC_CHECK_LIB([bsd],
208     [arc4random_buf],
209     [],
210     [AS_IF([test "x${with_libbsd}" = xyes],
211        [AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])])
212AC_MSG_CHECKING([for arc4random_buf (BSD, libbsd or glibc 2.36+)])
213AC_LINK_IFELSE([AC_LANG_SOURCE([
214    #if defined(HAVE_LIBBSD)
215    # include <bsd/stdlib.h>
216    #else
217    # include <stdlib.h>  /* for arc4random_buf on BSD */
218    #endif
219    int main(void) {
220      char dummy[[123]];  // double brackets for m4
221      arc4random_buf(dummy, 0U);
222      return 0;
223    }
224  ])],
225  [AC_DEFINE([HAVE_ARC4RANDOM_BUF], [1], [Define to 1 if you have the `arc4random_buf' function.])
226   AC_MSG_RESULT([yes])],
227  [AC_MSG_RESULT([no])
228
229   AC_MSG_CHECKING([for arc4random (BSD, macOS, libbsd or glibc 2.36+)])
230   AC_LINK_IFELSE([AC_LANG_SOURCE([
231       #if defined(HAVE_LIBBSD)
232       # include <bsd/stdlib.h>
233       #else
234       # include <stdlib.h>
235       #endif
236       int main(void) {
237          arc4random();
238          return 0;
239       }
240     ])],
241     [AC_DEFINE([HAVE_ARC4RANDOM], [1], [Define to 1 if you have the `arc4random' function.])
242      AC_MSG_RESULT([yes])],
243     [AC_MSG_RESULT([no])])])
244
245AC_ARG_WITH([getrandom],
246  [AS_HELP_STRING([--with-getrandom],
247                  [enforce the use of getrandom function in the system @<:@default=check@:>@])
248AS_HELP_STRING([--without-getrandom],
249               [skip auto detect of getrandom @<:@default=check@:>@])],
250  [],
251  [with_getrandom=check])
252
253AS_IF([test "x$with_getrandom" != xno],
254  [AC_MSG_CHECKING([for getrandom (Linux 3.17+, glibc 2.25+)])
255   AC_LINK_IFELSE([AC_LANG_SOURCE([
256       #include <stdlib.h>  /* for NULL */
257       #include <sys/random.h>
258       int main(void) {
259         return getrandom(NULL, 0U, 0U);
260       }
261     ])],
262     [AC_DEFINE([HAVE_GETRANDOM], [1], [Define to 1 if you have the `getrandom' function.])
263      AC_MSG_RESULT([yes])],
264     [AC_MSG_RESULT([no])
265      AS_IF([test "x$with_getrandom" = xyes],
266        [AC_MSG_ERROR([enforced the use of getrandom --with-getrandom, but not detected])])])])
267
268AC_ARG_WITH([sys_getrandom],
269  [AS_HELP_STRING([--with-sys-getrandom],
270                  [enforce the use of syscall SYS_getrandom function in the system @<:@default=check@:>@])
271AS_HELP_STRING([--without-sys-getrandom],
272               [skip auto detect of syscall SYS_getrandom @<:@default=check@:>@])],
273  [],
274  [with_sys_getrandom=check])
275
276AS_IF([test "x$with_sys_getrandom" != xno],
277  [AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)])
278   AC_LINK_IFELSE([AC_LANG_SOURCE([
279       #define _GNU_SOURCE
280       #include <stdlib.h>  /* for NULL */
281       #include <unistd.h>  /* for syscall */
282       #include <sys/syscall.h>  /* for SYS_getrandom */
283       int main(void) {
284         syscall(SYS_getrandom, NULL, 0, 0);
285         return 0;
286     }
287   ])],
288     [AC_DEFINE([HAVE_SYSCALL_GETRANDOM], [1], [Define to 1 if you have `syscall' and `SYS_getrandom'.])
289      AC_MSG_RESULT([yes])],
290     [AC_MSG_RESULT([no])
291      AS_IF([test "x$with_sys_getrandom" = xyes],
292        [AC_MSG_ERROR([enforced the use of syscall SYS_getrandom --with-sys-getrandom, but not detected])])])])
293
294dnl Only needed for xmlwf:
295AC_CHECK_HEADERS(fcntl.h unistd.h)
296AC_TYPE_OFF_T
297AC_FUNC_MMAP
298
299AS_IF([test "$ac_cv_func_mmap_fixed_mapped" = "yes"],
300  [AS_VAR_SET(FILEMAP,unixfilemap)],
301  [AS_VAR_SET(FILEMAP,readfilemap)])
302AC_SUBST(FILEMAP)
303
304
305dnl Some basic configuration:
306AC_DEFINE([XML_NS], 1,
307          [Define to make XML Namespaces functionality available.])
308AC_DEFINE([XML_GE], 1,
309          [Define as 1/0 to enable/disable support for general entities.])
310AC_DEFINE([XML_DTD], 1,
311          [Define to make parameter entity parsing functionality available.])
312AC_DEFINE([XML_DEV_URANDOM], 1,
313          [Define to include code reading entropy from `/dev/urandom'.])
314
315AC_ARG_ENABLE([xml-attr-info],
316  [AS_HELP_STRING([--enable-xml-attr-info],
317     [Enable retrieving the byte offsets for attribute names and values @<:@default=no@:>@])],
318  [],
319  [enable_xml_attr_info=no])
320AS_IF([test "x${enable_xml_attr_info}" = "xyes"],
321      [AC_DEFINE([XML_ATTR_INFO], 1,
322         [Define to allow retrieving the byte offsets for attribute names and values.])])
323
324AC_ARG_ENABLE([xml-context],
325  AS_HELP_STRING([--enable-xml-context @<:@COUNT@:>@],
326    [Retain context around the current parse point;
327     default is enabled and a size of 1024 bytes])
328AS_HELP_STRING([--disable-xml-context],
329    [Do not retain context around the current parse point]),
330    [enable_xml_context=${enableval}])
331AS_IF([test "x${enable_xml_context}" != "xno"],
332  [AS_IF([test "x${enable_xml_context}" = "xyes" \
333            -o "x${enable_xml_context}" = "x"],
334     [AS_VAR_SET(enable_xml_context,1024)])],
335  [AS_VAR_SET(enable_xml_context,0)])
336AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}],
337  [Define to specify how much context to retain around the current parse point, 0 to disable.])
338
339AC_ARG_WITH([docbook],
340  [AS_HELP_STRING([--with-docbook],
341                  [enforce XML to man page compilation @<:@default=check@:>@])
342AS_HELP_STRING([--without-docbook],
343               [skip XML to man page compilation @<:@default=check@:>@])],
344  [],
345  [with_docbook=check])
346
347AC_ARG_VAR([DOCBOOK_TO_MAN], [docbook2x-man command])
348AS_IF([test "x$with_docbook" != xno],
349  [AC_CHECK_PROGS([DOCBOOK_TO_MAN], [docbook2x-man db2x_docbook2man docbook2man docbook-to-man])])
350AS_IF([test "x${DOCBOOK_TO_MAN}" = x -a "x$with_docbook" = xyes],
351  [AC_MSG_ERROR([Required program 'docbook2x-man' not found.])])
352AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno],
353  [AS_IF([${DOCBOOK_TO_MAN} --help | grep -i -q -F sgmlbase],
354    [AC_MSG_ERROR([Your local ${DOCBOOK_TO_MAN} was found to work with SGML rather
355  than XML. Please install docbook2X and use variable DOCBOOK_TO_MAN to point
356  configure to command docbook2x-man of docbook2X.
357  Or use DOCBOOK_TO_MAN="xmlto man --skip-validation" if you have xmlto around.
358  You can also configure using --without-docbook if you can do without a man
359  page for xmlwf.])])])
360
361dnl This will make sure that a release tarball shipping a pre-rendered xmlwf man page will
362dnl get it installed, when no working flavor of docbook2man is available (or wanted).
363dnl This relies on file xmlwf.1 being at least as recent as its source file xmlwf.xml.
364AS_IF([test -f "${srcdir}"/doc/xmlwf.1],
365  [AM_CONDITIONAL(WITH_MANPAGE, [true])
366   AS_IF([test "x$with_docbook" = xno -o "x${DOCBOOK_TO_MAN}" = x],
367     [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [true])
368      AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])],
369     [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false])
370      AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])])
371   ],
372  [AS_IF([test "x$with_docbook" != xno -a "x${DOCBOOK_TO_MAN}" != x],
373     [AM_CONDITIONAL(WITH_MANPAGE, [true])
374      AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])],
375     [AM_CONDITIONAL(WITH_MANPAGE, [false])
376      AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])])
377   AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false])])
378
379dnl Configure CMake file templates
380dnl NOTE: The *_TRUE variables read here are Automake conditionals
381dnl       that are either set to "" when enabled or to "#" when disabled
382dnl       (because they are used to dynamically comment out certain things)
383AS_IF([test "x${enable_xml_attr_info}" = xyes],
384  [EXPAT_ATTR_INFO=ON],
385  [EXPAT_ATTR_INFO=OFF])
386EXPAT_DTD=ON
387AS_IF([test "x${_INTERNAL_LARGE_SIZE_TRUE}" = x],
388  [EXPAT_LARGE_SIZE=ON],
389  [EXPAT_LARGE_SIZE=OFF])
390AS_IF([test "x${_INTERNAL_MIN_SIZE_TRUE}" = x],
391  [EXPAT_MIN_SIZE=ON],
392  [EXPAT_MIN_SIZE=OFF])
393EXPAT_NS=ON
394AS_IF([test "x${enable_xml_context}" != xno],
395  [EXPAT_CONTEXT_BYTES=${enable_xml_context}],
396  [EXPAT_CONTEXT_BYTES=OFF])
397AS_IF([test "x${UNICODE_TRUE}" = x],
398  [AS_IF(
399     [test "x${_INTERNAL_UNICODE_WCHAR_T_TRUE}" = x],
400        [EXPAT_CHAR_TYPE=wchar_t],
401        [EXPAT_CHAR_TYPE=ushort])],
402  [EXPAT_CHAR_TYPE=char])
403PACKAGE_INIT="${srcdir}"/cmake/autotools/expat-package-init.cmake
404LIBDIR_BASENAME="$(basename "${libdir}")"
405SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")"
406SO_MINOR="${LIBAGE}"
407SO_PATCH="${LIBREVISION}"
408AC_SUBST([EXPAT_ATTR_INFO])
409AC_SUBST([EXPAT_DTD])
410AC_SUBST([EXPAT_LARGE_SIZE])
411AC_SUBST([EXPAT_MIN_SIZE])
412AC_SUBST([EXPAT_NS])
413AC_SUBST([EXPAT_CONTEXT_BYTES])
414AC_SUBST([EXPAT_CHAR_TYPE])
415AC_SUBST_FILE([PACKAGE_INIT])
416AC_SUBST([LIBDIR_BASENAME])
417AC_SUBST([SO_MAJOR])
418AC_SUBST([SO_MINOR])
419AC_SUBST([SO_PATCH])
420
421dnl The canonical way of doing this is AC_CHECK_SIZEOF(void *), but
422dnl that adds SIZEOF_VOID_P to expat_config.h.in, making it difficult
423dnl to have 32-bit and 64-bit versions of libexpat installed on the
424dnl same system with a single, shared copy of the header.
425AC_COMPUTE_INT(SIZEOF_VOID_P, [sizeof(void *)])
426AC_SUBST([SIZEOF_VOID_P])
427
428dnl write the Automake flags we set
429AC_SUBST([AM_CPPFLAGS])
430AC_SUBST([AM_CFLAGS])
431AC_SUBST([AM_CXXFLAGS])
432AC_SUBST([AM_LDFLAGS])
433
434dnl Emulate the use of CMAKE_SHARED_LIBRARY_PREFIX under CMake
435AC_MSG_CHECKING([for shared library name prefix])
436AS_CASE("${host_os}",
437  [cygwin*], [CMAKE_SHARED_LIBRARY_PREFIX=cyg],
438  [CMAKE_SHARED_LIBRARY_PREFIX=lib])
439AC_MSG_RESULT([${CMAKE_SHARED_LIBRARY_PREFIX}])
440AC_SUBST([CMAKE_SHARED_LIBRARY_PREFIX])
441
442AS_CASE("${host_os}",
443  [darwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in],
444  [mingw*|cygwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in],
445  [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in])
446AC_CONFIG_FILES([Makefile]
447  [expat.pc]
448  [cmake/expat-config.cmake]
449  [cmake/autotools/expat-config-version.cmake]
450  [cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE}]
451  [doc/Makefile]
452  [examples/Makefile]
453  [lib/Makefile]
454  [tests/Makefile]
455  [tests/benchmark/Makefile]
456  [xmlwf/Makefile])
457AC_CONFIG_FILES([run.sh], [chmod +x run.sh])
458AC_OUTPUT
459
460
461AC_MSG_NOTICE([
462
463Automake flags (can be overridden by user flags):
464  [AM_CPPFLAGS]: ${AM_CPPFLAGS}
465    [AM_CFLAGS]: ${AM_CFLAGS}
466  [AM_CXXFLAGS]: ${AM_CXXFLAGS}
467   [AM_LDFLAGS]: ${AM_LDFLAGS}
468
469User flags (override Automake flags on conflict):
470     CPPFLAGS: ${CPPFLAGS}
471       CFLAGS: ${CFLAGS}
472     CXXFLAGS: ${CXXFLAGS}
473      LDFLAGS: ${LDFLAGS}])
474