2000-09-18 12:26:23 -04:00
|
|
|
dnl configuration script for expat
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
2021-05-01 17:30:12 -04:00
|
|
|
dnl __ __ _
|
|
|
|
dnl ___\ \/ /_ __ __ _| |_
|
|
|
|
dnl / _ \\ /| '_ \ / _` | __|
|
|
|
|
dnl | __// \| |_) | (_| | |_
|
|
|
|
dnl \___/_/\_\ .__/ \__,_|\__|
|
|
|
|
dnl |_| XML parser
|
2000-09-18 12:26:23 -04:00
|
|
|
dnl
|
2021-05-01 19:49:02 -04:00
|
|
|
dnl Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
|
|
|
dnl Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
|
|
|
dnl Copyright (c) 2001-2003 Greg Stein <gstein@users.sourceforge.net>
|
|
|
|
dnl Copyright (c) 2006-2012 Karl Waclawek <karl@waclawek.net>
|
|
|
|
dnl Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org>
|
|
|
|
dnl Copyright (c) 2017 S. P. Zeidler <spz@netbsd.org>
|
|
|
|
dnl Copyright (c) 2017 Stephen Groat <stephen@groat.us>
|
|
|
|
dnl Copyright (c) 2017-2020 Joe Orton <jorton@redhat.com>
|
|
|
|
dnl Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
|
|
|
|
dnl Copyright (c) 2018 Benjamin Peterson <benjamin@python.org>
|
|
|
|
dnl Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
|
|
|
|
dnl Copyright (c) 2018 KangLin <kl222@126.com>
|
|
|
|
dnl Copyright (c) 2019 Mohammed Khajapasha <mohammed.khajapasha@intel.com>
|
|
|
|
dnl Copyright (c) 2019 Kishore Kunche <kishore.kunche@intel.com>
|
|
|
|
dnl Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
|
2021-05-01 17:30:12 -04:00
|
|
|
dnl Licensed under the MIT license:
|
2000-09-18 12:26:23 -04:00
|
|
|
dnl
|
2021-05-01 17:30:12 -04:00
|
|
|
dnl Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
dnl a copy of this software and associated documentation files (the
|
|
|
|
dnl "Software"), to deal in the Software without restriction, including
|
|
|
|
dnl without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
dnl distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
|
|
dnl persons to whom the Software is furnished to do so, subject to the
|
|
|
|
dnl following conditions:
|
2000-09-18 12:26:23 -04:00
|
|
|
dnl
|
2021-05-01 17:30:12 -04:00
|
|
|
dnl The above copyright notice and this permission notice shall be included
|
|
|
|
dnl in all copies or substantial portions of the Software.
|
2000-09-18 12:26:23 -04:00
|
|
|
dnl
|
2021-05-01 17:30:12 -04:00
|
|
|
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
|
|
dnl NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
|
|
dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
|
|
dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
|
|
dnl USE OR OTHER DEALINGS IN THE SOFTWARE.
|
2000-09-18 12:26:23 -04:00
|
|
|
|
2018-10-19 01:07:06 -04:00
|
|
|
dnl Ensure that Expat is configured with autoconf 2.69 or newer.
|
2021-03-22 13:17:30 -04:00
|
|
|
AC_PREREQ([2.69])
|
2002-05-17 20:26:59 -04:00
|
|
|
|
|
|
|
dnl Get the version number of Expat, using m4's esyscmd() command to run
|
|
|
|
dnl the command at m4-generation time. This allows us to create an m4
|
2021-03-22 13:17:30 -04:00
|
|
|
dnl symbol holding the correct version number. AC_INIT requires the
|
2002-05-17 20:26:59 -04:00
|
|
|
dnl version number at m4-time, rather than when ./configure is run, so
|
|
|
|
dnl all this must happen as part of m4, not as part of the shell code
|
|
|
|
dnl contained in ./configure.
|
|
|
|
dnl
|
|
|
|
dnl NOTE: esyscmd() is a GNU M4 extension. Thus, we wrap it in an appropriate
|
|
|
|
dnl test. I believe this test will work, but I don't have a place with non-
|
|
|
|
dnl GNU M4 to test it right now.
|
2018-10-18 09:58:31 -04:00
|
|
|
m4_define([expat_version],
|
|
|
|
m4_ifdef([__gnu__],
|
|
|
|
[esyscmd(conftools/get-version.sh lib/expat.h)],
|
|
|
|
[2.2.x]))
|
2021-03-22 18:49:59 -04:00
|
|
|
AC_INIT([expat], expat_version, [expat-bugs@libexpat.org])
|
2018-10-18 09:58:31 -04:00
|
|
|
m4_undefine([expat_version])
|
2002-05-17 20:26:59 -04:00
|
|
|
|
2018-10-18 05:24:11 -04:00
|
|
|
AC_CONFIG_SRCDIR([Makefile.in])
|
|
|
|
AC_CONFIG_AUX_DIR([conftools])
|
2012-03-03 13:35:54 -05:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2018-10-28 01:24:01 -04:00
|
|
|
AC_CANONICAL_HOST
|
2018-10-18 05:24:11 -04:00
|
|
|
AM_INIT_AUTOMAKE
|
2000-09-18 12:26:23 -04:00
|
|
|
|
|
|
|
|
2000-09-26 09:52:33 -04:00
|
|
|
dnl
|
|
|
|
dnl Increment LIBREVISION if source code has changed at all
|
|
|
|
dnl
|
|
|
|
dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0
|
|
|
|
dnl
|
|
|
|
dnl If the API changes compatibly (i.e. simply adding a new function
|
|
|
|
dnl without changing or removing earlier interfaces), then increment LIBAGE.
|
2018-10-18 05:24:11 -04:00
|
|
|
dnl
|
2000-09-26 09:52:33 -04:00
|
|
|
dnl If the API changes incompatibly set LIBAGE back to 0
|
|
|
|
dnl
|
|
|
|
|
2021-05-11 10:00:52 -04:00
|
|
|
LIBCURRENT=9 # sync
|
2021-12-17 11:55:06 -05:00
|
|
|
LIBREVISION=2 # with
|
2021-05-11 10:00:52 -04:00
|
|
|
LIBAGE=8 # CMakeLists.txt!
|
2000-09-23 23:43:37 -04:00
|
|
|
|
2021-03-22 13:17:30 -04:00
|
|
|
AC_CONFIG_HEADERS([expat_config.h])
|
2000-09-28 13:53:00 -04:00
|
|
|
|
2018-10-18 05:24:11 -04:00
|
|
|
AM_PROG_AR
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
2001-08-23 07:27:26 -04:00
|
|
|
|
2018-10-18 05:24:11 -04:00
|
|
|
LT_PREREQ([2.4])
|
|
|
|
LT_INIT([win32-dll])
|
2000-09-18 12:26:23 -04:00
|
|
|
|
2000-09-23 23:43:37 -04:00
|
|
|
AC_SUBST(LIBCURRENT)
|
|
|
|
AC_SUBST(LIBREVISION)
|
|
|
|
AC_SUBST(LIBAGE)
|
|
|
|
|
2018-10-18 07:01:06 -04:00
|
|
|
AC_LANG([C])
|
2017-07-05 16:49:51 -04:00
|
|
|
AC_PROG_CC_C99
|
2020-03-13 13:50:31 -04:00
|
|
|
|
2018-10-18 06:26:04 -04:00
|
|
|
AS_IF([test "$GCC" = yes],
|
2020-03-13 13:50:31 -04:00
|
|
|
[AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CFLAGS])
|
2018-10-18 06:26:04 -04:00
|
|
|
dnl Be careful about adding the -fexceptions option; some versions of
|
|
|
|
dnl GCC don't support it and it causes extra warnings that are only
|
|
|
|
dnl distracting; avoid.
|
2020-03-13 13:50:31 -04:00
|
|
|
AX_APPEND_COMPILE_FLAGS([-fexceptions], [AM_CFLAGS])
|
|
|
|
AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [AM_CFLAGS])
|
|
|
|
AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [AM_CFLAGS])
|
|
|
|
AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [AM_CFLAGS])
|
2021-04-20 13:01:30 -04:00
|
|
|
AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wno-pedantic-ms-format -Wmisleading-indentation], [AM_CFLAGS])])
|
2018-10-18 06:26:04 -04:00
|
|
|
|
2018-10-18 07:01:06 -04:00
|
|
|
AC_LANG_PUSH([C++])
|
|
|
|
AC_PROG_CXX
|
2020-03-13 13:50:31 -04:00
|
|
|
|
2018-10-18 07:01:06 -04:00
|
|
|
AS_IF([test "$GCC" = yes],
|
2020-03-13 13:50:31 -04:00
|
|
|
[AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CXXFLAGS])
|
2018-10-18 07:01:06 -04:00
|
|
|
dnl Be careful about adding the -fexceptions option; some versions of
|
|
|
|
dnl GCC don't support it and it causes extra warnings that are only
|
|
|
|
dnl distracting; avoid.
|
2020-03-13 13:50:31 -04:00
|
|
|
AX_APPEND_COMPILE_FLAGS([-fexceptions], [AM_CXXFLAGS])
|
|
|
|
AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [AM_CXXFLAGS])])
|
2018-10-18 07:01:06 -04:00
|
|
|
AC_LANG_POP([C++])
|
2018-10-18 06:26:04 -04:00
|
|
|
|
2018-10-18 07:01:06 -04:00
|
|
|
AS_IF([test "$GCC" = yes],
|
2020-03-13 13:50:31 -04:00
|
|
|
[AX_APPEND_LINK_FLAGS([-fno-strict-aliasing],[AM_LDFLAGS])])
|
2001-07-25 13:25:46 -04:00
|
|
|
|
2019-09-09 15:06:42 -04:00
|
|
|
dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang (issue #312)
|
|
|
|
AS_CASE(["$LD"],[*clang*],
|
|
|
|
[AS_CASE(["${host_os}"],
|
|
|
|
[*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])
|
|
|
|
|
2018-10-20 06:57:22 -04:00
|
|
|
EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([
|
2020-03-13 13:50:31 -04:00
|
|
|
AX_APPEND_FLAG([-fvisibility=hidden], [AM_CFLAGS])
|
|
|
|
AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])])
|
2018-04-25 01:03:36 -04:00
|
|
|
|
2000-09-18 12:26:23 -04:00
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
2001-07-24 15:54:20 -04:00
|
|
|
|
2018-10-18 05:40:29 -04:00
|
|
|
dnl We define BYTEORDER to 1234 when the platform is little endian; it
|
2018-10-20 07:30:25 -04:00
|
|
|
dnl defines it to 4321 when the platform is big endian. We also define
|
|
|
|
dnl WORDS_BIGENDIAN to 1 when the platform is big endian.
|
2018-10-18 05:40:29 -04:00
|
|
|
dnl
|
2018-10-20 07:30:25 -04:00
|
|
|
dnl A long time ago (early 2000 years) AC_C_BIGENDIAN was considered
|
|
|
|
dnl wrong when cross compiling, now (2018, GNU Autoconf 2.69) we assume
|
|
|
|
dnl it is fine.
|
|
|
|
AC_C_BIGENDIAN([AC_DEFINE([WORDS_BIGENDIAN], 1)
|
|
|
|
AS_VAR_SET([BYTEORDER], 4321)],
|
|
|
|
[AS_VAR_SET([BYTEORDER], 1234)])
|
|
|
|
AC_DEFINE_UNQUOTED([BYTEORDER], $BYTEORDER, [1234 = LILENDIAN, 4321 = BIGENDIAN])
|
2001-07-24 15:54:20 -04:00
|
|
|
|
2000-09-18 12:26:23 -04:00
|
|
|
AC_C_CONST
|
|
|
|
AC_TYPE_SIZE_T
|
2017-05-25 11:46:42 -04:00
|
|
|
|
2018-10-18 06:13:03 -04:00
|
|
|
AC_ARG_WITH([xmlwf],
|
2019-08-11 10:49:08 -04:00
|
|
|
[AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])],
|
|
|
|
[],
|
2018-10-18 06:13:03 -04:00
|
|
|
[with_xmlwf=yes])
|
2017-08-11 13:14:18 -04:00
|
|
|
AM_CONDITIONAL([WITH_XMLWF], [test x${with_xmlwf} = xyes])
|
2017-08-11 16:22:59 -04:00
|
|
|
|
2019-08-11 10:49:08 -04:00
|
|
|
AC_ARG_WITH([examples],
|
|
|
|
[AS_HELP_STRING([--without-examples], [do not build examples @<:@default=included@:>@])],
|
|
|
|
[],
|
|
|
|
[with_examples=yes])
|
2018-10-15 21:53:52 -04:00
|
|
|
AM_CONDITIONAL([WITH_EXAMPLES], [test x${with_examples} = xyes])
|
|
|
|
|
2019-08-11 10:49:08 -04:00
|
|
|
AC_ARG_WITH([tests],
|
|
|
|
[AS_HELP_STRING([--without-tests], [do not build tests @<:@default=included@:>@])],
|
|
|
|
[],
|
|
|
|
[with_tests=yes])
|
2018-10-15 21:53:52 -04:00
|
|
|
AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes])
|
|
|
|
|
2018-10-28 01:24:01 -04:00
|
|
|
|
|
|
|
AS_VAR_SET([EXPATCFG_ON_MINGW],[no])
|
2019-07-21 16:37:00 -04:00
|
|
|
AS_CASE("${host_os}",
|
2018-10-28 01:24:01 -04:00
|
|
|
[mingw*],
|
|
|
|
[AS_VAR_SET([EXPATCFG_ON_MINGW],[yes])
|
2019-07-21 16:35:05 -04:00
|
|
|
AC_MSG_NOTICE([detected OS: MinGW])])
|
2019-07-21 16:37:00 -04:00
|
|
|
AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes])
|
2018-10-28 01:24:01 -04:00
|
|
|
|
2021-03-22 11:20:26 -04:00
|
|
|
dnl Note: Prefix "_INTERNAL_" here means exclusive use inside of file configure.ac
|
2017-11-02 16:30:21 -04:00
|
|
|
AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null])
|
2021-03-22 11:20:26 -04:00
|
|
|
AM_CONDITIONAL([_INTERNAL_UNICODE_WCHAR_T], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE_WCHAR_T >/dev/null])
|
|
|
|
AM_CONDITIONAL([_INTERNAL_MIN_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null])
|
|
|
|
AM_CONDITIONAL([_INTERNAL_LARGE_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_LARGE_SIZE >/dev/null])
|
2017-09-09 12:42:41 -04:00
|
|
|
|
2021-09-08 11:57:00 -04:00
|
|
|
LT_LIB_M
|
2017-08-11 16:22:59 -04:00
|
|
|
|
2018-10-18 06:13:03 -04:00
|
|
|
AC_ARG_WITH([libbsd],
|
|
|
|
[AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])],
|
|
|
|
[],
|
|
|
|
[with_libbsd=no])
|
|
|
|
AS_IF([test "x${with_libbsd}" != xno],
|
|
|
|
[AC_CHECK_LIB([bsd],
|
|
|
|
[arc4random_buf],
|
|
|
|
[],
|
|
|
|
[AS_IF([test "x${with_libbsd}" = xyes],
|
2019-08-11 10:49:08 -04:00
|
|
|
[AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])])
|
2017-05-25 12:21:57 -04:00
|
|
|
AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
2019-08-11 10:49:08 -04:00
|
|
|
#include <stdlib.h> /* for arc4random_buf on BSD, for NULL */
|
|
|
|
#if defined(HAVE_LIBBSD)
|
|
|
|
# include <bsd/stdlib.h>
|
|
|
|
#endif
|
|
|
|
int main() {
|
|
|
|
arc4random_buf(NULL, 0U);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
])],
|
2018-10-18 06:13:03 -04:00
|
|
|
[AC_DEFINE([HAVE_ARC4RANDOM_BUF], [1], [Define to 1 if you have the `arc4random_buf' function.])
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[AC_MSG_RESULT([no])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
2019-08-11 10:49:08 -04:00
|
|
|
#if defined(HAVE_LIBBSD)
|
|
|
|
# include <bsd/stdlib.h>
|
|
|
|
#else
|
|
|
|
# include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
int main() {
|
2017-07-15 10:44:46 -04:00
|
|
|
arc4random();
|
|
|
|
return 0;
|
2019-08-11 10:49:08 -04:00
|
|
|
}
|
2018-10-18 06:13:03 -04:00
|
|
|
])],
|
|
|
|
[AC_DEFINE([HAVE_ARC4RANDOM], [1], [Define to 1 if you have the `arc4random' function.])
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[AC_MSG_RESULT([no])])])
|
2017-05-25 12:21:57 -04:00
|
|
|
|
2019-08-06 05:11:23 -04:00
|
|
|
AC_ARG_WITH([getrandom],
|
|
|
|
[AS_HELP_STRING([--with-getrandom],
|
|
|
|
[enforce the use of getrandom function in the system @<:@default=check@:>@])
|
|
|
|
AS_HELP_STRING([--without-getrandom],
|
|
|
|
[skip auto detect of getrandom @<:@default=check@:>@])],
|
|
|
|
[],
|
|
|
|
[with_getrandom=check])
|
2017-05-25 12:21:57 -04:00
|
|
|
|
2019-08-06 05:11:23 -04:00
|
|
|
AS_IF([test "x$with_getrandom" != xno],
|
|
|
|
[AC_MSG_CHECKING([for getrandom (Linux 3.17+, glibc 2.25+)])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
|
|
|
#include <stdlib.h> /* for NULL */
|
|
|
|
#include <sys/random.h>
|
|
|
|
int main() {
|
|
|
|
return getrandom(NULL, 0U, 0U);
|
|
|
|
}
|
|
|
|
])],
|
|
|
|
[AC_DEFINE([HAVE_GETRANDOM], [1], [Define to 1 if you have the `getrandom' function.])
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[AC_MSG_RESULT([no])
|
|
|
|
AS_IF([test "x$with_getrandom" = xyes],
|
|
|
|
[AC_MSG_ERROR([enforced the use of getrandom --with-getrandom, but not detected])])])])
|
|
|
|
|
|
|
|
AC_ARG_WITH([sys_getrandom],
|
|
|
|
[AS_HELP_STRING([--with-sys-getrandom],
|
|
|
|
[enforce the use of syscall SYS_getrandom function in the system @<:@default=check@:>@])
|
|
|
|
AS_HELP_STRING([--without-sys-getrandom],
|
|
|
|
[skip auto detect of syscall SYS_getrandom @<:@default=check@:>@])],
|
|
|
|
[],
|
|
|
|
[with_sys_getrandom=check])
|
2018-10-18 06:13:03 -04:00
|
|
|
|
2019-08-06 05:11:23 -04:00
|
|
|
AS_IF([test "x$with_sys_getrandom" != xno],
|
|
|
|
[AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)])
|
2018-10-18 06:13:03 -04:00
|
|
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
2019-08-06 05:11:23 -04:00
|
|
|
#include <stdlib.h> /* for NULL */
|
|
|
|
#include <unistd.h> /* for syscall */
|
|
|
|
#include <sys/syscall.h> /* for SYS_getrandom */
|
|
|
|
int main() {
|
|
|
|
syscall(SYS_getrandom, NULL, 0, 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2018-10-18 06:13:03 -04:00
|
|
|
])],
|
2019-08-06 05:11:23 -04:00
|
|
|
[AC_DEFINE([HAVE_SYSCALL_GETRANDOM], [1], [Define to 1 if you have `syscall' and `SYS_getrandom'.])
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[AC_MSG_RESULT([no])
|
|
|
|
AS_IF([test "x$with_sys_getrandom" = xyes],
|
|
|
|
[AC_MSG_ERROR([enforced the use of syscall SYS_getrandom --with-sys-getrandom, but not detected])])])])
|
2017-05-25 11:46:42 -04:00
|
|
|
|
2003-10-16 00:32:39 -04:00
|
|
|
dnl Only needed for xmlwf:
|
|
|
|
AC_CHECK_HEADERS(fcntl.h unistd.h)
|
|
|
|
AC_TYPE_OFF_T
|
2000-09-18 12:26:23 -04:00
|
|
|
AC_FUNC_MMAP
|
2001-03-10 10:41:50 -05:00
|
|
|
|
2018-10-18 06:13:03 -04:00
|
|
|
AS_IF([test "$ac_cv_func_mmap_fixed_mapped" = "yes"],
|
|
|
|
[AS_VAR_SET(FILEMAP,unixfilemap)],
|
|
|
|
[AS_VAR_SET(FILEMAP,readfilemap)])
|
2001-12-07 05:19:31 -05:00
|
|
|
AC_SUBST(FILEMAP)
|
2000-09-18 12:26:23 -04:00
|
|
|
|
2005-01-28 01:32:31 -05:00
|
|
|
|
2003-10-16 00:32:39 -04:00
|
|
|
dnl Some basic configuration:
|
2002-05-17 17:30:07 -04:00
|
|
|
AC_DEFINE([XML_NS], 1,
|
|
|
|
[Define to make XML Namespaces functionality available.])
|
|
|
|
AC_DEFINE([XML_DTD], 1,
|
|
|
|
[Define to make parameter entity parsing functionality available.])
|
2017-07-29 15:29:14 -04:00
|
|
|
AC_DEFINE([XML_DEV_URANDOM], 1,
|
|
|
|
[Define to include code reading entropy from `/dev/urandom'.])
|
2017-04-12 17:41:44 -04:00
|
|
|
|
2019-06-19 05:30:47 -04:00
|
|
|
AC_ARG_ENABLE([xml-attr-info],
|
|
|
|
[AS_HELP_STRING([--enable-xml-attr-info],
|
2019-08-11 10:49:08 -04:00
|
|
|
[Enable retrieving the byte offsets for attribute names and values @<:@default=no@:>@])],
|
|
|
|
[],
|
|
|
|
[enable_xml_attr_info=no])
|
2019-06-19 05:30:47 -04:00
|
|
|
AS_IF([test "x${enable_xml_attr_info}" = "xyes"],
|
|
|
|
[AC_DEFINE([XML_ATTR_INFO], 1,
|
|
|
|
[Define to allow retrieving the byte offsets for attribute names and values.])])
|
|
|
|
|
2017-04-12 17:41:44 -04:00
|
|
|
AC_ARG_ENABLE([xml-context],
|
|
|
|
AS_HELP_STRING([--enable-xml-context @<:@COUNT@:>@],
|
|
|
|
[Retain context around the current parse point;
|
2018-10-18 06:13:03 -04:00
|
|
|
default is enabled and a size of 1024 bytes])
|
2018-10-21 08:13:11 -04:00
|
|
|
AS_HELP_STRING([--disable-xml-context],
|
2017-04-12 17:41:44 -04:00
|
|
|
[Do not retain context around the current parse point]),
|
2018-10-18 06:13:03 -04:00
|
|
|
[enable_xml_context=${enableval}])
|
|
|
|
AS_IF([test "x${enable_xml_context}" != "xno"],
|
|
|
|
[AS_IF([test "x${enable_xml_context}" = "xyes" \
|
|
|
|
-o "x${enable_xml_context}" = "x"],
|
|
|
|
[AS_VAR_SET(enable_xml_context,1024)])
|
|
|
|
AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}],
|
|
|
|
[Define to specify how much context to retain around the current parse point.])])
|
|
|
|
|
|
|
|
AC_ARG_WITH([docbook],
|
|
|
|
[AS_HELP_STRING([--with-docbook],
|
|
|
|
[enforce XML to man page compilation @<:@default=check@:>@])
|
2018-10-21 08:13:11 -04:00
|
|
|
AS_HELP_STRING([--without-docbook],
|
2019-08-11 10:49:08 -04:00
|
|
|
[skip XML to man page compilation @<:@default=check@:>@])],
|
|
|
|
[],
|
|
|
|
[with_docbook=check])
|
2017-10-04 11:11:01 -04:00
|
|
|
|
2017-10-21 13:44:16 -04:00
|
|
|
AC_ARG_VAR([DOCBOOK_TO_MAN], [docbook2x-man command])
|
2017-10-04 11:11:01 -04:00
|
|
|
AS_IF([test "x$with_docbook" != xno],
|
2018-02-28 09:07:21 -05:00
|
|
|
[AC_CHECK_PROGS([DOCBOOK_TO_MAN], [docbook2x-man db2x_docbook2man docbook2man docbook-to-man])])
|
2017-11-02 16:59:38 -04:00
|
|
|
AS_IF([test "x${DOCBOOK_TO_MAN}" = x -a "x$with_docbook" = xyes],
|
|
|
|
[AC_MSG_ERROR([Required program 'docbook2x-man' not found.])])
|
2018-06-30 16:16:59 -04:00
|
|
|
AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno],
|
|
|
|
[AS_IF([${DOCBOOK_TO_MAN} --help | grep -i -q -F sgmlbase],
|
2018-06-30 16:18:12 -04:00
|
|
|
[AC_MSG_ERROR([Your local ${DOCBOOK_TO_MAN} was found to work with SGML rather
|
2018-02-14 15:51:29 -05:00
|
|
|
than XML. Please install docbook2X and use variable DOCBOOK_TO_MAN to point
|
|
|
|
configure to command docbook2x-man of docbook2X.
|
|
|
|
Or use DOCBOOK_TO_MAN="xmlto man --skip-validation" if you have xmlto around.
|
|
|
|
You can also configure using --without-docbook if you can do without a man
|
2018-06-30 16:16:59 -04:00
|
|
|
page for xmlwf.])])])
|
2017-10-04 11:11:01 -04:00
|
|
|
|
2017-11-02 04:29:15 -04:00
|
|
|
AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x])
|
2017-10-04 11:11:01 -04:00
|
|
|
|
2021-03-22 11:20:26 -04:00
|
|
|
|
|
|
|
dnl Configure CMake file templates
|
|
|
|
dnl NOTE: The *_TRUE variables read here are Automake conditionals
|
|
|
|
dnl that are either set to "" when enabled or to "#" when disabled
|
|
|
|
dnl (because they are used to dynamically comment out certain things)
|
|
|
|
AS_IF([test "x${enable_xml_attr_info}" = xyes],
|
|
|
|
[EXPAT_ATTR_INFO=ON],
|
|
|
|
[EXPAT_ATTR_INFO=OFF])
|
|
|
|
EXPAT_DTD=ON
|
|
|
|
AS_IF([test "x${_INTERNAL_LARGE_SIZE_TRUE}" = x],
|
|
|
|
[EXPAT_LARGE_SIZE=ON],
|
|
|
|
[EXPAT_LARGE_SIZE=OFF])
|
|
|
|
AS_IF([test "x${_INTERNAL_MIN_SIZE_TRUE}" = x],
|
|
|
|
[EXPAT_MIN_SIZE=ON],
|
|
|
|
[EXPAT_MIN_SIZE=OFF])
|
|
|
|
EXPAT_NS=ON
|
|
|
|
AS_IF([test "x${enable_xml_context}" != xno],
|
|
|
|
[EXPAT_CONTEXT_BYTES=${enable_xml_context}],
|
|
|
|
[EXPAT_CONTEXT_BYTES=OFF])
|
|
|
|
AS_IF([test "x${UNICODE_TRUE}" = x],
|
|
|
|
[AS_IF(
|
|
|
|
[test "x${_INTERNAL_UNICODE_WCHAR_T_TRUE}" = x],
|
|
|
|
[EXPAT_CHAR_TYPE=wchar_t],
|
|
|
|
[EXPAT_CHAR_TYPE=ushort])],
|
|
|
|
[EXPAT_CHAR_TYPE=char])
|
|
|
|
PACKAGE_INIT="${srcdir}"/cmake/autotools/expat-package-init.cmake
|
|
|
|
LIBDIR_BASENAME="$(basename "${libdir}")"
|
|
|
|
SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")"
|
|
|
|
SO_MINOR="${LIBAGE}"
|
|
|
|
SO_PATCH="${LIBREVISION}"
|
2021-05-20 09:29:21 -04:00
|
|
|
AC_CHECK_SIZEOF([void *]) # sets ac_cv_sizeof_void_p
|
2021-03-22 11:20:26 -04:00
|
|
|
AC_SUBST([EXPAT_ATTR_INFO])
|
|
|
|
AC_SUBST([EXPAT_DTD])
|
|
|
|
AC_SUBST([EXPAT_LARGE_SIZE])
|
|
|
|
AC_SUBST([EXPAT_MIN_SIZE])
|
|
|
|
AC_SUBST([EXPAT_NS])
|
|
|
|
AC_SUBST([EXPAT_CONTEXT_BYTES])
|
|
|
|
AC_SUBST([EXPAT_CHAR_TYPE])
|
|
|
|
AC_SUBST_FILE([PACKAGE_INIT])
|
|
|
|
AC_SUBST([LIBDIR_BASENAME])
|
|
|
|
AC_SUBST([SO_MAJOR])
|
|
|
|
AC_SUBST([SO_MINOR])
|
|
|
|
AC_SUBST([SO_PATCH])
|
2021-05-20 09:29:21 -04:00
|
|
|
AC_SUBST([ac_cv_sizeof_void_p])
|
2021-03-22 11:20:26 -04:00
|
|
|
|
|
|
|
|
2020-03-13 13:50:31 -04:00
|
|
|
dnl write the Automake flags we set
|
|
|
|
AC_SUBST([AM_CPPFLAGS])
|
|
|
|
AC_SUBST([AM_CFLAGS])
|
|
|
|
AC_SUBST([AM_CXXFLAGS])
|
|
|
|
AC_SUBST([AM_LDFLAGS])
|
|
|
|
|
2021-05-20 10:07:03 -04:00
|
|
|
AS_CASE("${host_os}",
|
|
|
|
[darwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in],
|
|
|
|
[mingw*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in],
|
|
|
|
[CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in])
|
2018-10-18 06:13:03 -04:00
|
|
|
AC_CONFIG_FILES([Makefile]
|
|
|
|
[expat.pc]
|
2021-03-22 11:20:26 -04:00
|
|
|
[cmake/expat-config.cmake]
|
|
|
|
[cmake/autotools/expat-config-version.cmake]
|
2021-05-20 10:07:03 -04:00
|
|
|
[cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE}]
|
2018-10-18 06:13:03 -04:00
|
|
|
[doc/Makefile]
|
|
|
|
[examples/Makefile]
|
|
|
|
[lib/Makefile]
|
|
|
|
[tests/Makefile]
|
|
|
|
[tests/benchmark/Makefile]
|
|
|
|
[xmlwf/Makefile])
|
2017-06-04 11:43:47 -04:00
|
|
|
AC_CONFIG_FILES([run.sh], [chmod +x run.sh])
|
2002-05-17 20:26:59 -04:00
|
|
|
AC_OUTPUT
|
2020-03-13 13:50:31 -04:00
|
|
|
|
2020-03-17 15:39:41 -04:00
|
|
|
|
2020-03-18 06:56:10 -04:00
|
|
|
AC_MSG_NOTICE([
|
2020-03-17 15:39:41 -04:00
|
|
|
|
|
|
|
Automake flags (can be overridden by user flags):
|
2020-03-17 16:10:52 -04:00
|
|
|
[AM_CPPFLAGS]: ${AM_CPPFLAGS}
|
|
|
|
[AM_CFLAGS]: ${AM_CFLAGS}
|
|
|
|
[AM_CXXFLAGS]: ${AM_CXXFLAGS}
|
|
|
|
[AM_LDFLAGS]: ${AM_LDFLAGS}
|
2020-03-17 15:39:41 -04:00
|
|
|
|
|
|
|
User flags (override Automake flags on conflict):
|
|
|
|
CPPFLAGS: ${CPPFLAGS}
|
|
|
|
CFLAGS: ${CFLAGS}
|
|
|
|
CXXFLAGS: ${CXXFLAGS}
|
2020-03-18 17:26:47 -04:00
|
|
|
LDFLAGS: ${LDFLAGS}])
|