2000-09-18 12:26:23 -04:00
|
|
|
dnl configuration script for expat
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
dnl
|
|
|
|
dnl Copyright 2000 Clark Cooper
|
|
|
|
dnl
|
|
|
|
dnl This file is part of EXPAT.
|
|
|
|
dnl
|
|
|
|
dnl EXPAT is free software; you can redistribute it and/or modify it
|
|
|
|
dnl under the terms of the License (based on the MIT/X license) contained
|
|
|
|
dnl in the file COPYING that comes with this distribution.
|
|
|
|
dnl
|
|
|
|
|
2012-03-03 13:35:54 -05:00
|
|
|
dnl Ensure that Expat is configured with autoconf 2.58 or newer
|
|
|
|
AC_PREREQ(2.58)
|
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
|
|
|
|
dnl symbol holding the correct version number. AC_INIT() requires the
|
|
|
|
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.
|
|
|
|
define([expat_version], ifdef([__gnu__],
|
|
|
|
[esyscmd(conftools/get-version.sh lib/expat.h)],
|
2016-06-17 17:52:19 -04:00
|
|
|
[2.2.x]))
|
2006-01-10 20:10:46 -05:00
|
|
|
AC_INIT(expat, expat_version, expat-bugs@libexpat.org)
|
2002-05-17 20:26:59 -04:00
|
|
|
undefine([expat_version])
|
|
|
|
|
|
|
|
AC_CONFIG_SRCDIR(Makefile.in)
|
2000-09-18 12:26:23 -04:00
|
|
|
AC_CONFIG_AUX_DIR(conftools)
|
2017-08-11 13:14:18 -04:00
|
|
|
AM_INIT_AUTOMAKE
|
2012-03-03 13:35:54 -05:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
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.
|
|
|
|
dnl
|
|
|
|
dnl If the API changes incompatibly set LIBAGE back to 0
|
|
|
|
dnl
|
|
|
|
|
2016-05-28 13:38:59 -04:00
|
|
|
LIBCURRENT=7 # sync
|
2017-10-27 14:05:20 -04:00
|
|
|
LIBREVISION=7 # with
|
2016-05-28 13:38:59 -04:00
|
|
|
LIBAGE=6 # CMakeLists.txt!
|
2000-09-23 23:43:37 -04:00
|
|
|
|
2017-08-11 13:14:18 -04:00
|
|
|
CPPFLAGS="${CPPFLAGS} -DHAVE_EXPAT_CONFIG_H"
|
2002-05-17 17:30:07 -04:00
|
|
|
AC_CONFIG_HEADER(expat_config.h)
|
2000-09-28 13:53:00 -04:00
|
|
|
|
2001-08-23 07:27:26 -04:00
|
|
|
sinclude(conftools/ac_c_bigendian_cross.m4)
|
|
|
|
|
2000-09-28 13:53:00 -04:00
|
|
|
AC_LIBTOOL_WIN32_DLL
|
2000-09-18 12:26:23 -04:00
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
|
2000-09-23 23:43:37 -04:00
|
|
|
AC_SUBST(LIBCURRENT)
|
|
|
|
AC_SUBST(LIBREVISION)
|
|
|
|
AC_SUBST(LIBAGE)
|
|
|
|
|
2000-09-18 12:26:23 -04:00
|
|
|
dnl Checks for programs.
|
2017-07-05 16:49:51 -04:00
|
|
|
AC_PROG_CC_C99
|
2012-03-03 18:45:53 -05:00
|
|
|
AC_PROG_CXX
|
2000-09-18 12:26:23 -04:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
2001-07-25 13:25:46 -04:00
|
|
|
if test "$GCC" = yes ; then
|
2001-11-08 23:19:01 -05:00
|
|
|
dnl
|
|
|
|
dnl Be careful about adding the -fexceptions option; some versions of
|
2002-04-20 17:14:48 -04:00
|
|
|
dnl GCC don't support it and it causes extra warnings that are only
|
2001-11-08 23:19:01 -05:00
|
|
|
dnl distracting; avoid.
|
|
|
|
dnl
|
|
|
|
OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes"
|
|
|
|
CFLAGS="$OLDCFLAGS -fexceptions"
|
2007-05-09 09:26:48 -04:00
|
|
|
AC_MSG_CHECKING(whether $CC accepts -fexceptions)
|
|
|
|
AC_TRY_LINK( , ,
|
2001-11-08 23:19:01 -05:00
|
|
|
AC_MSG_RESULT(yes),
|
|
|
|
AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS")
|
2016-05-15 07:50:06 -04:00
|
|
|
if test "x$CXXFLAGS" = x ; then
|
2006-01-25 18:04:46 -05:00
|
|
|
CXXFLAGS=`echo "$CFLAGS" | sed 's/ -Wmissing-prototypes -Wstrict-prototypes//'`
|
2016-05-15 07:50:06 -04:00
|
|
|
fi
|
2016-08-12 09:45:05 -04:00
|
|
|
|
|
|
|
CFLAGS="${CFLAGS} -fno-strict-aliasing"
|
|
|
|
CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
|
|
|
|
LDFLAGS="${LDFLAGS} -fno-strict-aliasing"
|
2001-07-25 13:25:46 -04:00
|
|
|
fi
|
|
|
|
|
2000-09-18 12:26:23 -04:00
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
2001-07-24 15:54:20 -04:00
|
|
|
|
|
|
|
dnl Note: Avoid using AC_C_BIGENDIAN because it does not
|
|
|
|
dnl work in a cross compile.
|
|
|
|
AC_C_BIGENDIAN_CROSS
|
|
|
|
|
2000-09-18 12:26:23 -04:00
|
|
|
AC_C_CONST
|
|
|
|
AC_TYPE_SIZE_T
|
2003-10-16 00:32:39 -04:00
|
|
|
AC_CHECK_FUNCS(memmove bcopy)
|
2000-09-18 12:26:23 -04:00
|
|
|
|
2017-05-25 11:46:42 -04:00
|
|
|
|
2017-08-11 16:22:59 -04:00
|
|
|
AC_ARG_WITH([xmlwf], [
|
|
|
|
AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], [], [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
|
|
|
|
2017-11-02 16:30:21 -04:00
|
|
|
AM_CONDITIONAL([MINGW], [echo -- "${host}" | ${FGREP} mingw >/dev/null])
|
|
|
|
AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null])
|
2017-09-09 12:42:41 -04:00
|
|
|
|
2017-08-11 16:22:59 -04:00
|
|
|
|
2017-05-25 14:58:34 -04:00
|
|
|
AC_ARG_WITH([libbsd], [
|
2017-06-01 14:40:36 -04:00
|
|
|
AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])
|
|
|
|
], [], [with_libbsd=no])
|
2017-05-25 14:58:34 -04:00
|
|
|
AS_IF([test "x${with_libbsd}" != xno], [
|
|
|
|
AC_CHECK_LIB([bsd], [arc4random_buf], [], [
|
|
|
|
AS_IF([test "x${with_libbsd}" = xyes], [
|
|
|
|
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([
|
|
|
|
#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;
|
|
|
|
}
|
|
|
|
])], [
|
|
|
|
AC_DEFINE([HAVE_ARC4RANDOM_BUF], [1],
|
|
|
|
[Define to 1 if you have the `arc4random_buf' function.])
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
2017-07-15 10:44:46 -04:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
|
|
|
#if defined(HAVE_LIBBSD)
|
|
|
|
# include <bsd/stdlib.h>
|
|
|
|
#else
|
|
|
|
# include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
int main() {
|
|
|
|
arc4random();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
])], [
|
|
|
|
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
|
|
|
])
|
|
|
|
|
|
|
|
|
2017-05-25 11:46:42 -04:00
|
|
|
AC_MSG_CHECKING([for getrandom (Linux 3.17+, glibc 2.25+)])
|
2017-06-18 12:55:10 -04:00
|
|
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
2017-05-25 11:46:42 -04:00
|
|
|
#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])
|
2017-05-31 17:23:37 -04:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
|
|
|
#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;
|
|
|
|
}
|
|
|
|
])], [
|
|
|
|
AC_DEFINE([HAVE_SYSCALL_GETRANDOM], [1],
|
|
|
|
[Define to 1 if you have `syscall' and `SYS_getrandom'.])
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
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
|
|
|
|
2001-11-08 23:19:01 -05:00
|
|
|
if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then
|
2001-12-07 05:19:31 -05:00
|
|
|
FILEMAP=unixfilemap
|
2000-09-18 12:26:23 -04:00
|
|
|
else
|
2001-12-07 05:19:31 -05:00
|
|
|
FILEMAP=readfilemap
|
2000-09-18 12:26:23 -04:00
|
|
|
fi
|
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
|
|
|
|
|
|
|
AC_ARG_ENABLE([xml-context],
|
|
|
|
AS_HELP_STRING([--enable-xml-context @<:@COUNT@:>@],
|
|
|
|
[Retain context around the current parse point;
|
|
|
|
default is enabled and a size of 1024 bytes])
|
|
|
|
AS_HELP_STRING([--disable-xml-context],
|
|
|
|
[Do not retain context around the current parse point]),
|
|
|
|
[enable_xml_context=${enableval}])
|
|
|
|
AS_IF([test "x${enable_xml_context}" != "xno"], [
|
2017-06-18 08:30:22 -04:00
|
|
|
AS_IF([test "x${enable_xml_context}" = "xyes" \
|
|
|
|
-o "x${enable_xml_context}" = "x"], [
|
2017-04-12 17:41:44 -04:00
|
|
|
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.])
|
|
|
|
])
|
2002-05-17 17:30:07 -04:00
|
|
|
|
2017-10-21 13:48:23 -04:00
|
|
|
AC_ARG_WITH([docbook], [AS_HELP_STRING([--with-docbook],
|
|
|
|
[enforce XML to man page compilation @<:@default=check@:>@])
|
|
|
|
AS_HELP_STRING([--without-docbook],
|
|
|
|
[skip XML to man page compilation @<:@default=check@:>@])],
|
2017-10-04 11:11:01 -04:00
|
|
|
[],
|
|
|
|
[with_docbook=check])
|
|
|
|
|
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],
|
2017-10-27 13:46:18 -04:00
|
|
|
[AC_CHECK_PROGS([DOCBOOK_TO_MAN], [docbook2x-man docbook2man docbook-to-man],
|
2017-10-04 11:11:01 -04:00
|
|
|
[if test "x$with_docbook" != xcheck; then
|
|
|
|
AC_MSG_ERROR([Required program 'docbook2x-man' not found.])])])
|
|
|
|
|
|
|
|
AM_CONDITIONAL(WITH_DOCBOOK, [test x${DOCBOOK_TO_MAN} != x])
|
|
|
|
|
2007-09-03 13:26:20 -04:00
|
|
|
AC_CONFIG_FILES([Makefile expat.pc])
|
2017-08-11 13:14:18 -04:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
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
|