2017-08-11 13:14:18 -04:00
|
|
|
#
|
|
|
|
# __ __ _
|
|
|
|
# ___\ \/ /_ __ __ _| |_
|
|
|
|
# / _ \\ /| '_ \ / _` | __|
|
|
|
|
# | __// \| |_) | (_| | |_
|
|
|
|
# \___/_/\_\ .__/ \__,_|\__|
|
|
|
|
# |_| XML parser
|
|
|
|
#
|
2021-05-01 19:49:02 -04:00
|
|
|
# Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
|
|
|
|
# Copyright (c) 2018 KangLin <kl222@126.com>
|
2022-03-04 13:07:57 -05:00
|
|
|
# Copyright (c) 2022 Johnny Jazeix <jazeix@gmail.com>
|
2017-08-11 13:14:18 -04:00
|
|
|
# Licensed under the MIT license:
|
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
# a copy of this software and associated documentation files (the
|
|
|
|
# "Software"), to deal in the Software without restriction, including
|
|
|
|
# without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
# distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
|
|
# persons to whom the Software is furnished to do so, subject to the
|
|
|
|
# following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be included
|
|
|
|
# in all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
|
|
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
|
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
|
|
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
|
|
# USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
AUTOMAKE_OPTIONS = \
|
|
|
|
dist-bzip2 \
|
2019-05-12 13:17:11 -04:00
|
|
|
dist-lzip \
|
|
|
|
dist-xz \
|
2017-08-11 13:14:18 -04:00
|
|
|
foreign \
|
|
|
|
subdir-objects
|
|
|
|
|
|
|
|
ACLOCAL_AMFLAGS = -I m4
|
|
|
|
LIBTOOLFLAGS = --verbose
|
|
|
|
|
2018-10-15 21:53:52 -04:00
|
|
|
SUBDIRS = lib # lib goes first to build first
|
|
|
|
if WITH_EXAMPLES
|
|
|
|
SUBDIRS += examples
|
|
|
|
endif
|
|
|
|
if WITH_TESTS
|
|
|
|
SUBDIRS += tests
|
|
|
|
endif
|
2017-08-11 13:14:18 -04:00
|
|
|
if WITH_XMLWF
|
|
|
|
SUBDIRS += xmlwf doc
|
|
|
|
endif
|
|
|
|
|
|
|
|
pkgconfig_DATA = expat.pc
|
|
|
|
pkgconfigdir = $(libdir)/pkgconfig
|
|
|
|
|
|
|
|
|
2021-03-22 11:20:26 -04:00
|
|
|
dist_cmake_DATA = \
|
|
|
|
cmake/autotools/expat.cmake
|
|
|
|
|
|
|
|
nodist_cmake_DATA = \
|
|
|
|
cmake/autotools/expat-config-version.cmake \
|
|
|
|
cmake/autotools/expat-noconfig.cmake \
|
|
|
|
cmake/expat-config.cmake
|
|
|
|
|
|
|
|
cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@
|
|
|
|
|
|
|
|
|
2017-08-12 13:16:14 -04:00
|
|
|
_EXTRA_DIST_CMAKE = \
|
2021-05-20 10:07:03 -04:00
|
|
|
cmake/autotools/expat-noconfig__linux.cmake.in \
|
|
|
|
cmake/autotools/expat-noconfig__macos.cmake.in \
|
|
|
|
cmake/autotools/expat-noconfig__windows.cmake.in \
|
2021-03-22 11:20:26 -04:00
|
|
|
cmake/autotools/expat-package-init.cmake \
|
2019-09-01 16:49:54 -04:00
|
|
|
cmake/mingw-toolchain.cmake \
|
2019-08-29 17:47:01 -04:00
|
|
|
\
|
2017-08-12 13:16:14 -04:00
|
|
|
CMakeLists.txt \
|
|
|
|
CMake.README \
|
|
|
|
ConfigureChecks.cmake \
|
2021-06-23 13:56:29 -04:00
|
|
|
expat.pc.cmake \
|
2017-08-12 13:16:14 -04:00
|
|
|
expat_config.h.cmake
|
|
|
|
|
|
|
|
_EXTRA_DIST_WINDOWS = \
|
2019-08-14 18:18:31 -04:00
|
|
|
win32/build_expat_iss.bat \
|
2017-08-12 13:16:14 -04:00
|
|
|
win32/expat.iss \
|
|
|
|
win32/MANIFEST.txt \
|
2022-02-23 16:17:35 -05:00
|
|
|
win32/README.txt \
|
|
|
|
win32/version.rc
|
2017-08-12 13:16:14 -04:00
|
|
|
|
2017-08-11 13:14:18 -04:00
|
|
|
EXTRA_DIST = \
|
2017-08-12 13:16:14 -04:00
|
|
|
$(_EXTRA_DIST_CMAKE) \
|
|
|
|
$(_EXTRA_DIST_WINDOWS) \
|
|
|
|
\
|
2017-08-11 13:14:18 -04:00
|
|
|
conftools/expat.m4 \
|
|
|
|
conftools/get-version.sh \
|
|
|
|
\
|
2021-06-05 15:17:25 -04:00
|
|
|
fuzz/xml_parsebuffer_fuzzer.c \
|
|
|
|
fuzz/xml_parse_fuzzer.c \
|
|
|
|
\
|
2019-09-04 17:23:29 -04:00
|
|
|
xmlwf/xmlwf_helpgen.py \
|
|
|
|
xmlwf/xmlwf_helpgen.sh \
|
|
|
|
\
|
2021-06-05 15:17:25 -04:00
|
|
|
buildconf.sh \
|
2017-08-11 13:14:18 -04:00
|
|
|
Changes \
|
|
|
|
README.md \
|
2019-07-29 18:43:44 -04:00
|
|
|
\
|
|
|
|
fix-xmltest-log.sh \
|
2017-08-11 13:14:18 -04:00
|
|
|
test-driver-wrapper.sh
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: buildlib
|
|
|
|
buildlib:
|
|
|
|
@echo 'ERROR: Running "make buildlib LIBRARY=libexpatw.la"' >&2
|
|
|
|
@echo 'ERROR: is no longer supported. INSTEAD please:' >&2
|
|
|
|
@echo 'ERROR:' >&2
|
|
|
|
@echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2
|
|
|
|
@echo 'ERROR: # find -name Makefile.am -exec sed \' >&2
|
2017-08-20 14:21:44 -04:00
|
|
|
@echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2
|
2017-08-11 13:14:18 -04:00
|
|
|
@echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2
|
|
|
|
@echo 'ERROR: -i {} +' >&2
|
|
|
|
@echo 'ERROR:' >&2
|
|
|
|
@echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2
|
|
|
|
@echo 'ERROR:' >&2
|
|
|
|
@echo 'ERROR: * Use "./configure --without-xmlwf" and/or' >&2
|
|
|
|
@echo 'ERROR: "make -C lib all install" to bypass compilation' >&2
|
|
|
|
@echo 'ERROR: of xmlwf (e.g. with -DXML_UNICODE)' >&2
|
|
|
|
@echo 'ERROR:' >&2
|
|
|
|
@false
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: run-benchmark
|
|
|
|
run-benchmark:
|
|
|
|
$(MAKE) -C tests/benchmark
|
2017-09-01 14:32:44 -04:00
|
|
|
./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
|
2017-08-11 13:14:18 -04:00
|
|
|
|
2019-08-11 12:08:44 -04:00
|
|
|
.PHONY: download-xmlts-zip
|
|
|
|
download-xmlts-zip:
|
2017-08-11 13:14:18 -04:00
|
|
|
if test "$(XMLTS_ZIP)" = ""; then \
|
|
|
|
wget --output-document=tests/xmlts.zip \
|
|
|
|
https://www.w3.org/XML/Test/xmlts20080827.zip; \
|
|
|
|
else \
|
|
|
|
cp $(XMLTS_ZIP) tests/xmlts.zip; \
|
|
|
|
fi
|
|
|
|
|
2019-08-11 12:08:44 -04:00
|
|
|
tests/xmlts.zip:
|
|
|
|
$(MAKE) download-xmlts-zip
|
|
|
|
|
|
|
|
.PHONY: extract-xmlts-zip
|
|
|
|
extract-xmlts-zip: tests/xmlts.zip
|
|
|
|
[ -f $(builddir)/tests/xmlts.zip ] || $(MAKE) download-xmlts-zip # vpath workaround
|
2017-08-11 13:14:18 -04:00
|
|
|
cd tests && unzip -q xmlts.zip
|
|
|
|
|
2019-08-11 12:08:44 -04:00
|
|
|
tests/xmlconf: tests/xmlts.zip
|
|
|
|
$(MAKE) extract-xmlts-zip
|
|
|
|
|
2017-08-11 13:14:18 -04:00
|
|
|
.PHONY: run-xmltest
|
|
|
|
run-xmltest: tests/xmlconf
|
|
|
|
if WITH_XMLWF
|
2019-08-11 12:08:44 -04:00
|
|
|
[ -d $(builddir)/tests/xmlconf ] || $(MAKE) extract-xmlts-zip # vpath workaround
|
2019-08-10 18:48:55 -04:00
|
|
|
$(MAKE) -C lib
|
2017-08-11 13:14:18 -04:00
|
|
|
$(MAKE) -C xmlwf
|
2019-08-10 18:39:40 -04:00
|
|
|
$(srcdir)/tests/xmltest.sh "$(abs_builddir)/run.sh $(abs_builddir)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee $(builddir)/tests/xmltest.log
|
|
|
|
$(srcdir)/fix-xmltest-log.sh $(builddir)/tests/xmltest.log
|
|
|
|
diff -u $(srcdir)/tests/xmltest.log.expected $(builddir)/tests/xmltest.log
|
2017-08-11 13:14:18 -04:00
|
|
|
else
|
|
|
|
@echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2
|
|
|
|
@echo 'ERROR: Please re-configure without --without-xmlwf.' >&2
|
|
|
|
@false
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: qa
|
|
|
|
qa:
|
2019-07-08 18:03:45 -04:00
|
|
|
QA_COMPILER=clang QA_SANITIZER=address ./qa.sh
|
|
|
|
QA_COMPILER=clang QA_SANITIZER=memory ./qa.sh
|
|
|
|
QA_COMPILER=clang QA_SANITIZER=undefined ./qa.sh
|
|
|
|
QA_COMPILER=gcc QA_PROCESSOR=gcov ./qa.sh
|