1*7c568831SAndroid Build Coastguard Workerdnl Process this file with autoconf to produce a configure script. 2*7c568831SAndroid Build Coastguard WorkerAC_PREREQ([2.63]) 3*7c568831SAndroid Build Coastguard Worker 4*7c568831SAndroid Build Coastguard Workerm4_define([version_macro], m4_normalize(m4_include([VERSION]))) 5*7c568831SAndroid Build Coastguard Worker 6*7c568831SAndroid Build Coastguard WorkerAC_INIT([libxml2],[version_macro]) 7*7c568831SAndroid Build Coastguard WorkerAC_CONFIG_SRCDIR([entities.c]) 8*7c568831SAndroid Build Coastguard WorkerAC_CONFIG_HEADERS([config.h]) 9*7c568831SAndroid Build Coastguard WorkerAC_CONFIG_MACRO_DIR([m4]) 10*7c568831SAndroid Build Coastguard WorkerAC_CANONICAL_HOST 11*7c568831SAndroid Build Coastguard Worker 12*7c568831SAndroid Build Coastguard WorkerLIBXML_VERSION=version_macro 13*7c568831SAndroid Build Coastguard WorkerLIBXML_MAJOR_VERSION=`echo $LIBXML_VERSION | cut -d . -f 1` 14*7c568831SAndroid Build Coastguard WorkerLIBXML_MINOR_VERSION=`echo $LIBXML_VERSION | cut -d . -f 2` 15*7c568831SAndroid Build Coastguard WorkerLIBXML_MICRO_VERSION=`echo $LIBXML_VERSION | cut -d . -f 3` 16*7c568831SAndroid Build Coastguard WorkerLIBXML_MICRO_VERSION_SUFFIX= 17*7c568831SAndroid Build Coastguard Worker 18*7c568831SAndroid Build Coastguard Worker# The oldest minor version we are compatible with. 19*7c568831SAndroid Build Coastguard WorkerLIBXML_MINOR_COMPAT=0 20*7c568831SAndroid Build Coastguard WorkerLIBXML_CURRENT=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION` 21*7c568831SAndroid Build Coastguard WorkerLIBXML_AGE=`expr $LIBXML_MINOR_VERSION - $LIBXML_MINOR_COMPAT` 22*7c568831SAndroid Build Coastguard WorkerLIBXML_VERSION_INFO=$LIBXML_CURRENT:$LIBXML_MICRO_VERSION:$LIBXML_AGE 23*7c568831SAndroid Build Coastguard Worker 24*7c568831SAndroid Build Coastguard WorkerLIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION` 25*7c568831SAndroid Build Coastguard Worker 26*7c568831SAndroid Build Coastguard Workerif test -d .git ; then 27*7c568831SAndroid Build Coastguard Worker extra=`git describe 2>/dev/null` 28*7c568831SAndroid Build Coastguard Worker echo extra=$extra 29*7c568831SAndroid Build Coastguard Worker if test "$extra" != "" 30*7c568831SAndroid Build Coastguard Worker then 31*7c568831SAndroid Build Coastguard Worker LIBXML_VERSION_EXTRA="-GIT$extra" 32*7c568831SAndroid Build Coastguard Worker fi 33*7c568831SAndroid Build Coastguard Workerfi 34*7c568831SAndroid Build Coastguard Worker 35*7c568831SAndroid Build Coastguard WorkerAC_SUBST(LIBXML_MAJOR_VERSION) 36*7c568831SAndroid Build Coastguard WorkerAC_SUBST(LIBXML_MINOR_VERSION) 37*7c568831SAndroid Build Coastguard WorkerAC_SUBST(LIBXML_MICRO_VERSION) 38*7c568831SAndroid Build Coastguard WorkerAC_SUBST(LIBXML_VERSION) 39*7c568831SAndroid Build Coastguard WorkerAC_SUBST(LIBXML_VERSION_INFO) 40*7c568831SAndroid Build Coastguard WorkerAC_SUBST(LIBXML_VERSION_NUMBER) 41*7c568831SAndroid Build Coastguard WorkerAC_SUBST(LIBXML_VERSION_EXTRA) 42*7c568831SAndroid Build Coastguard Worker 43*7c568831SAndroid Build Coastguard WorkerVERSION=${LIBXML_VERSION} 44*7c568831SAndroid Build Coastguard Worker 45*7c568831SAndroid Build Coastguard WorkerAM_INIT_AUTOMAKE([1.16.3 foreign no-dist-gzip dist-xz]) 46*7c568831SAndroid Build Coastguard WorkerAM_MAINTAINER_MODE([enable]) 47*7c568831SAndroid Build Coastguard WorkerAM_SILENT_RULES([yes]) 48*7c568831SAndroid Build Coastguard Worker 49*7c568831SAndroid Build Coastguard Workerdnl Checks for programs. 50*7c568831SAndroid Build Coastguard WorkerAC_PROG_CC 51*7c568831SAndroid Build Coastguard WorkerAC_PROG_INSTALL 52*7c568831SAndroid Build Coastguard WorkerAC_PROG_LN_S 53*7c568831SAndroid Build Coastguard WorkerAC_PROG_MKDIR_P 54*7c568831SAndroid Build Coastguard WorkerAC_PATH_PROG(TAR, tar, /bin/tar) 55*7c568831SAndroid Build Coastguard WorkerAC_PATH_PROG(WGET, wget, /usr/bin/wget) 56*7c568831SAndroid Build Coastguard WorkerAC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc) 57*7c568831SAndroid Build Coastguard WorkerPKG_PROG_PKG_CONFIG 58*7c568831SAndroid Build Coastguard Worker 59*7c568831SAndroid Build Coastguard WorkerLT_INIT([disable-static]) 60*7c568831SAndroid Build Coastguard WorkerLT_LIB_M 61*7c568831SAndroid Build Coastguard Worker 62*7c568831SAndroid Build Coastguard Workerdnl 63*7c568831SAndroid Build Coastguard Workerdnl We process the AC_ARG_WITH first so that later we can modify 64*7c568831SAndroid Build Coastguard Workerdnl some of them to try to prevent impossible combinations. This 65*7c568831SAndroid Build Coastguard Workerdnl also allows up so alphabetize the choices 66*7c568831SAndroid Build Coastguard Workerdnl 67*7c568831SAndroid Build Coastguard Worker 68*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(c14n, 69*7c568831SAndroid Build Coastguard Worker[ --with-c14n Canonical XML 1.0 support (on)]) 70*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(catalog, 71*7c568831SAndroid Build Coastguard Worker[ --with-catalog XML Catalogs support (on)]) 72*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(debug, 73*7c568831SAndroid Build Coastguard Worker[ --with-debug debugging module (on)]) 74*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(history, 75*7c568831SAndroid Build Coastguard Worker[ --with-history history support for xmllint shell (off)]) 76*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(readline, 77*7c568831SAndroid Build Coastguard Worker[ --with-readline[[=DIR]] use readline in DIR for shell (off)]) 78*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(html, 79*7c568831SAndroid Build Coastguard Worker[ --with-html HTML parser (on)]) 80*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(http, 81*7c568831SAndroid Build Coastguard Worker[ --with-http HTTP support (off)]) 82*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(iconv, 83*7c568831SAndroid Build Coastguard Worker[ --with-iconv[[=DIR]] iconv support (on)]) 84*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(icu, 85*7c568831SAndroid Build Coastguard Worker[ --with-icu ICU support (off)]) 86*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(iso8859x, 87*7c568831SAndroid Build Coastguard Worker[ --with-iso8859x ISO-8859-X support if no iconv (on)]) 88*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(lzma, 89*7c568831SAndroid Build Coastguard Worker[ --with-lzma[[=DIR]] use liblzma in DIR (off)]) 90*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(modules, 91*7c568831SAndroid Build Coastguard Worker[ --with-modules dynamic modules support (on)]) 92*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(output, 93*7c568831SAndroid Build Coastguard Worker[ --with-output serialization support (on)]) 94*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(pattern, 95*7c568831SAndroid Build Coastguard Worker[ --with-pattern xmlPattern selection interface (on)]) 96*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(push, 97*7c568831SAndroid Build Coastguard Worker[ --with-push push parser interfaces (on)]) 98*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(python, 99*7c568831SAndroid Build Coastguard Worker[ --with-python Python bindings (on)]) 100*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(reader, 101*7c568831SAndroid Build Coastguard Worker[ --with-reader xmlReader parsing interface (on)]) 102*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(regexps, 103*7c568831SAndroid Build Coastguard Worker[ --with-regexps regular expressions support (on)]) 104*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(sax1, 105*7c568831SAndroid Build Coastguard Worker[ --with-sax1 older SAX1 interface (on)]) 106*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(schemas, 107*7c568831SAndroid Build Coastguard Worker[ --with-schemas XML Schemas 1.0 and RELAX NG support (on)]) 108*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(schematron, 109*7c568831SAndroid Build Coastguard Worker[ --with-schematron Schematron support (on)]) 110*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(threads, 111*7c568831SAndroid Build Coastguard Worker[ --with-threads multithreading support (on)]) 112*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(thread-alloc, 113*7c568831SAndroid Build Coastguard Worker[ --with-thread-alloc per-thread malloc hooks (off)]) 114*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(valid, 115*7c568831SAndroid Build Coastguard Worker[ --with-valid DTD validation support (on)]) 116*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(writer, 117*7c568831SAndroid Build Coastguard Worker[ --with-writer xmlWriter serialization interface (on)]) 118*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(xinclude, 119*7c568831SAndroid Build Coastguard Worker[ --with-xinclude XInclude 1.0 support (on)]) 120*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(xpath, 121*7c568831SAndroid Build Coastguard Worker[ --with-xpath XPath 1.0 support (on)]) 122*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(xptr, 123*7c568831SAndroid Build Coastguard Worker[ --with-xptr XPointer support (on)]) 124*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(zlib, 125*7c568831SAndroid Build Coastguard Worker[ --with-zlib[[=DIR]] use libz in DIR (off)]) 126*7c568831SAndroid Build Coastguard Worker 127*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(minimum, 128*7c568831SAndroid Build Coastguard Worker[ --with-minimum build a minimally sized library (off)]) 129*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(legacy, 130*7c568831SAndroid Build Coastguard Worker[ --with-legacy maximum ABI compatibility (off)]) 131*7c568831SAndroid Build Coastguard Worker 132*7c568831SAndroid Build Coastguard WorkerAC_ARG_WITH(tls, 133*7c568831SAndroid Build Coastguard Worker[ --with-tls thread-local storage (off)]) 134*7c568831SAndroid Build Coastguard Worker 135*7c568831SAndroid Build Coastguard Workerdnl 136*7c568831SAndroid Build Coastguard Workerdnl Legacy defaults 137*7c568831SAndroid Build Coastguard Workerdnl 138*7c568831SAndroid Build Coastguard Workerif test "$with_legacy" = "yes"; then 139*7c568831SAndroid Build Coastguard Worker if test "$with_http" = ""; then 140*7c568831SAndroid Build Coastguard Worker with_http=yes 141*7c568831SAndroid Build Coastguard Worker fi 142*7c568831SAndroid Build Coastguard Worker if test "$with_lzma" = ""; then 143*7c568831SAndroid Build Coastguard Worker with_lzma=yes 144*7c568831SAndroid Build Coastguard Worker fi 145*7c568831SAndroid Build Coastguard Worker if test "$with_zlib" = ""; then 146*7c568831SAndroid Build Coastguard Worker with_zlib=yes 147*7c568831SAndroid Build Coastguard Worker fi 148*7c568831SAndroid Build Coastguard Workerfi 149*7c568831SAndroid Build Coastguard Worker 150*7c568831SAndroid Build Coastguard Workerdnl 151*7c568831SAndroid Build Coastguard Workerdnl hard dependencies on options 152*7c568831SAndroid Build Coastguard Workerdnl 153*7c568831SAndroid Build Coastguard Workerif test "$with_c14n" = "yes"; then 154*7c568831SAndroid Build Coastguard Worker if test "$with_output" = "no"; then 155*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-c14n overrides --without-output 156*7c568831SAndroid Build Coastguard Worker fi 157*7c568831SAndroid Build Coastguard Worker with_output=yes 158*7c568831SAndroid Build Coastguard Worker if test "$with_xpath" = "no"; then 159*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-c14n overrides --without-xpath 160*7c568831SAndroid Build Coastguard Worker fi 161*7c568831SAndroid Build Coastguard Worker with_xpath=yes 162*7c568831SAndroid Build Coastguard Workerfi 163*7c568831SAndroid Build Coastguard Workerif test "$with_schemas" = "yes"; then 164*7c568831SAndroid Build Coastguard Worker if test "$with_pattern" = "no"; then 165*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-schemas overrides --without-pattern 166*7c568831SAndroid Build Coastguard Worker fi 167*7c568831SAndroid Build Coastguard Worker with_pattern=yes 168*7c568831SAndroid Build Coastguard Worker if test "$with_regexps" = "no"; then 169*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-schemas overrides --without-regexps 170*7c568831SAndroid Build Coastguard Worker fi 171*7c568831SAndroid Build Coastguard Worker with_regexps=yes 172*7c568831SAndroid Build Coastguard Workerfi 173*7c568831SAndroid Build Coastguard Workerif test "$with_schematron" = "yes"; then 174*7c568831SAndroid Build Coastguard Worker if test "$with_pattern" = "no"; then 175*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-schematron overrides --without-pattern 176*7c568831SAndroid Build Coastguard Worker fi 177*7c568831SAndroid Build Coastguard Worker with_pattern=yes 178*7c568831SAndroid Build Coastguard Worker if test "$with_xpath" = "no"; then 179*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-schematron overrides --without-xpath 180*7c568831SAndroid Build Coastguard Worker fi 181*7c568831SAndroid Build Coastguard Worker with_xpath=yes 182*7c568831SAndroid Build Coastguard Workerfi 183*7c568831SAndroid Build Coastguard Workerif test "$with_reader" = "yes"; then 184*7c568831SAndroid Build Coastguard Worker if test "$with_push" = "no"; then 185*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-reader overrides --without-push 186*7c568831SAndroid Build Coastguard Worker fi 187*7c568831SAndroid Build Coastguard Worker with_push=yes 188*7c568831SAndroid Build Coastguard Workerfi 189*7c568831SAndroid Build Coastguard Workerif test "$with_writer" = "yes"; then 190*7c568831SAndroid Build Coastguard Worker if test "$with_output" = "no"; then 191*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-writer overrides --without-output 192*7c568831SAndroid Build Coastguard Worker fi 193*7c568831SAndroid Build Coastguard Worker with_output=yes 194*7c568831SAndroid Build Coastguard Worker if test "$with_push" = "no"; then 195*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-writer overrides --without-push 196*7c568831SAndroid Build Coastguard Worker fi 197*7c568831SAndroid Build Coastguard Worker with_push=yes 198*7c568831SAndroid Build Coastguard Workerfi 199*7c568831SAndroid Build Coastguard Workerif test "$with_xinclude" = "yes"; then 200*7c568831SAndroid Build Coastguard Worker if test "$with_xpath" = "no"; then 201*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-xinclude overrides --without-xpath 202*7c568831SAndroid Build Coastguard Worker fi 203*7c568831SAndroid Build Coastguard Worker with_xpath=yes 204*7c568831SAndroid Build Coastguard Workerfi 205*7c568831SAndroid Build Coastguard Workerif test "$with_xptr" = "yes"; then 206*7c568831SAndroid Build Coastguard Worker if test "$with_xpath" = "no"; then 207*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-xptr overrides --without-xpath 208*7c568831SAndroid Build Coastguard Worker fi 209*7c568831SAndroid Build Coastguard Worker with_xpath=yes 210*7c568831SAndroid Build Coastguard Workerfi 211*7c568831SAndroid Build Coastguard Workerif test "$with_history" = "yes"; then 212*7c568831SAndroid Build Coastguard Worker if test "$with_readline" = "no"; then 213*7c568831SAndroid Build Coastguard Worker echo WARNING: --with-history overrides --without-readline 214*7c568831SAndroid Build Coastguard Worker with_readline=yes 215*7c568831SAndroid Build Coastguard Worker fi 216*7c568831SAndroid Build Coastguard Worker if test "$with_readline" = ""; then 217*7c568831SAndroid Build Coastguard Worker with_readline=yes 218*7c568831SAndroid Build Coastguard Worker fi 219*7c568831SAndroid Build Coastguard Workerfi 220*7c568831SAndroid Build Coastguard Worker 221*7c568831SAndroid Build Coastguard Workerif test "$with_minimum" = "yes"; then 222*7c568831SAndroid Build Coastguard Worker dnl 223*7c568831SAndroid Build Coastguard Worker dnl option to build a minimal libxml2 library 224*7c568831SAndroid Build Coastguard Worker dnl 225*7c568831SAndroid Build Coastguard Worker echo "Configuring for a minimal library" 226*7c568831SAndroid Build Coastguard Worker test "$with_c14n" = "" && with_c14n=no 227*7c568831SAndroid Build Coastguard Worker test "$with_catalog" = "" && with_catalog=no 228*7c568831SAndroid Build Coastguard Worker test "$with_debug" = "" && with_debug=no 229*7c568831SAndroid Build Coastguard Worker test "$with_history" = "" && with_history=no 230*7c568831SAndroid Build Coastguard Worker test "$with_html" = "" && with_html=no 231*7c568831SAndroid Build Coastguard Worker test "$with_http" = "" && with_http=no 232*7c568831SAndroid Build Coastguard Worker test "$with_iconv" = "" && with_iconv=no 233*7c568831SAndroid Build Coastguard Worker test "$with_iso8859x" = "" && with_iso8859x=no 234*7c568831SAndroid Build Coastguard Worker test "$with_lzma" = "" && with_lzma=no 235*7c568831SAndroid Build Coastguard Worker test "$with_output" = "" && with_output=no 236*7c568831SAndroid Build Coastguard Worker test "$with_pattern" = "" && with_pattern=no 237*7c568831SAndroid Build Coastguard Worker test "$with_push" = "" && with_push=no 238*7c568831SAndroid Build Coastguard Worker test "$with_python" = "" && with_python=no 239*7c568831SAndroid Build Coastguard Worker test "$with_reader" = "" && with_reader=no 240*7c568831SAndroid Build Coastguard Worker test "$with_readline" = "" && with_readline=no 241*7c568831SAndroid Build Coastguard Worker test "$with_regexps" = "" && with_regexps=no 242*7c568831SAndroid Build Coastguard Worker test "$with_sax1" = "" && with_sax1=no 243*7c568831SAndroid Build Coastguard Worker test "$with_schemas" = "" && with_schemas=no 244*7c568831SAndroid Build Coastguard Worker test "$with_schematron" = "" && with_schematron=no 245*7c568831SAndroid Build Coastguard Worker test "$with_threads" = "" && with_threads=no 246*7c568831SAndroid Build Coastguard Worker test "$with_thread_alloc" = "" && with_thread_alloc=no 247*7c568831SAndroid Build Coastguard Worker test "$with_valid" = "" && with_valid=no 248*7c568831SAndroid Build Coastguard Worker test "$with_writer" = "" && with_writer=no 249*7c568831SAndroid Build Coastguard Worker test "$with_xinclude" = "" && with_xinclude=no 250*7c568831SAndroid Build Coastguard Worker test "$with_xpath" = "" && with_xpath=no 251*7c568831SAndroid Build Coastguard Worker test "$with_xptr" = "" && with_xptr=no 252*7c568831SAndroid Build Coastguard Worker test "$with_zlib" = "" && with_zlib=no 253*7c568831SAndroid Build Coastguard Worker test "$with_modules" = "" && with_modules=no 254*7c568831SAndroid Build Coastguard Workerelse 255*7c568831SAndroid Build Coastguard Worker dnl 256*7c568831SAndroid Build Coastguard Worker dnl Disable dependent modules 257*7c568831SAndroid Build Coastguard Worker dnl 258*7c568831SAndroid Build Coastguard Worker if test "$with_output" = "no"; then 259*7c568831SAndroid Build Coastguard Worker with_c14n=no 260*7c568831SAndroid Build Coastguard Worker with_writer=no 261*7c568831SAndroid Build Coastguard Worker fi 262*7c568831SAndroid Build Coastguard Worker if test "$with_pattern" = "no"; then 263*7c568831SAndroid Build Coastguard Worker with_schemas=no 264*7c568831SAndroid Build Coastguard Worker with_schematron=no 265*7c568831SAndroid Build Coastguard Worker fi 266*7c568831SAndroid Build Coastguard Worker if test "$with_push" = "no"; then 267*7c568831SAndroid Build Coastguard Worker with_reader=no 268*7c568831SAndroid Build Coastguard Worker with_writer=no 269*7c568831SAndroid Build Coastguard Worker fi 270*7c568831SAndroid Build Coastguard Worker if test "$with_regexps" = "no"; then 271*7c568831SAndroid Build Coastguard Worker with_schemas=no 272*7c568831SAndroid Build Coastguard Worker fi 273*7c568831SAndroid Build Coastguard Worker if test "$with_xpath" = "no"; then 274*7c568831SAndroid Build Coastguard Worker with_c14n=no 275*7c568831SAndroid Build Coastguard Worker with_schematron=no 276*7c568831SAndroid Build Coastguard Worker with_xinclude=no 277*7c568831SAndroid Build Coastguard Worker with_xptr=no 278*7c568831SAndroid Build Coastguard Worker fi 279*7c568831SAndroid Build Coastguard Workerfi 280*7c568831SAndroid Build Coastguard Worker 281*7c568831SAndroid Build Coastguard Workerdnl 282*7c568831SAndroid Build Coastguard Workerdnl Extra flags 283*7c568831SAndroid Build Coastguard Workerdnl 284*7c568831SAndroid Build Coastguard WorkerXML_LIBDIR='-L${libdir}' 285*7c568831SAndroid Build Coastguard WorkerXML_INCLUDEDIR='-I${includedir}/libxml2' 286*7c568831SAndroid Build Coastguard WorkerXML_CFLAGS="" 287*7c568831SAndroid Build Coastguard WorkerXML_STATIC_CFLAGS="" 288*7c568831SAndroid Build Coastguard WorkerXML_PC_CFLAGS_PRIVATE="" 289*7c568831SAndroid Build Coastguard Worker 290*7c568831SAndroid Build Coastguard WorkerXML_PRIVATE_LIBS= 291*7c568831SAndroid Build Coastguard WorkerXML_PRIVATE_CFLAGS= 292*7c568831SAndroid Build Coastguard WorkerXML_PC_LIBS= 293*7c568831SAndroid Build Coastguard WorkerXML_PC_REQUIRES= 294*7c568831SAndroid Build Coastguard Worker 295*7c568831SAndroid Build Coastguard WorkerAX_GCC_FUNC_ATTRIBUTE([destructor]) 296*7c568831SAndroid Build Coastguard Worker 297*7c568831SAndroid Build Coastguard Workerdnl 298*7c568831SAndroid Build Coastguard Workerdnl Checks for header files. 299*7c568831SAndroid Build Coastguard Workerdnl 300*7c568831SAndroid Build Coastguard WorkerAC_CHECK_HEADERS([stdint.h]) 301*7c568831SAndroid Build Coastguard Worker 302*7c568831SAndroid Build Coastguard Workerdnl Checks for library functions. 303*7c568831SAndroid Build Coastguard WorkerAC_CHECK_DECLS([getentropy], [], [], [#include <sys/random.h>]) 304*7c568831SAndroid Build Coastguard WorkerAC_CHECK_DECLS([glob], [], [], [#include <glob.h>]) 305*7c568831SAndroid Build Coastguard WorkerAC_CHECK_DECLS([mmap], [], [], [#include <sys/mman.h>]) 306*7c568831SAndroid Build Coastguard Worker 307*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_GLOB, test "$ac_cv_have_decl_glob" = "yes") 308*7c568831SAndroid Build Coastguard Worker 309*7c568831SAndroid Build Coastguard Workerdnl 310*7c568831SAndroid Build Coastguard Workerdnl Checks for inet libraries 311*7c568831SAndroid Build Coastguard Workerdnl 312*7c568831SAndroid Build Coastguard Workerif test "$with_http" = "yes"; then 313*7c568831SAndroid Build Coastguard Worker AC_CHECK_HEADERS([poll.h]) 314*7c568831SAndroid Build Coastguard Worker 315*7c568831SAndroid Build Coastguard Worker case "$host" in 316*7c568831SAndroid Build Coastguard Worker *-*-mingw*) 317*7c568831SAndroid Build Coastguard Worker dnl AC_SEARCH_LIBS doesn't work because of non-standard calling 318*7c568831SAndroid Build Coastguard Worker dnl conventions on 32-bit Windows. 319*7c568831SAndroid Build Coastguard Worker NET_LIBS="$NET_LIBS -lws2_32" 320*7c568831SAndroid Build Coastguard Worker ;; 321*7c568831SAndroid Build Coastguard Worker *) 322*7c568831SAndroid Build Coastguard Worker _libs=$LIBS 323*7c568831SAndroid Build Coastguard Worker AC_SEARCH_LIBS(gethostbyname, [nsl], [ 324*7c568831SAndroid Build Coastguard Worker if test "$ac_cv_search_gethostbyname" != "none required"; then 325*7c568831SAndroid Build Coastguard Worker NET_LIBS="$NET_LIBS $ac_cv_search_gethostbyname" 326*7c568831SAndroid Build Coastguard Worker fi], [:], [$NET_LIBS]) 327*7c568831SAndroid Build Coastguard Worker AC_SEARCH_LIBS(connect, [bsd socket inet], [ 328*7c568831SAndroid Build Coastguard Worker if test "$ac_cv_search_connect" != "none required"; then 329*7c568831SAndroid Build Coastguard Worker NET_LIBS="$NET_LIBS $ac_cv_search_connect" 330*7c568831SAndroid Build Coastguard Worker fi], [:], [$NET_LIBS]) 331*7c568831SAndroid Build Coastguard Worker LIBS=$_libs 332*7c568831SAndroid Build Coastguard Worker ;; 333*7c568831SAndroid Build Coastguard Worker esac 334*7c568831SAndroid Build Coastguard Worker 335*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${NET_LIBS}" 336*7c568831SAndroid Build Coastguard Worker XML_PC_LIBS="${XML_PC_LIBS} ${NET_LIBS}" 337*7c568831SAndroid Build Coastguard Workerfi 338*7c568831SAndroid Build Coastguard Worker 339*7c568831SAndroid Build Coastguard Workerdnl Thread-local storage 340*7c568831SAndroid Build Coastguard Workerif test "$with_tls" = "yes"; then 341*7c568831SAndroid Build Coastguard Worker AC_COMPILE_IFELSE([ 342*7c568831SAndroid Build Coastguard Worker AC_LANG_SOURCE([_Thread_local int v;]) ], [ 343*7c568831SAndroid Build Coastguard Worker AC_DEFINE([XML_THREAD_LOCAL], [_Thread_local], [TLS specifier]) ], [ 344*7c568831SAndroid Build Coastguard Worker AC_COMPILE_IFELSE([ 345*7c568831SAndroid Build Coastguard Worker AC_LANG_SOURCE([__thread int v;]) ], [ 346*7c568831SAndroid Build Coastguard Worker AC_DEFINE([XML_THREAD_LOCAL], [__thread], [TLS specifier]) ], [ 347*7c568831SAndroid Build Coastguard Worker AC_COMPILE_IFELSE([ 348*7c568831SAndroid Build Coastguard Worker AC_LANG_SOURCE([__declspec(thread) int v;]) ], [ 349*7c568831SAndroid Build Coastguard Worker AC_DEFINE([XML_THREAD_LOCAL], [__declspec(thread)], [TLS specifier]) ], [ 350*7c568831SAndroid Build Coastguard Worker ])])]) 351*7c568831SAndroid Build Coastguard Workerfi 352*7c568831SAndroid Build Coastguard Worker 353*7c568831SAndroid Build Coastguard Workerdnl 354*7c568831SAndroid Build Coastguard Workerdnl Linker version scripts for symbol versioning 355*7c568831SAndroid Build Coastguard Workerdnl 356*7c568831SAndroid Build Coastguard WorkerVERSION_SCRIPT_FLAGS= 357*7c568831SAndroid Build Coastguard Workerif test "$with_legacy" = "yes"; then 358*7c568831SAndroid Build Coastguard Worker # lt_cv_prog_gnu_ld is from libtool 2.+ 359*7c568831SAndroid Build Coastguard Worker if test "$lt_cv_prog_gnu_ld" = yes; then 360*7c568831SAndroid Build Coastguard Worker case $host in 361*7c568831SAndroid Build Coastguard Worker *-*-cygwin* | *-*-mingw* | *-*-msys* ) 362*7c568831SAndroid Build Coastguard Worker ;; 363*7c568831SAndroid Build Coastguard Worker *) 364*7c568831SAndroid Build Coastguard Worker dnl lld 16 defaults to --no-undefined-version but the version 365*7c568831SAndroid Build Coastguard Worker dnl script can contain symbols disabled by configuration 366*7c568831SAndroid Build Coastguard Worker dnl options. 367*7c568831SAndroid Build Coastguard Worker AX_APPEND_LINK_FLAGS([-Wl,--undefined-version], [VERSION_SCRIPT_FLAGS]) 368*7c568831SAndroid Build Coastguard Worker AX_APPEND_FLAG([-Wl,--version-script=], [VERSION_SCRIPT_FLAGS]) 369*7c568831SAndroid Build Coastguard Worker ;; 370*7c568831SAndroid Build Coastguard Worker esac 371*7c568831SAndroid Build Coastguard Worker else 372*7c568831SAndroid Build Coastguard Worker case $host in 373*7c568831SAndroid Build Coastguard Worker *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";; 374*7c568831SAndroid Build Coastguard Worker esac 375*7c568831SAndroid Build Coastguard Worker fi 376*7c568831SAndroid Build Coastguard Worker AC_SUBST(VERSION_SCRIPT_FLAGS) 377*7c568831SAndroid Build Coastguard Workerfi 378*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"]) 379*7c568831SAndroid Build Coastguard Worker 380*7c568831SAndroid Build Coastguard Workerdnl 381*7c568831SAndroid Build Coastguard Workerdnl Workaround for native compilers 382*7c568831SAndroid Build Coastguard Workerdnl HP : http://bugs.gnome.org/db/31/3163.html 383*7c568831SAndroid Build Coastguard Workerdnl DEC : Enable NaN/Inf 384*7c568831SAndroid Build Coastguard Workerdnl 385*7c568831SAndroid Build Coastguard Workerif test "${GCC}" != "yes" ; then 386*7c568831SAndroid Build Coastguard Worker case "${host}" in 387*7c568831SAndroid Build Coastguard Worker hppa*-*-hpux* ) 388*7c568831SAndroid Build Coastguard Worker AM_CFLAGS="${AM_CFLAGS} -Wp,-H30000" 389*7c568831SAndroid Build Coastguard Worker ;; 390*7c568831SAndroid Build Coastguard Worker *-dec-osf* ) 391*7c568831SAndroid Build Coastguard Worker AM_CFLAGS="${AM_CFLAGS} -ieee" 392*7c568831SAndroid Build Coastguard Worker ;; 393*7c568831SAndroid Build Coastguard Worker alpha*-*-linux* ) 394*7c568831SAndroid Build Coastguard Worker AM_CFLAGS="${AM_CFLAGS} -ieee" 395*7c568831SAndroid Build Coastguard Worker ;; 396*7c568831SAndroid Build Coastguard Worker esac 397*7c568831SAndroid Build Coastguard Workerelse 398*7c568831SAndroid Build Coastguard Worker # warnings we'd like to see 399*7c568831SAndroid Build Coastguard Worker AM_CFLAGS="${AM_CFLAGS} -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes" 400*7c568831SAndroid Build Coastguard Worker # warnings we'd like to suppress 401*7c568831SAndroid Build Coastguard Worker AM_CFLAGS="${AM_CFLAGS} -Wno-long-long -Wno-format-extra-args -Wno-array-bounds" 402*7c568831SAndroid Build Coastguard Worker case "${host}" in 403*7c568831SAndroid Build Coastguard Worker alpha*-*-linux* ) 404*7c568831SAndroid Build Coastguard Worker AM_CFLAGS="${AM_CFLAGS} -mieee" 405*7c568831SAndroid Build Coastguard Worker ;; 406*7c568831SAndroid Build Coastguard Worker alpha*-*-osf* ) 407*7c568831SAndroid Build Coastguard Worker AM_CFLAGS="${AM_CFLAGS} -mieee" 408*7c568831SAndroid Build Coastguard Worker ;; 409*7c568831SAndroid Build Coastguard Worker esac 410*7c568831SAndroid Build Coastguard Workerfi 411*7c568831SAndroid Build Coastguard Workercase ${host} in 412*7c568831SAndroid Build Coastguard Worker *-*-solaris*) 413*7c568831SAndroid Build Coastguard Worker XML_LIBDIR="${XML_LIBDIR} -R${libdir}" 414*7c568831SAndroid Build Coastguard Worker ;; 415*7c568831SAndroid Build Coastguard Worker *-*-cygwin* | *-*-mingw* | *-*-msys* ) 416*7c568831SAndroid Build Coastguard Worker # If the host is Windows, and shared libraries are disabled, we 417*7c568831SAndroid Build Coastguard Worker # need to add -DLIBXML_STATIC to AM_CFLAGS in order for linking to 418*7c568831SAndroid Build Coastguard Worker # work properly (without it, xmlexports.h would force the use of 419*7c568831SAndroid Build Coastguard Worker # DLL imports, which obviously aren't present in a static 420*7c568831SAndroid Build Coastguard Worker # library). 421*7c568831SAndroid Build Coastguard Worker XML_STATIC_CFLAGS="-DLIBXML_STATIC" 422*7c568831SAndroid Build Coastguard Worker if test "x$enable_shared" = "xyes"; then 423*7c568831SAndroid Build Coastguard Worker XML_PC_CFLAGS_PRIVATE=" 424*7c568831SAndroid Build Coastguard WorkerCflags.private:" 425*7c568831SAndroid Build Coastguard Worker else 426*7c568831SAndroid Build Coastguard Worker XML_CFLAGS="$XML_STATIC_CFLAGS" 427*7c568831SAndroid Build Coastguard Worker AM_CFLAGS="$AM_CFLAGS $XML_STATIC_CFLAGS" 428*7c568831SAndroid Build Coastguard Worker fi 429*7c568831SAndroid Build Coastguard Worker ;; 430*7c568831SAndroid Build Coastguard Workeresac 431*7c568831SAndroid Build Coastguard Worker 432*7c568831SAndroid Build Coastguard Worker 433*7c568831SAndroid Build Coastguard Workerdnl 434*7c568831SAndroid Build Coastguard Workerdnl Simple API modules 435*7c568831SAndroid Build Coastguard Workerdnl 436*7c568831SAndroid Build Coastguard Worker 437*7c568831SAndroid Build Coastguard Workerif test "$with_http" != "yes" ; then 438*7c568831SAndroid Build Coastguard Worker WITH_HTTP=0 439*7c568831SAndroid Build Coastguard Workerelse 440*7c568831SAndroid Build Coastguard Worker echo Enabling HTTP support 441*7c568831SAndroid Build Coastguard Worker WITH_HTTP=1 442*7c568831SAndroid Build Coastguard Workerfi 443*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_HTTP) 444*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_HTTP_SOURCES, test "$WITH_HTTP" = "1") 445*7c568831SAndroid Build Coastguard Worker 446*7c568831SAndroid Build Coastguard Workerif test "$with_legacy" != "yes" ; then 447*7c568831SAndroid Build Coastguard Worker WITH_LEGACY=0 448*7c568831SAndroid Build Coastguard Workerelse 449*7c568831SAndroid Build Coastguard Worker echo Enabling deprecated APIs 450*7c568831SAndroid Build Coastguard Worker WITH_LEGACY=1 451*7c568831SAndroid Build Coastguard Workerfi 452*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_LEGACY) 453*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_LEGACY_SOURCES, test "$WITH_LEGACY" = "1") 454*7c568831SAndroid Build Coastguard Worker 455*7c568831SAndroid Build Coastguard Workerif test "$with_reader" = "no" ; then 456*7c568831SAndroid Build Coastguard Worker echo Disabling the xmlReader parsing interface 457*7c568831SAndroid Build Coastguard Worker WITH_READER=0 458*7c568831SAndroid Build Coastguard Workerelse 459*7c568831SAndroid Build Coastguard Worker WITH_READER=1 460*7c568831SAndroid Build Coastguard Workerfi 461*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_READER) 462*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_READER_SOURCES, test "$WITH_READER" = "1") 463*7c568831SAndroid Build Coastguard Worker 464*7c568831SAndroid Build Coastguard Workerif test "$with_writer" = "no" ; then 465*7c568831SAndroid Build Coastguard Worker echo Disabling the xmlWriter saving interface 466*7c568831SAndroid Build Coastguard Worker WITH_WRITER=0 467*7c568831SAndroid Build Coastguard Workerelse 468*7c568831SAndroid Build Coastguard Worker WITH_WRITER=1 469*7c568831SAndroid Build Coastguard Workerfi 470*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_WRITER) 471*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_WRITER_SOURCES, test "$WITH_WRITER" = "1") 472*7c568831SAndroid Build Coastguard Worker 473*7c568831SAndroid Build Coastguard Workerif test "$with_pattern" = "no" ; then 474*7c568831SAndroid Build Coastguard Worker echo Disabling the xmlPattern parsing interface 475*7c568831SAndroid Build Coastguard Worker WITH_PATTERN=0 476*7c568831SAndroid Build Coastguard Workerelse 477*7c568831SAndroid Build Coastguard Worker WITH_PATTERN=1 478*7c568831SAndroid Build Coastguard Workerfi 479*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_PATTERN) 480*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_PATTERN_SOURCES, test "$WITH_PATTERN" = "1") 481*7c568831SAndroid Build Coastguard Worker 482*7c568831SAndroid Build Coastguard Workerif test "$with_sax1" = "no" ; then 483*7c568831SAndroid Build Coastguard Worker echo Disabling the older SAX1 interface 484*7c568831SAndroid Build Coastguard Worker WITH_SAX1=0 485*7c568831SAndroid Build Coastguard Workerelse 486*7c568831SAndroid Build Coastguard Worker WITH_SAX1=1 487*7c568831SAndroid Build Coastguard Workerfi 488*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_SAX1) 489*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_SAX1_SOURCES, test "$WITH_SAX1" = "1") 490*7c568831SAndroid Build Coastguard Worker 491*7c568831SAndroid Build Coastguard Workerif test "$with_push" = "no" ; then 492*7c568831SAndroid Build Coastguard Worker echo Disabling the PUSH parser interfaces 493*7c568831SAndroid Build Coastguard Worker WITH_PUSH=0 494*7c568831SAndroid Build Coastguard Workerelse 495*7c568831SAndroid Build Coastguard Worker WITH_PUSH=1 496*7c568831SAndroid Build Coastguard Workerfi 497*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_PUSH) 498*7c568831SAndroid Build Coastguard Worker 499*7c568831SAndroid Build Coastguard Workerif test "$with_html" = "no" ; then 500*7c568831SAndroid Build Coastguard Worker echo Disabling HTML support 501*7c568831SAndroid Build Coastguard Worker WITH_HTML=0 502*7c568831SAndroid Build Coastguard Workerelse 503*7c568831SAndroid Build Coastguard Worker WITH_HTML=1 504*7c568831SAndroid Build Coastguard Workerfi 505*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_HTML) 506*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_HTML_SOURCES, test "$WITH_HTML" = "1") 507*7c568831SAndroid Build Coastguard Worker 508*7c568831SAndroid Build Coastguard Workerif test "$with_valid" = "no" ; then 509*7c568831SAndroid Build Coastguard Worker echo Disabling DTD validation support 510*7c568831SAndroid Build Coastguard Worker WITH_VALID=0 511*7c568831SAndroid Build Coastguard Workerelse 512*7c568831SAndroid Build Coastguard Worker WITH_VALID=1 513*7c568831SAndroid Build Coastguard Workerfi 514*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_VALID) 515*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_VALID_SOURCES, test "$WITH_VALID" = "1") 516*7c568831SAndroid Build Coastguard Worker 517*7c568831SAndroid Build Coastguard Workerif test "$with_catalog" = "no" ; then 518*7c568831SAndroid Build Coastguard Worker echo Disabling Catalog support 519*7c568831SAndroid Build Coastguard Worker WITH_CATALOG=0 520*7c568831SAndroid Build Coastguard Workerelse 521*7c568831SAndroid Build Coastguard Worker WITH_CATALOG=1 522*7c568831SAndroid Build Coastguard Workerfi 523*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_CATALOG) 524*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_CATALOG_SOURCES, test "$WITH_CATALOG" = "1") 525*7c568831SAndroid Build Coastguard Worker 526*7c568831SAndroid Build Coastguard Workerif test "$with_xptr" = "no" ; then 527*7c568831SAndroid Build Coastguard Worker echo Disabling XPointer support 528*7c568831SAndroid Build Coastguard Worker WITH_XPTR=0 529*7c568831SAndroid Build Coastguard Workerelse 530*7c568831SAndroid Build Coastguard Worker WITH_XPTR=1 531*7c568831SAndroid Build Coastguard Workerfi 532*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_XPTR) 533*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_XPTR_SOURCES, test "$WITH_XPTR" = "1") 534*7c568831SAndroid Build Coastguard Worker 535*7c568831SAndroid Build Coastguard Workerif test "$with_c14n" = "no" ; then 536*7c568831SAndroid Build Coastguard Worker echo Disabling C14N support 537*7c568831SAndroid Build Coastguard Worker WITH_C14N=0 538*7c568831SAndroid Build Coastguard Workerelse 539*7c568831SAndroid Build Coastguard Worker WITH_C14N=1 540*7c568831SAndroid Build Coastguard Workerfi 541*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_C14N) 542*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_C14N_SOURCES, test "$WITH_C14N" = "1") 543*7c568831SAndroid Build Coastguard Worker 544*7c568831SAndroid Build Coastguard Workerif test "$with_xinclude" = "no" ; then 545*7c568831SAndroid Build Coastguard Worker echo Disabling XInclude support 546*7c568831SAndroid Build Coastguard Worker WITH_XINCLUDE=0 547*7c568831SAndroid Build Coastguard Workerelse 548*7c568831SAndroid Build Coastguard Worker WITH_XINCLUDE=1 549*7c568831SAndroid Build Coastguard Workerfi 550*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_XINCLUDE) 551*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_XINCLUDE_SOURCES, test "$WITH_XINCLUDE" = "1") 552*7c568831SAndroid Build Coastguard Worker 553*7c568831SAndroid Build Coastguard Workerif test "$with_schematron" = "no" ; then 554*7c568831SAndroid Build Coastguard Worker echo "Disabling Schematron support" 555*7c568831SAndroid Build Coastguard Worker WITH_SCHEMATRON=0 556*7c568831SAndroid Build Coastguard Workerelse 557*7c568831SAndroid Build Coastguard Worker WITH_SCHEMATRON=1 558*7c568831SAndroid Build Coastguard Workerfi 559*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_SCHEMATRON) 560*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_SCHEMATRON_SOURCES, test "$WITH_SCHEMATRON" = "1") 561*7c568831SAndroid Build Coastguard Worker 562*7c568831SAndroid Build Coastguard Workerif test "$with_xpath" = "no" ; then 563*7c568831SAndroid Build Coastguard Worker echo Disabling XPATH support 564*7c568831SAndroid Build Coastguard Worker WITH_XPATH=0 565*7c568831SAndroid Build Coastguard Workerelse 566*7c568831SAndroid Build Coastguard Worker WITH_XPATH=1 567*7c568831SAndroid Build Coastguard Workerfi 568*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_XPATH) 569*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_XPATH_SOURCES, test "$WITH_XPATH" = "1") 570*7c568831SAndroid Build Coastguard Worker 571*7c568831SAndroid Build Coastguard Workerif test "$with_output" = "no" ; then 572*7c568831SAndroid Build Coastguard Worker echo Disabling serialization/saving support 573*7c568831SAndroid Build Coastguard Worker WITH_OUTPUT=0 574*7c568831SAndroid Build Coastguard Workerelse 575*7c568831SAndroid Build Coastguard Worker WITH_OUTPUT=1 576*7c568831SAndroid Build Coastguard Workerfi 577*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_OUTPUT) 578*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_OUTPUT_SOURCES, test "$WITH_OUTPUT" = "1") 579*7c568831SAndroid Build Coastguard Worker 580*7c568831SAndroid Build Coastguard Workerif test "$WITH_ICONV" != "1" && test "$with_iso8859x" = "no" ; then 581*7c568831SAndroid Build Coastguard Worker echo Disabling ISO8859X support 582*7c568831SAndroid Build Coastguard Worker WITH_ISO8859X=0 583*7c568831SAndroid Build Coastguard Workerelse 584*7c568831SAndroid Build Coastguard Worker WITH_ISO8859X=1 585*7c568831SAndroid Build Coastguard Workerfi 586*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_ISO8859X) 587*7c568831SAndroid Build Coastguard Worker 588*7c568831SAndroid Build Coastguard Workerif test "$with_schemas" = "no" ; then 589*7c568831SAndroid Build Coastguard Worker echo "Disabling Schemas/Relax-NG support" 590*7c568831SAndroid Build Coastguard Worker WITH_SCHEMAS=0 591*7c568831SAndroid Build Coastguard Workerelse 592*7c568831SAndroid Build Coastguard Worker WITH_SCHEMAS=1 593*7c568831SAndroid Build Coastguard Workerfi 594*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_SCHEMAS) 595*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_SCHEMAS_SOURCES, test "$WITH_SCHEMAS" = "1") 596*7c568831SAndroid Build Coastguard Worker 597*7c568831SAndroid Build Coastguard Workerif test "$with_regexps" = "no" ; then 598*7c568831SAndroid Build Coastguard Worker echo Disabling Regexps support 599*7c568831SAndroid Build Coastguard Worker WITH_REGEXPS=0 600*7c568831SAndroid Build Coastguard Workerelse 601*7c568831SAndroid Build Coastguard Worker WITH_REGEXPS=1 602*7c568831SAndroid Build Coastguard Workerfi 603*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_REGEXPS) 604*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_REGEXPS_SOURCES, test "$WITH_REGEXPS" = "1") 605*7c568831SAndroid Build Coastguard Worker 606*7c568831SAndroid Build Coastguard Workerif test "$with_debug" = "no" ; then 607*7c568831SAndroid Build Coastguard Worker echo Disabling DEBUG support 608*7c568831SAndroid Build Coastguard Worker WITH_DEBUG=0 609*7c568831SAndroid Build Coastguard Workerelse 610*7c568831SAndroid Build Coastguard Worker WITH_DEBUG=1 611*7c568831SAndroid Build Coastguard Workerfi 612*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_DEBUG) 613*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_DEBUG_SOURCES, test "$WITH_DEBUG" = "1") 614*7c568831SAndroid Build Coastguard Worker 615*7c568831SAndroid Build Coastguard Workerdnl 616*7c568831SAndroid Build Coastguard Workerdnl Check for Python 617*7c568831SAndroid Build Coastguard Workerdnl 618*7c568831SAndroid Build Coastguard Worker 619*7c568831SAndroid Build Coastguard WorkerAS_IF([test "x$with_python" != "xno"], [ 620*7c568831SAndroid Build Coastguard Worker AM_PATH_PYTHON 621*7c568831SAndroid Build Coastguard Worker PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}]) 622*7c568831SAndroid Build Coastguard Worker]) 623*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL([WITH_PYTHON], [test "x$with_python" != "xno"]) 624*7c568831SAndroid Build Coastguard Worker 625*7c568831SAndroid Build Coastguard Workerdnl 626*7c568831SAndroid Build Coastguard Workerdnl Extra Python flags for Windows 627*7c568831SAndroid Build Coastguard Workerdnl 628*7c568831SAndroid Build Coastguard WorkerPYTHON_LDFLAGS= 629*7c568831SAndroid Build Coastguard Workerif test "${PYTHON}" != ""; then 630*7c568831SAndroid Build Coastguard Worker case "$host" in 631*7c568831SAndroid Build Coastguard Worker *-*-mingw* ) 632*7c568831SAndroid Build Coastguard Worker PYTHON_LDFLAGS="-no-undefined -shrext .pyd" 633*7c568831SAndroid Build Coastguard Worker ;; 634*7c568831SAndroid Build Coastguard Worker *-*-cygwin* |*-*-msys* ) 635*7c568831SAndroid Build Coastguard Worker PYTHON_LDFLAGS="-no-undefined" 636*7c568831SAndroid Build Coastguard Worker ;; 637*7c568831SAndroid Build Coastguard Worker esac 638*7c568831SAndroid Build Coastguard Workerfi 639*7c568831SAndroid Build Coastguard WorkerAC_SUBST(PYTHON_LDFLAGS) 640*7c568831SAndroid Build Coastguard Worker 641*7c568831SAndroid Build Coastguard Workerdnl 642*7c568831SAndroid Build Coastguard Workerdnl Check for DSO support 643*7c568831SAndroid Build Coastguard Workerdnl 644*7c568831SAndroid Build Coastguard WorkerWITH_MODULES=0 645*7c568831SAndroid Build Coastguard Worker 646*7c568831SAndroid Build Coastguard Workerif test "$with_modules" != "no" ; then 647*7c568831SAndroid Build Coastguard Worker case "$host" in 648*7c568831SAndroid Build Coastguard Worker *-*-cygwin* | *-*-msys* ) 649*7c568831SAndroid Build Coastguard Worker MODULE_EXTENSION=".dll" 650*7c568831SAndroid Build Coastguard Worker ;; 651*7c568831SAndroid Build Coastguard Worker *-*-mingw*) 652*7c568831SAndroid Build Coastguard Worker MODULE_EXTENSION=".dll" 653*7c568831SAndroid Build Coastguard Worker WITH_MODULES=1 654*7c568831SAndroid Build Coastguard Worker ;; 655*7c568831SAndroid Build Coastguard Worker *-*-hpux*) 656*7c568831SAndroid Build Coastguard Worker MODULE_EXTENSION=".sl" 657*7c568831SAndroid Build Coastguard Worker ;; 658*7c568831SAndroid Build Coastguard Worker *) 659*7c568831SAndroid Build Coastguard Worker MODULE_EXTENSION=".so" 660*7c568831SAndroid Build Coastguard Worker ;; 661*7c568831SAndroid Build Coastguard Worker esac 662*7c568831SAndroid Build Coastguard Worker 663*7c568831SAndroid Build Coastguard Worker if test "$WITH_MODULES" = "0"; then 664*7c568831SAndroid Build Coastguard Worker _libs=$LIBS 665*7c568831SAndroid Build Coastguard Worker AC_SEARCH_LIBS([dlopen], [dl], [ 666*7c568831SAndroid Build Coastguard Worker WITH_MODULES=1 667*7c568831SAndroid Build Coastguard Worker if test "$ac_cv_search_dlopen" != "none required"; then 668*7c568831SAndroid Build Coastguard Worker MODULE_LIBS=$ac_cv_search_dlopen 669*7c568831SAndroid Build Coastguard Worker fi 670*7c568831SAndroid Build Coastguard Worker AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])], [ 671*7c568831SAndroid Build Coastguard Worker AC_SEARCH_LIBS([shl_load], [dld], [ 672*7c568831SAndroid Build Coastguard Worker WITH_MODULES=1 673*7c568831SAndroid Build Coastguard Worker if test "$ac_cv_search_shl_load" != "none required"; then 674*7c568831SAndroid Build Coastguard Worker MODULE_LIBS=$ac_cv_search_shl_load 675*7c568831SAndroid Build Coastguard Worker fi 676*7c568831SAndroid Build Coastguard Worker AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])])]) 677*7c568831SAndroid Build Coastguard Worker LIBS=$_libs 678*7c568831SAndroid Build Coastguard Worker fi 679*7c568831SAndroid Build Coastguard Worker 680*7c568831SAndroid Build Coastguard Worker if test "$WITH_MODULES" = "0"; then 681*7c568831SAndroid Build Coastguard Worker AC_MSG_ERROR([dlopen or equivalent not found]) 682*7c568831SAndroid Build Coastguard Worker fi 683*7c568831SAndroid Build Coastguard Worker 684*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${MODULE_LIBS}" 685*7c568831SAndroid Build Coastguard Worker XML_PC_LIBS="${XML_PC_LIBS} ${MODULE_LIBS}" 686*7c568831SAndroid Build Coastguard Workerfi 687*7c568831SAndroid Build Coastguard Worker 688*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_MODULES) 689*7c568831SAndroid Build Coastguard WorkerAC_SUBST(MODULE_EXTENSION) 690*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_MODULES_SOURCES, test "$WITH_MODULES" = "1") 691*7c568831SAndroid Build Coastguard Worker 692*7c568831SAndroid Build Coastguard Workerdnl 693*7c568831SAndroid Build Coastguard Workerdnl Thread-related stuff 694*7c568831SAndroid Build Coastguard Workerdnl 695*7c568831SAndroid Build Coastguard WorkerTHREAD_LIBS="" 696*7c568831SAndroid Build Coastguard WorkerWITH_THREADS=0 697*7c568831SAndroid Build Coastguard WorkerWITH_THREAD_ALLOC=0 698*7c568831SAndroid Build Coastguard Worker 699*7c568831SAndroid Build Coastguard Workerif test "$with_threads" = "no" ; then 700*7c568831SAndroid Build Coastguard Worker echo Disabling multithreaded support 701*7c568831SAndroid Build Coastguard Workerelse 702*7c568831SAndroid Build Coastguard Worker case $host_os in 703*7c568831SAndroid Build Coastguard Worker *mingw*) 704*7c568831SAndroid Build Coastguard Worker dnl Default to native threads on Windows 705*7c568831SAndroid Build Coastguard Worker WITH_THREADS="1" 706*7c568831SAndroid Build Coastguard Worker ;; 707*7c568831SAndroid Build Coastguard Worker *) 708*7c568831SAndroid Build Coastguard Worker dnl Use pthread by default in other cases 709*7c568831SAndroid Build Coastguard Worker _libs=$LIBS 710*7c568831SAndroid Build Coastguard Worker AC_CHECK_HEADERS(pthread.h, 711*7c568831SAndroid Build Coastguard Worker AC_SEARCH_LIBS([pthread_create], [pthread], [ 712*7c568831SAndroid Build Coastguard Worker WITH_THREADS="1" 713*7c568831SAndroid Build Coastguard Worker if test "$ac_cv_search_pthread_create" != "none required"; then 714*7c568831SAndroid Build Coastguard Worker THREAD_LIBS=$ac_cv_search_pthread_create 715*7c568831SAndroid Build Coastguard Worker fi])) 716*7c568831SAndroid Build Coastguard Worker LIBS=$_libs 717*7c568831SAndroid Build Coastguard Worker ;; 718*7c568831SAndroid Build Coastguard Worker esac 719*7c568831SAndroid Build Coastguard Worker 720*7c568831SAndroid Build Coastguard Worker if test "$WITH_THREADS" = "0"; then 721*7c568831SAndroid Build Coastguard Worker AC_MSG_ERROR([libpthread not found]) 722*7c568831SAndroid Build Coastguard Worker fi 723*7c568831SAndroid Build Coastguard Worker 724*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${THREAD_LIBS}" 725*7c568831SAndroid Build Coastguard Worker XML_PC_LIBS="${XML_PC_LIBS} ${THREAD_LIBS}" 726*7c568831SAndroid Build Coastguard Workerfi 727*7c568831SAndroid Build Coastguard Workerif test "$with_thread_alloc" = "yes" && test "$WITH_THREADS" = "1" ; then 728*7c568831SAndroid Build Coastguard Worker WITH_THREAD_ALLOC=1 729*7c568831SAndroid Build Coastguard Workerfi 730*7c568831SAndroid Build Coastguard Worker 731*7c568831SAndroid Build Coastguard WorkerAC_SUBST(THREAD_LIBS) 732*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_THREADS) 733*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_THREAD_ALLOC) 734*7c568831SAndroid Build Coastguard Worker 735*7c568831SAndroid Build Coastguard Workerdnl 736*7c568831SAndroid Build Coastguard Workerdnl Checks for readline and history libraries. 737*7c568831SAndroid Build Coastguard Workerdnl 738*7c568831SAndroid Build Coastguard Workerif test "$with_readline" != "no" && test "$with_readline" != ""; then 739*7c568831SAndroid Build Coastguard Worker WITH_READLINE=0 740*7c568831SAndroid Build Coastguard Worker WITH_HISTORY=0 741*7c568831SAndroid Build Coastguard Worker 742*7c568831SAndroid Build Coastguard Worker if test "$with_readline" != "yes"; then 743*7c568831SAndroid Build Coastguard Worker RDL_DIR=$with_readline 744*7c568831SAndroid Build Coastguard Worker fi 745*7c568831SAndroid Build Coastguard Worker 746*7c568831SAndroid Build Coastguard Worker if test "$RDL_DIR" = ""; then 747*7c568831SAndroid Build Coastguard Worker PKG_CHECK_MODULES([RDL], [readline], [ WITH_READLINE=1 ], [:]) 748*7c568831SAndroid Build Coastguard Worker fi 749*7c568831SAndroid Build Coastguard Worker 750*7c568831SAndroid Build Coastguard Worker if test "$WITH_READLINE" = "0"; then 751*7c568831SAndroid Build Coastguard Worker _cppflags=$CPPFLAGS 752*7c568831SAndroid Build Coastguard Worker _libs=$LIBS 753*7c568831SAndroid Build Coastguard Worker 754*7c568831SAndroid Build Coastguard Worker if test "$RDL_DIR" != ""; then 755*7c568831SAndroid Build Coastguard Worker CPPFLAGS="${CPPFLAGS} -I$RDL_DIR/include" 756*7c568831SAndroid Build Coastguard Worker LIBS="${LIBS} -L$RDL_DIR/lib" 757*7c568831SAndroid Build Coastguard Worker fi 758*7c568831SAndroid Build Coastguard Worker AC_CHECK_HEADER(readline/readline.h, 759*7c568831SAndroid Build Coastguard Worker AC_CHECK_LIB(readline, readline, [ 760*7c568831SAndroid Build Coastguard Worker WITH_READLINE=1 761*7c568831SAndroid Build Coastguard Worker RDL_LIBS="-lreadline" 762*7c568831SAndroid Build Coastguard Worker ], [ 763*7c568831SAndroid Build Coastguard Worker AC_MSG_ERROR([libreadline not found]) 764*7c568831SAndroid Build Coastguard Worker ])) 765*7c568831SAndroid Build Coastguard Worker 766*7c568831SAndroid Build Coastguard Worker CPPFLAGS=$_cppflags 767*7c568831SAndroid Build Coastguard Worker LIBS=$_libs 768*7c568831SAndroid Build Coastguard Worker fi 769*7c568831SAndroid Build Coastguard Worker 770*7c568831SAndroid Build Coastguard Worker AC_DEFINE([HAVE_LIBREADLINE], [], 771*7c568831SAndroid Build Coastguard Worker [Define if readline library is available]) 772*7c568831SAndroid Build Coastguard Worker 773*7c568831SAndroid Build Coastguard Worker if test "$with_history" = "yes"; then 774*7c568831SAndroid Build Coastguard Worker if test "$RDL_DIR" = ""; then 775*7c568831SAndroid Build Coastguard Worker PKG_CHECK_MODULES([HISTORY], [history], [ 776*7c568831SAndroid Build Coastguard Worker WITH_HISTORY=1 777*7c568831SAndroid Build Coastguard Worker RDL_CFLAGS="$HISTORY_CFLAGS $RDL_CFLAGS" 778*7c568831SAndroid Build Coastguard Worker RDL_LIBS="$HISTORY_LIBS $RDL_LIBS" 779*7c568831SAndroid Build Coastguard Worker ], [:]) 780*7c568831SAndroid Build Coastguard Worker fi 781*7c568831SAndroid Build Coastguard Worker 782*7c568831SAndroid Build Coastguard Worker if test "$WITH_HISTORY" = "0"; then 783*7c568831SAndroid Build Coastguard Worker _cppflags=$CPPFLAGS 784*7c568831SAndroid Build Coastguard Worker _libs=$LIBS 785*7c568831SAndroid Build Coastguard Worker 786*7c568831SAndroid Build Coastguard Worker if test "$RDL_DIR" != ""; then 787*7c568831SAndroid Build Coastguard Worker CPPFLAGS="${CPPFLAGS} -I$RDL_DIR/include" 788*7c568831SAndroid Build Coastguard Worker LIBS="${LIBS} -L$RDL_DIR/lib" 789*7c568831SAndroid Build Coastguard Worker fi 790*7c568831SAndroid Build Coastguard Worker AC_CHECK_HEADER(readline/history.h, 791*7c568831SAndroid Build Coastguard Worker AC_CHECK_LIB(history, append_history, [ 792*7c568831SAndroid Build Coastguard Worker WITH_HISTORY=1 793*7c568831SAndroid Build Coastguard Worker RDL_LIBS="-lhistory $RDL_LIBS" 794*7c568831SAndroid Build Coastguard Worker ], [ 795*7c568831SAndroid Build Coastguard Worker AC_MSG_ERROR([libhistory not found]) 796*7c568831SAndroid Build Coastguard Worker ])) 797*7c568831SAndroid Build Coastguard Worker 798*7c568831SAndroid Build Coastguard Worker CPPFLAGS=$_cppflags 799*7c568831SAndroid Build Coastguard Worker LIBS=$_libs 800*7c568831SAndroid Build Coastguard Worker fi 801*7c568831SAndroid Build Coastguard Worker 802*7c568831SAndroid Build Coastguard Worker AC_DEFINE([HAVE_LIBHISTORY], [], 803*7c568831SAndroid Build Coastguard Worker [Define if history library is available]) 804*7c568831SAndroid Build Coastguard Worker fi 805*7c568831SAndroid Build Coastguard Worker 806*7c568831SAndroid Build Coastguard Worker if test "$RDL_DIR" != ""; then 807*7c568831SAndroid Build Coastguard Worker RDL_CFLAGS="-I$RDL_DIR/include" 808*7c568831SAndroid Build Coastguard Worker RDL_LIBS="-L$RDL_DIR/lib $RDL_LIBS" 809*7c568831SAndroid Build Coastguard Worker fi 810*7c568831SAndroid Build Coastguard Workerfi 811*7c568831SAndroid Build Coastguard WorkerAC_SUBST(RDL_CFLAGS) 812*7c568831SAndroid Build Coastguard WorkerAC_SUBST(RDL_LIBS) 813*7c568831SAndroid Build Coastguard Worker 814*7c568831SAndroid Build Coastguard Workerdnl 815*7c568831SAndroid Build Coastguard Workerdnl Checks for zlib library. 816*7c568831SAndroid Build Coastguard Workerdnl 817*7c568831SAndroid Build Coastguard WorkerWITH_ZLIB=0 818*7c568831SAndroid Build Coastguard Worker 819*7c568831SAndroid Build Coastguard Workerif test "$with_zlib" != "no" && test "$with_zlib" != ""; then 820*7c568831SAndroid Build Coastguard Worker echo "Enabling zlib compression support" 821*7c568831SAndroid Build Coastguard Worker 822*7c568831SAndroid Build Coastguard Worker if test "$with_zlib" != "yes"; then 823*7c568831SAndroid Build Coastguard Worker Z_DIR=$with_zlib 824*7c568831SAndroid Build Coastguard Worker fi 825*7c568831SAndroid Build Coastguard Worker 826*7c568831SAndroid Build Coastguard Worker # Don't run pkg-config if with_zlib contains a path. 827*7c568831SAndroid Build Coastguard Worker if test "x$Z_DIR" = "x"; then 828*7c568831SAndroid Build Coastguard Worker # Try pkg-config first so that static linking works. 829*7c568831SAndroid Build Coastguard Worker PKG_CHECK_MODULES([Z],[zlib], 830*7c568831SAndroid Build Coastguard Worker [WITH_ZLIB=1; XML_PC_REQUIRES="${XML_PC_REQUIRES} zlib"], 831*7c568831SAndroid Build Coastguard Worker [:]) 832*7c568831SAndroid Build Coastguard Worker fi 833*7c568831SAndroid Build Coastguard Worker 834*7c568831SAndroid Build Coastguard Worker if test "$WITH_ZLIB" = "0"; then 835*7c568831SAndroid Build Coastguard Worker _cppflags=$CPPFLAGS 836*7c568831SAndroid Build Coastguard Worker _libs=$LIBS 837*7c568831SAndroid Build Coastguard Worker if test "x$Z_DIR" != "x"; then 838*7c568831SAndroid Build Coastguard Worker CPPFLAGS="${CPPFLAGS} -I$Z_DIR/include" 839*7c568831SAndroid Build Coastguard Worker LIBS="${LIBS} -L$Z_DIR/lib" 840*7c568831SAndroid Build Coastguard Worker fi 841*7c568831SAndroid Build Coastguard Worker AC_CHECK_HEADERS(zlib.h, 842*7c568831SAndroid Build Coastguard Worker AC_CHECK_LIB(z, gzread,[ 843*7c568831SAndroid Build Coastguard Worker WITH_ZLIB=1 844*7c568831SAndroid Build Coastguard Worker if test "x${Z_DIR}" != "x"; then 845*7c568831SAndroid Build Coastguard Worker Z_CFLAGS="-I${Z_DIR}/include" 846*7c568831SAndroid Build Coastguard Worker Z_LIBS="-L${Z_DIR}/lib -lz" 847*7c568831SAndroid Build Coastguard Worker [case ${host} in 848*7c568831SAndroid Build Coastguard Worker *-*-solaris*) 849*7c568831SAndroid Build Coastguard Worker Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" 850*7c568831SAndroid Build Coastguard Worker ;; 851*7c568831SAndroid Build Coastguard Worker esac] 852*7c568831SAndroid Build Coastguard Worker else 853*7c568831SAndroid Build Coastguard Worker Z_LIBS="-lz" 854*7c568831SAndroid Build Coastguard Worker fi]) 855*7c568831SAndroid Build Coastguard Worker XML_PC_LIBS="${XML_PC_LIBS} ${Z_LIBS}" 856*7c568831SAndroid Build Coastguard Worker ) 857*7c568831SAndroid Build Coastguard Worker CPPFLAGS=$_cppflags 858*7c568831SAndroid Build Coastguard Worker LIBS=$_libs 859*7c568831SAndroid Build Coastguard Worker fi 860*7c568831SAndroid Build Coastguard Worker 861*7c568831SAndroid Build Coastguard Worker if test "$WITH_ZLIB" = "0"; then 862*7c568831SAndroid Build Coastguard Worker AC_MSG_ERROR([zlib not found]) 863*7c568831SAndroid Build Coastguard Worker fi 864*7c568831SAndroid Build Coastguard Worker 865*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${Z_CFLAGS}" 866*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${Z_LIBS}" 867*7c568831SAndroid Build Coastguard Workerfi 868*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_ZLIB) 869*7c568831SAndroid Build Coastguard Worker 870*7c568831SAndroid Build Coastguard Workerdnl 871*7c568831SAndroid Build Coastguard Workerdnl Checks for lzma library. 872*7c568831SAndroid Build Coastguard Workerdnl 873*7c568831SAndroid Build Coastguard WorkerWITH_LZMA=0 874*7c568831SAndroid Build Coastguard Worker 875*7c568831SAndroid Build Coastguard Workerif test "$with_lzma" != "no" && test "$with_lzma" != ""; then 876*7c568831SAndroid Build Coastguard Worker echo "Enabling lzma compression support" 877*7c568831SAndroid Build Coastguard Worker 878*7c568831SAndroid Build Coastguard Worker if test "$with_lzma" != "yes"; then 879*7c568831SAndroid Build Coastguard Worker LZMA_DIR=$with_lzma 880*7c568831SAndroid Build Coastguard Worker fi 881*7c568831SAndroid Build Coastguard Worker 882*7c568831SAndroid Build Coastguard Worker # Don't run pkg-config if with_lzma contains a path. 883*7c568831SAndroid Build Coastguard Worker if test "x$LZMA_DIR" = "x"; then 884*7c568831SAndroid Build Coastguard Worker # Try pkg-config first so that static linking works. 885*7c568831SAndroid Build Coastguard Worker PKG_CHECK_MODULES([LZMA],[liblzma], 886*7c568831SAndroid Build Coastguard Worker [WITH_LZMA=1; XML_PC_REQUIRES="${XML_PC_REQUIRES} liblzma"], 887*7c568831SAndroid Build Coastguard Worker [:]) 888*7c568831SAndroid Build Coastguard Worker fi 889*7c568831SAndroid Build Coastguard Worker 890*7c568831SAndroid Build Coastguard Worker # If pkg-config failed, fall back to AC_CHECK_LIB. This 891*7c568831SAndroid Build Coastguard Worker # will not pick up the necessary LIBS flags for liblzma's 892*7c568831SAndroid Build Coastguard Worker # private dependencies, though, so static linking may fail. 893*7c568831SAndroid Build Coastguard Worker if test "$WITH_LZMA" = "0"; then 894*7c568831SAndroid Build Coastguard Worker _cppflags=$CPPFLAGS 895*7c568831SAndroid Build Coastguard Worker _libs=$LIBS 896*7c568831SAndroid Build Coastguard Worker if test "x$LZMA_DIR" != "x"; then 897*7c568831SAndroid Build Coastguard Worker CPPFLAGS="${CPPFLAGS} -I$LZMA_DIR/include" 898*7c568831SAndroid Build Coastguard Worker LIBS="${LIBS} -L$LZMA_DIR/lib" 899*7c568831SAndroid Build Coastguard Worker fi 900*7c568831SAndroid Build Coastguard Worker AC_CHECK_HEADERS(lzma.h, 901*7c568831SAndroid Build Coastguard Worker AC_CHECK_LIB(lzma, lzma_code,[ 902*7c568831SAndroid Build Coastguard Worker WITH_LZMA=1 903*7c568831SAndroid Build Coastguard Worker if test "x${LZMA_DIR}" != "x"; then 904*7c568831SAndroid Build Coastguard Worker LZMA_CFLAGS="-I${LZMA_DIR}/include" 905*7c568831SAndroid Build Coastguard Worker LZMA_LIBS="-L${LZMA_DIR}/lib -llzma" 906*7c568831SAndroid Build Coastguard Worker else 907*7c568831SAndroid Build Coastguard Worker LZMA_LIBS="-llzma" 908*7c568831SAndroid Build Coastguard Worker fi]) 909*7c568831SAndroid Build Coastguard Worker XML_PC_LIBS="${XML_PC_LIBS} ${LZMA_LIBS}" 910*7c568831SAndroid Build Coastguard Worker ) 911*7c568831SAndroid Build Coastguard Worker CPPFLAGS=$_cppflags 912*7c568831SAndroid Build Coastguard Worker LIBS=$_libs 913*7c568831SAndroid Build Coastguard Worker fi 914*7c568831SAndroid Build Coastguard Worker 915*7c568831SAndroid Build Coastguard Worker if test "$WITH_LZMA" = "0"; then 916*7c568831SAndroid Build Coastguard Worker AC_MSG_ERROR([liblzma not found]) 917*7c568831SAndroid Build Coastguard Worker fi 918*7c568831SAndroid Build Coastguard Worker 919*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${LZMA_CFLAGS}" 920*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${LZMA_LIBS}" 921*7c568831SAndroid Build Coastguard Workerfi 922*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_LZMA) 923*7c568831SAndroid Build Coastguard WorkerAM_CONDITIONAL(WITH_LZMA_SOURCES, test "$WITH_LZMA" = "1") 924*7c568831SAndroid Build Coastguard Worker 925*7c568831SAndroid Build Coastguard Workerdnl 926*7c568831SAndroid Build Coastguard Workerdnl Checks for iconv library. 927*7c568831SAndroid Build Coastguard Workerdnl 928*7c568831SAndroid Build Coastguard WorkerWITH_ICONV=0 929*7c568831SAndroid Build Coastguard Worker 930*7c568831SAndroid Build Coastguard Workerif test "$with_iconv" = "no" ; then 931*7c568831SAndroid Build Coastguard Worker echo Disabling ICONV support 932*7c568831SAndroid Build Coastguard Workerelse 933*7c568831SAndroid Build Coastguard Worker _cppflags=$CPPFLAGS 934*7c568831SAndroid Build Coastguard Worker _libs=$LIBS 935*7c568831SAndroid Build Coastguard Worker if test "$with_iconv" != "yes" && test "$with_iconv" != "" ; then 936*7c568831SAndroid Build Coastguard Worker ICONV_DIR=$with_iconv 937*7c568831SAndroid Build Coastguard Worker CPPFLAGS="$CPPFLAGS -I$ICONV_DIR/include" 938*7c568831SAndroid Build Coastguard Worker LIBS="$LIBS -L$ICONV_DIR/lib" 939*7c568831SAndroid Build Coastguard Worker fi 940*7c568831SAndroid Build Coastguard Worker AC_MSG_CHECKING([for libiconv]) 941*7c568831SAndroid Build Coastguard Worker AC_LINK_IFELSE([ 942*7c568831SAndroid Build Coastguard Worker AC_LANG_PROGRAM([#include <iconv.h>], [iconv_open(0,0);]) 943*7c568831SAndroid Build Coastguard Worker ], [ 944*7c568831SAndroid Build Coastguard Worker WITH_ICONV=1 945*7c568831SAndroid Build Coastguard Worker AC_MSG_RESULT([none required]) 946*7c568831SAndroid Build Coastguard Worker ], [ 947*7c568831SAndroid Build Coastguard Worker LIBS="$LIBS -liconv" 948*7c568831SAndroid Build Coastguard Worker AC_LINK_IFELSE([ 949*7c568831SAndroid Build Coastguard Worker AC_LANG_PROGRAM([#include <iconv.h>], [iconv_open(0,0);]) 950*7c568831SAndroid Build Coastguard Worker ], [ 951*7c568831SAndroid Build Coastguard Worker WITH_ICONV=1 952*7c568831SAndroid Build Coastguard Worker ICONV_LIBS="-liconv" 953*7c568831SAndroid Build Coastguard Worker AC_MSG_RESULT([yes]) 954*7c568831SAndroid Build Coastguard Worker ], [ 955*7c568831SAndroid Build Coastguard Worker AC_MSG_RESULT([no]) 956*7c568831SAndroid Build Coastguard Worker ]) 957*7c568831SAndroid Build Coastguard Worker ]) 958*7c568831SAndroid Build Coastguard Worker 959*7c568831SAndroid Build Coastguard Worker if test "$WITH_ICONV" = "0"; then 960*7c568831SAndroid Build Coastguard Worker AC_MSG_ERROR([libiconv not found]) 961*7c568831SAndroid Build Coastguard Worker fi 962*7c568831SAndroid Build Coastguard Worker 963*7c568831SAndroid Build Coastguard Worker if test "$WITH_ICONV" = "1" && test "$ICONV_DIR" != ""; then 964*7c568831SAndroid Build Coastguard Worker ICONV_CFLAGS="-I$ICONV_DIR/include" 965*7c568831SAndroid Build Coastguard Worker ICONV_LIBS="-L$ICONV_DIR/lib $ICONV_LIBS" 966*7c568831SAndroid Build Coastguard Worker fi 967*7c568831SAndroid Build Coastguard Worker CPPFLAGS=$_cppflags 968*7c568831SAndroid Build Coastguard Worker LIBS=$_libs 969*7c568831SAndroid Build Coastguard Worker 970*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${ICONV_CFLAGS}" 971*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${ICONV_LIBS}" 972*7c568831SAndroid Build Coastguard Worker XML_PC_LIBS="${XML_PC_LIBS} ${ICONV_LIBS}" 973*7c568831SAndroid Build Coastguard Workerfi 974*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_ICONV) 975*7c568831SAndroid Build Coastguard WorkerAC_SUBST(ICONV_CFLAGS) 976*7c568831SAndroid Build Coastguard Worker 977*7c568831SAndroid Build Coastguard Workerdnl 978*7c568831SAndroid Build Coastguard Workerdnl Checks for ICU library. 979*7c568831SAndroid Build Coastguard Workerdnl 980*7c568831SAndroid Build Coastguard WorkerWITH_ICU=0 981*7c568831SAndroid Build Coastguard Worker 982*7c568831SAndroid Build Coastguard Workerif test "$with_icu" != "no" && test "$with_icu" != "" ; then 983*7c568831SAndroid Build Coastguard Worker echo Enabling ICU support 984*7c568831SAndroid Build Coastguard Worker 985*7c568831SAndroid Build Coastguard Worker # Try pkg-config first so that static linking works. 986*7c568831SAndroid Build Coastguard Worker # If this succeeeds, we ignore the WITH_ICU directory. 987*7c568831SAndroid Build Coastguard Worker PKG_CHECK_MODULES([ICU], [icu-i18n], [ 988*7c568831SAndroid Build Coastguard Worker WITH_ICU=1; XML_PC_REQUIRES="${XML_PC_REQUIRES} icu-i18n" 989*7c568831SAndroid Build Coastguard Worker m4_ifdef([PKG_CHECK_VAR], 990*7c568831SAndroid Build Coastguard Worker [PKG_CHECK_VAR([ICU_DEFS], [icu-i18n], [DEFS])]) 991*7c568831SAndroid Build Coastguard Worker if test "x$ICU_DEFS" != "x"; then 992*7c568831SAndroid Build Coastguard Worker ICU_CFLAGS="$ICU_CFLAGS $ICU_DEFS" 993*7c568831SAndroid Build Coastguard Worker fi],[:]) 994*7c568831SAndroid Build Coastguard Worker 995*7c568831SAndroid Build Coastguard Worker if test "$WITH_ICU" = "0"; then 996*7c568831SAndroid Build Coastguard Worker ICU_CONFIG=icu-config 997*7c568831SAndroid Build Coastguard Worker if ${ICU_CONFIG} --cflags >/dev/null 2>&1 998*7c568831SAndroid Build Coastguard Worker then 999*7c568831SAndroid Build Coastguard Worker WITH_ICU=1 1000*7c568831SAndroid Build Coastguard Worker ICU_CFLAGS=`${ICU_CONFIG} --cflags` 1001*7c568831SAndroid Build Coastguard Worker ICU_LIBS=`${ICU_CONFIG} --ldflags` 1002*7c568831SAndroid Build Coastguard Worker XML_PC_LIBS="${XML_PC_LIBS} ${ICU_LIBS}" 1003*7c568831SAndroid Build Coastguard Worker else 1004*7c568831SAndroid Build Coastguard Worker _cppflags="${CPPFLAGS}" 1005*7c568831SAndroid Build Coastguard Worker _libs="${LIBS}" 1006*7c568831SAndroid Build Coastguard Worker if test "$with_icu" != "yes" ; then 1007*7c568831SAndroid Build Coastguard Worker ICU_DIR=$with_icu 1008*7c568831SAndroid Build Coastguard Worker CPPFLAGS="${CPPFLAGS} -I$ICU_DIR/include" 1009*7c568831SAndroid Build Coastguard Worker LIBS="${LIBS} -L$ICU_DIR/lib" 1010*7c568831SAndroid Build Coastguard Worker fi 1011*7c568831SAndroid Build Coastguard Worker 1012*7c568831SAndroid Build Coastguard Worker AC_CHECK_HEADER(unicode/ucnv.h, [ 1013*7c568831SAndroid Build Coastguard Worker AC_CHECK_LIB([icucore], [ucnv_open], [ 1014*7c568831SAndroid Build Coastguard Worker WITH_ICU=1 1015*7c568831SAndroid Build Coastguard Worker ICU_LIBS=-licucore 1016*7c568831SAndroid Build Coastguard Worker if test "$ICU_DIR" != ""; then 1017*7c568831SAndroid Build Coastguard Worker ICU_CFLAGS="-I$ICU_DIR/include" 1018*7c568831SAndroid Build Coastguard Worker ICU_LIBS="-L$ICU_DIR/lib $ICU_LIBS" 1019*7c568831SAndroid Build Coastguard Worker fi])]) 1020*7c568831SAndroid Build Coastguard Worker XML_PC_LIBS="${XML_PC_LIBS} ${ICU_LIBS}" 1021*7c568831SAndroid Build Coastguard Worker CPPFLAGS=$_cppflags 1022*7c568831SAndroid Build Coastguard Worker LIBS=$_libs 1023*7c568831SAndroid Build Coastguard Worker fi 1024*7c568831SAndroid Build Coastguard Worker fi 1025*7c568831SAndroid Build Coastguard Worker 1026*7c568831SAndroid Build Coastguard Worker if test "$WITH_ICU" = "0"; then 1027*7c568831SAndroid Build Coastguard Worker AC_MSG_ERROR([ICU not found]) 1028*7c568831SAndroid Build Coastguard Worker fi 1029*7c568831SAndroid Build Coastguard Worker 1030*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${ICU_CFLAGS}" 1031*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${ICU_LIBS}" 1032*7c568831SAndroid Build Coastguard Workerfi 1033*7c568831SAndroid Build Coastguard WorkerAC_SUBST(WITH_ICU) 1034*7c568831SAndroid Build Coastguard Worker 1035*7c568831SAndroid Build Coastguard Workerdnl 1036*7c568831SAndroid Build Coastguard Workerdnl Crypto libraries 1037*7c568831SAndroid Build Coastguard Workerdnl 1038*7c568831SAndroid Build Coastguard Workercase "$host" in 1039*7c568831SAndroid Build Coastguard Worker *-*-mingw*) 1040*7c568831SAndroid Build Coastguard Worker CRYPTO_LIBS="-lbcrypt" 1041*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${CRYPTO_LIBS}" 1042*7c568831SAndroid Build Coastguard Worker XML_PC_LIBS="${XML_PC_LIBS} ${CRYPTO_LIBS}" 1043*7c568831SAndroid Build Coastguard Worker ;; 1044*7c568831SAndroid Build Coastguard Workeresac 1045*7c568831SAndroid Build Coastguard Worker 1046*7c568831SAndroid Build Coastguard WorkerXML_LIBS="-lxml2" 1047*7c568831SAndroid Build Coastguard WorkerXML_PC_LIBS="${XML_PC_LIBS} ${LIBM}" 1048*7c568831SAndroid Build Coastguard WorkerXML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${LIBM}" 1049*7c568831SAndroid Build Coastguard Worker 1050*7c568831SAndroid Build Coastguard Workerdnl When static-only: 1051*7c568831SAndroid Build Coastguard Workerdnl * Duplicate xml-config static --libs into --dynamic. 1052*7c568831SAndroid Build Coastguard Workerdnl * Fold pkg-config private fields into main fields. 1053*7c568831SAndroid Build Coastguard Workerif test "x$enable_shared" = "xno"; then 1054*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_LIBS_NO_SHARED="${XML_PRIVATE_LIBS}" 1055*7c568831SAndroid Build Coastguard Worker XML_PC_PRIVATE= 1056*7c568831SAndroid Build Coastguard Worker XML_PC_LIBS_PRIVATE= 1057*7c568831SAndroid Build Coastguard Workerelse 1058*7c568831SAndroid Build Coastguard Worker XML_PRIVATE_LIBS_NO_SHARED= 1059*7c568831SAndroid Build Coastguard Worker XML_PC_PRIVATE=".private" 1060*7c568831SAndroid Build Coastguard Worker XML_PC_LIBS_PRIVATE=" 1061*7c568831SAndroid Build Coastguard WorkerLibs.private:" 1062*7c568831SAndroid Build Coastguard Workerfi 1063*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_PRIVATE_LIBS_NO_SHARED) 1064*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_PC_PRIVATE) 1065*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_PC_LIBS_PRIVATE) 1066*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_PC_CFLAGS_PRIVATE) 1067*7c568831SAndroid Build Coastguard WorkerAM_SUBST_NOTMAKE(XML_PRIVATE_LIBS_NO_SHARED) 1068*7c568831SAndroid Build Coastguard WorkerAM_SUBST_NOTMAKE(XML_PC_PRIVATE) 1069*7c568831SAndroid Build Coastguard WorkerAM_SUBST_NOTMAKE(XML_PC_LIBS_PRIVATE) 1070*7c568831SAndroid Build Coastguard WorkerAM_SUBST_NOTMAKE(XML_PC_CFLAGS_PRIVATE) 1071*7c568831SAndroid Build Coastguard Worker 1072*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_PC_LIBS) 1073*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_PC_REQUIRES) 1074*7c568831SAndroid Build Coastguard WorkerAM_SUBST_NOTMAKE(XML_PC_LIBS) 1075*7c568831SAndroid Build Coastguard WorkerAM_SUBST_NOTMAKE(XML_PC_REQUIRES) 1076*7c568831SAndroid Build Coastguard Worker 1077*7c568831SAndroid Build Coastguard WorkerAC_SUBST(AM_CFLAGS) 1078*7c568831SAndroid Build Coastguard WorkerAC_SUBST(AM_LDFLAGS) 1079*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_CFLAGS) 1080*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_STATIC_CFLAGS) 1081*7c568831SAndroid Build Coastguard Worker 1082*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_LIBDIR) 1083*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_LIBS) 1084*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_PRIVATE_LIBS) 1085*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_PRIVATE_CFLAGS) 1086*7c568831SAndroid Build Coastguard WorkerAC_SUBST(XML_INCLUDEDIR) 1087*7c568831SAndroid Build Coastguard Worker 1088*7c568831SAndroid Build Coastguard Worker# keep on one line for cygwin c.f. #130896 1089*7c568831SAndroid Build Coastguard WorkerAC_CONFIG_FILES([Makefile include/Makefile include/libxml/Makefile include/private/Makefile doc/Makefile doc/devhelp/Makefile example/Makefile fuzz/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml2-config.cmake]) 1090*7c568831SAndroid Build Coastguard WorkerAC_CONFIG_FILES([python/setup.py], [chmod +x python/setup.py]) 1091*7c568831SAndroid Build Coastguard WorkerAC_CONFIG_FILES([xml2-config], [chmod +x xml2-config]) 1092*7c568831SAndroid Build Coastguard WorkerAC_OUTPUT 1093