Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 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 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 13 | dnl Ensure that Expat is configured with autoconf 2.69 or newer. |
| 14 | AC_PREREQ(2.69) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 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. |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 26 | m4_define([expat_version], |
| 27 | m4_ifdef([__gnu__], |
| 28 | [esyscmd(conftools/get-version.sh lib/expat.h)], |
| 29 | [2.2.x])) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 30 | AC_INIT(expat, expat_version, expat-bugs@libexpat.org) |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 31 | m4_undefine([expat_version]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 32 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 33 | AC_CONFIG_SRCDIR([Makefile.in]) |
| 34 | AC_CONFIG_AUX_DIR([conftools]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 35 | AC_CONFIG_MACRO_DIR([m4]) |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 36 | AC_CANONICAL_HOST |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 37 | AM_INIT_AUTOMAKE |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 38 | |
| 39 | |
| 40 | dnl |
| 41 | dnl Increment LIBREVISION if source code has changed at all |
| 42 | dnl |
| 43 | dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0 |
| 44 | dnl |
| 45 | dnl If the API changes compatibly (i.e. simply adding a new function |
| 46 | dnl without changing or removing earlier interfaces), then increment LIBAGE. |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 47 | dnl |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 48 | dnl If the API changes incompatibly set LIBAGE back to 0 |
| 49 | dnl |
| 50 | |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 51 | LIBCURRENT=7 # sync |
| 52 | LIBREVISION=11 # with |
| 53 | LIBAGE=6 # CMakeLists.txt! |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 54 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 55 | AX_APPEND_FLAG([-DHAVE_EXPAT_CONFIG_H], [CPPFLAGS]) |
| 56 | AC_CONFIG_HEADER([expat_config.h]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 57 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 58 | AM_PROG_AR |
| 59 | AC_PROG_INSTALL |
| 60 | AC_PROG_LN_S |
| 61 | AC_PROG_MAKE_SET |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 62 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 63 | LT_PREREQ([2.4]) |
| 64 | LT_INIT([win32-dll]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 65 | |
| 66 | AC_SUBST(LIBCURRENT) |
| 67 | AC_SUBST(LIBREVISION) |
| 68 | AC_SUBST(LIBAGE) |
| 69 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 70 | AC_LANG([C]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 71 | AC_PROG_CC_C99 |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 72 | AS_IF([test "$GCC" = yes], |
| 73 | [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [CFLAGS]) |
| 74 | dnl Be careful about adding the -fexceptions option; some versions of |
| 75 | dnl GCC don't support it and it causes extra warnings that are only |
| 76 | dnl distracting; avoid. |
| 77 | AX_APPEND_COMPILE_FLAGS([-fexceptions], [CFLAGS]) |
| 78 | AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [CFLAGS]) |
| 79 | AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [CFLAGS]) |
| 80 | AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [CFLAGS]) |
| 81 | AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wmisleading-indentation], [CFLAGS])]) |
| 82 | |
| 83 | AC_LANG_PUSH([C++]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 84 | AC_PROG_CXX |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 85 | AS_IF([test "$GCC" = yes], |
| 86 | [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [CXXFLAGS]) |
| 87 | dnl Be careful about adding the -fexceptions option; some versions of |
| 88 | dnl GCC don't support it and it causes extra warnings that are only |
| 89 | dnl distracting; avoid. |
| 90 | AX_APPEND_COMPILE_FLAGS([-fexceptions], [CXXFLAGS]) |
| 91 | AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [CXXFLAGS])]) |
| 92 | AC_LANG_POP([C++]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 93 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 94 | AS_IF([test "$GCC" = yes], |
| 95 | [AX_APPEND_LINK_FLAGS([-fno-strict-aliasing],[LDFLAGS])]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 96 | |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 97 | dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang (issue #312) |
| 98 | AS_CASE(["$LD"],[*clang*], |
| 99 | [AS_CASE(["${host_os}"], |
| 100 | [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])]) |
| 101 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 102 | EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([ |
| 103 | AX_APPEND_FLAG([-fvisibility=hidden], [CFLAGS]) |
| 104 | AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [CFLAGS])]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 105 | |
| 106 | dnl Checks for header files. |
| 107 | AC_HEADER_STDC |
| 108 | |
| 109 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 110 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 111 | dnl We define BYTEORDER to 1234 when the platform is little endian; it |
| 112 | dnl defines it to 4321 when the platform is big endian. We also define |
| 113 | dnl WORDS_BIGENDIAN to 1 when the platform is big endian. |
| 114 | dnl |
| 115 | dnl A long time ago (early 2000 years) AC_C_BIGENDIAN was considered |
| 116 | dnl wrong when cross compiling, now (2018, GNU Autoconf 2.69) we assume |
| 117 | dnl it is fine. |
| 118 | AC_C_BIGENDIAN([AC_DEFINE([WORDS_BIGENDIAN], 1) |
| 119 | AS_VAR_SET([BYTEORDER], 4321)], |
| 120 | [AS_VAR_SET([BYTEORDER], 1234)]) |
| 121 | AC_DEFINE_UNQUOTED([BYTEORDER], $BYTEORDER, [1234 = LILENDIAN, 4321 = BIGENDIAN]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 122 | |
| 123 | AC_C_CONST |
| 124 | AC_TYPE_SIZE_T |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 125 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 126 | AC_ARG_WITH([xmlwf], |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 127 | [AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], |
| 128 | [], |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 129 | [with_xmlwf=yes]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 130 | AM_CONDITIONAL([WITH_XMLWF], [test x${with_xmlwf} = xyes]) |
| 131 | |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 132 | AC_ARG_WITH([examples], |
| 133 | [AS_HELP_STRING([--without-examples], [do not build examples @<:@default=included@:>@])], |
| 134 | [], |
| 135 | [with_examples=yes]) |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 136 | AM_CONDITIONAL([WITH_EXAMPLES], [test x${with_examples} = xyes]) |
| 137 | |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 138 | AC_ARG_WITH([tests], |
| 139 | [AS_HELP_STRING([--without-tests], [do not build tests @<:@default=included@:>@])], |
| 140 | [], |
| 141 | [with_tests=yes]) |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 142 | AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes]) |
| 143 | |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 144 | |
| 145 | AS_VAR_SET([EXPATCFG_ON_MINGW],[no]) |
| 146 | AS_CASE("${host_os}", |
| 147 | [mingw*], |
| 148 | [AS_VAR_SET([EXPATCFG_ON_MINGW],[yes]) |
| 149 | AC_MSG_NOTICE([detected OS: MinGW])]) |
| 150 | AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes]) |
| 151 | |
Elliott Hughes | aaec48e | 2018-08-16 16:29:01 -0700 | [diff] [blame] | 152 | AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 153 | |
| 154 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 155 | AC_ARG_WITH([libbsd], |
| 156 | [AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])], |
| 157 | [], |
| 158 | [with_libbsd=no]) |
| 159 | AS_IF([test "x${with_libbsd}" != xno], |
| 160 | [AC_CHECK_LIB([bsd], |
| 161 | [arc4random_buf], |
| 162 | [], |
| 163 | [AS_IF([test "x${with_libbsd}" = xyes], |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 164 | [AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 165 | AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)]) |
| 166 | AC_LINK_IFELSE([AC_LANG_SOURCE([ |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 167 | #include <stdlib.h> /* for arc4random_buf on BSD, for NULL */ |
| 168 | #if defined(HAVE_LIBBSD) |
| 169 | # include <bsd/stdlib.h> |
| 170 | #endif |
| 171 | int main() { |
| 172 | arc4random_buf(NULL, 0U); |
| 173 | return 0; |
| 174 | } |
| 175 | ])], |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 176 | [AC_DEFINE([HAVE_ARC4RANDOM_BUF], [1], [Define to 1 if you have the `arc4random_buf' function.]) |
| 177 | AC_MSG_RESULT([yes])], |
| 178 | [AC_MSG_RESULT([no]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 179 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 180 | AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)]) |
| 181 | AC_LINK_IFELSE([AC_LANG_SOURCE([ |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 182 | #if defined(HAVE_LIBBSD) |
| 183 | # include <bsd/stdlib.h> |
| 184 | #else |
| 185 | # include <stdlib.h> |
| 186 | #endif |
| 187 | int main() { |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 188 | arc4random(); |
| 189 | return 0; |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 190 | } |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 191 | ])], |
| 192 | [AC_DEFINE([HAVE_ARC4RANDOM], [1], [Define to 1 if you have the `arc4random' function.]) |
| 193 | AC_MSG_RESULT([yes])], |
| 194 | [AC_MSG_RESULT([no])])]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 195 | |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 196 | AC_ARG_WITH([getrandom], |
| 197 | [AS_HELP_STRING([--with-getrandom], |
| 198 | [enforce the use of getrandom function in the system @<:@default=check@:>@]) |
| 199 | AS_HELP_STRING([--without-getrandom], |
| 200 | [skip auto detect of getrandom @<:@default=check@:>@])], |
| 201 | [], |
| 202 | [with_getrandom=check]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 203 | |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 204 | AS_IF([test "x$with_getrandom" != xno], |
| 205 | [AC_MSG_CHECKING([for getrandom (Linux 3.17+, glibc 2.25+)]) |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 206 | AC_LINK_IFELSE([AC_LANG_SOURCE([ |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 207 | #include <stdlib.h> /* for NULL */ |
| 208 | #include <sys/random.h> |
| 209 | int main() { |
| 210 | return getrandom(NULL, 0U, 0U); |
| 211 | } |
| 212 | ])], |
| 213 | [AC_DEFINE([HAVE_GETRANDOM], [1], [Define to 1 if you have the `getrandom' function.]) |
| 214 | AC_MSG_RESULT([yes])], |
| 215 | [AC_MSG_RESULT([no]) |
| 216 | AS_IF([test "x$with_getrandom" = xyes], |
| 217 | [AC_MSG_ERROR([enforced the use of getrandom --with-getrandom, but not detected])])])]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 218 | |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 219 | AC_ARG_WITH([sys_getrandom], |
| 220 | [AS_HELP_STRING([--with-sys-getrandom], |
| 221 | [enforce the use of syscall SYS_getrandom function in the system @<:@default=check@:>@]) |
| 222 | AS_HELP_STRING([--without-sys-getrandom], |
| 223 | [skip auto detect of syscall SYS_getrandom @<:@default=check@:>@])], |
| 224 | [], |
| 225 | [with_sys_getrandom=check]) |
| 226 | |
| 227 | AS_IF([test "x$with_sys_getrandom" != xno], |
| 228 | [AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)]) |
| 229 | AC_LINK_IFELSE([AC_LANG_SOURCE([ |
| 230 | #include <stdlib.h> /* for NULL */ |
| 231 | #include <unistd.h> /* for syscall */ |
| 232 | #include <sys/syscall.h> /* for SYS_getrandom */ |
| 233 | int main() { |
| 234 | syscall(SYS_getrandom, NULL, 0, 0); |
| 235 | return 0; |
| 236 | } |
| 237 | ])], |
| 238 | [AC_DEFINE([HAVE_SYSCALL_GETRANDOM], [1], [Define to 1 if you have `syscall' and `SYS_getrandom'.]) |
| 239 | AC_MSG_RESULT([yes])], |
| 240 | [AC_MSG_RESULT([no]) |
| 241 | AS_IF([test "x$with_sys_getrandom" = xyes], |
| 242 | [AC_MSG_ERROR([enforced the use of syscall SYS_getrandom --with-sys-getrandom, but not detected])])])]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 243 | |
| 244 | dnl Only needed for xmlwf: |
| 245 | AC_CHECK_HEADERS(fcntl.h unistd.h) |
| 246 | AC_TYPE_OFF_T |
| 247 | AC_FUNC_MMAP |
| 248 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 249 | AS_IF([test "$ac_cv_func_mmap_fixed_mapped" = "yes"], |
| 250 | [AS_VAR_SET(FILEMAP,unixfilemap)], |
| 251 | [AS_VAR_SET(FILEMAP,readfilemap)]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 252 | AC_SUBST(FILEMAP) |
| 253 | |
| 254 | |
| 255 | dnl Some basic configuration: |
| 256 | AC_DEFINE([XML_NS], 1, |
| 257 | [Define to make XML Namespaces functionality available.]) |
| 258 | AC_DEFINE([XML_DTD], 1, |
| 259 | [Define to make parameter entity parsing functionality available.]) |
| 260 | AC_DEFINE([XML_DEV_URANDOM], 1, |
| 261 | [Define to include code reading entropy from `/dev/urandom'.]) |
| 262 | |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 263 | AC_ARG_ENABLE([xml-attr-info], |
| 264 | [AS_HELP_STRING([--enable-xml-attr-info], |
| 265 | [Enable retrieving the byte offsets for attribute names and values @<:@default=no@:>@])], |
| 266 | [], |
| 267 | [enable_xml_attr_info=no]) |
| 268 | AS_IF([test "x${enable_xml_attr_info}" = "xyes"], |
| 269 | [AC_DEFINE([XML_ATTR_INFO], 1, |
| 270 | [Define to allow retrieving the byte offsets for attribute names and values.])]) |
| 271 | |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 272 | AC_ARG_ENABLE([xml-context], |
| 273 | AS_HELP_STRING([--enable-xml-context @<:@COUNT@:>@], |
| 274 | [Retain context around the current parse point; |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 275 | default is enabled and a size of 1024 bytes]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 276 | AS_HELP_STRING([--disable-xml-context], |
| 277 | [Do not retain context around the current parse point]), |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 278 | [enable_xml_context=${enableval}]) |
| 279 | AS_IF([test "x${enable_xml_context}" != "xno"], |
| 280 | [AS_IF([test "x${enable_xml_context}" = "xyes" \ |
| 281 | -o "x${enable_xml_context}" = "x"], |
| 282 | [AS_VAR_SET(enable_xml_context,1024)]) |
| 283 | AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], |
| 284 | [Define to specify how much context to retain around the current parse point.])]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 285 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 286 | AC_ARG_WITH([docbook], |
| 287 | [AS_HELP_STRING([--with-docbook], |
| 288 | [enforce XML to man page compilation @<:@default=check@:>@]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 289 | AS_HELP_STRING([--without-docbook], |
Haibo Huang | 40a7191 | 2019-10-11 11:13:39 -0700 | [diff] [blame] | 290 | [skip XML to man page compilation @<:@default=check@:>@])], |
| 291 | [], |
| 292 | [with_docbook=check]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 293 | |
| 294 | AC_ARG_VAR([DOCBOOK_TO_MAN], [docbook2x-man command]) |
| 295 | AS_IF([test "x$with_docbook" != xno], |
Elliott Hughes | aaec48e | 2018-08-16 16:29:01 -0700 | [diff] [blame] | 296 | [AC_CHECK_PROGS([DOCBOOK_TO_MAN], [docbook2x-man db2x_docbook2man docbook2man docbook-to-man])]) |
| 297 | AS_IF([test "x${DOCBOOK_TO_MAN}" = x -a "x$with_docbook" = xyes], |
| 298 | [AC_MSG_ERROR([Required program 'docbook2x-man' not found.])]) |
| 299 | AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno], |
| 300 | [AS_IF([${DOCBOOK_TO_MAN} --help | grep -i -q -F sgmlbase], |
| 301 | [AC_MSG_ERROR([Your local ${DOCBOOK_TO_MAN} was found to work with SGML rather |
| 302 | than XML. Please install docbook2X and use variable DOCBOOK_TO_MAN to point |
| 303 | configure to command docbook2x-man of docbook2X. |
| 304 | Or use DOCBOOK_TO_MAN="xmlto man --skip-validation" if you have xmlto around. |
| 305 | You can also configure using --without-docbook if you can do without a man |
| 306 | page for xmlwf.])])]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 307 | |
Elliott Hughes | aaec48e | 2018-08-16 16:29:01 -0700 | [diff] [blame] | 308 | AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 309 | |
Haibo Huang | fd5e81a | 2019-06-20 12:09:36 -0700 | [diff] [blame] | 310 | AC_CONFIG_FILES([Makefile] |
| 311 | [expat.pc] |
| 312 | [doc/Makefile] |
| 313 | [examples/Makefile] |
| 314 | [lib/Makefile] |
| 315 | [tests/Makefile] |
| 316 | [tests/benchmark/Makefile] |
| 317 | [xmlwf/Makefile]) |
Elliott Hughes | 7247294 | 2018-01-10 08:36:10 -0800 | [diff] [blame] | 318 | AC_CONFIG_FILES([run.sh], [chmod +x run.sh]) |
| 319 | AC_OUTPUT |