From d4390f34f3890e969137605adcbac4ed571e00e4 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Fri, 11 Aug 2017 19:14:18 +0200 Subject: [PATCH] Replace handwritten Makefile with GNU Automake --- expat/.gitignore | 1 + expat/CMakeLists.txt | 2 +- expat/Changes | 1 + expat/MANIFEST | 90 ----------- expat/Makefile.am | 121 +++++++++++++++ expat/Makefile.in | 239 ------------------------------ expat/README.md | 18 ++- expat/buildconf.sh | 30 +--- expat/configure.ac | 18 ++- expat/conftools/.gitignore | 4 + expat/doc/Makefile.am | 50 +++++++ expat/doc/{Makefile => doc.mk} | 7 +- expat/examples/Makefile.am | 39 +++++ expat/lib/Makefile.am | 67 +++++++++ expat/make-release.sh | 75 ---------- expat/test-driver-wrapper.sh | 43 ++++++ expat/tests/Makefile.am | 62 ++++++++ expat/tests/benchmark/Makefile.am | 40 +++++ expat/xmlwf/Makefile.am | 54 +++++++ 19 files changed, 510 insertions(+), 451 deletions(-) delete mode 100644 expat/MANIFEST create mode 100644 expat/Makefile.am delete mode 100644 expat/Makefile.in create mode 100644 expat/doc/Makefile.am rename expat/doc/{Makefile => doc.mk} (73%) create mode 100644 expat/examples/Makefile.am create mode 100644 expat/lib/Makefile.am delete mode 100755 expat/make-release.sh create mode 100755 expat/test-driver-wrapper.sh create mode 100644 expat/tests/Makefile.am create mode 100644 expat/tests/benchmark/Makefile.am create mode 100644 expat/xmlwf/Makefile.am diff --git a/expat/.gitignore b/expat/.gitignore index ac3c47c1..3b7ad3eb 100755 --- a/expat/.gitignore +++ b/expat/.gitignore @@ -9,6 +9,7 @@ CTestTestfile.cmake install_manifest.txt Makefile .deps +Makefile.in .libs *.la configure diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index 08bb8463..e74e1916 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -161,7 +161,7 @@ if(BUILD_tools) set(make_command "make") endif() - add_custom_command(TARGET expat PRE_BUILD COMMAND "${make_command}" -C "${PROJECT_SOURCE_DIR}/doc" xmlwf.1 "DOCBOOK_TO_MAN=${DOCBOOK_TO_MAN}") + add_custom_command(TARGET expat PRE_BUILD COMMAND "${make_command}" -f "${PROJECT_SOURCE_DIR}/doc/doc.mk" -C "${PROJECT_SOURCE_DIR}/doc" xmlwf.1 "DOCBOOK_TO_MAN=${DOCBOOK_TO_MAN}") expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" DESTINATION share/man/man1) endif() endif() diff --git a/expat/Changes b/expat/Changes index a3a6f626..8b9ab3fe 100644 --- a/expat/Changes +++ b/expat/Changes @@ -11,6 +11,7 @@ Release 2.?.? ????????????????? to unsigned type char (-128..127 rather than 0..255) #109 coverage.sh: Cover -funsigned-char Autotools: Introduce --without-xmlwf argument + #65 Autotools: Replace handwritten Makefile with GNU Automake #43 CMake: Auto-detect high quality entropy extractors, add new option USE_libbsd=ON to use arc4random_buf of libbsd #74 CMake: Add -fno-strict-aliasing only where supported diff --git a/expat/MANIFEST b/expat/MANIFEST deleted file mode 100644 index f602b4b2..00000000 --- a/expat/MANIFEST +++ /dev/null @@ -1,90 +0,0 @@ -AUTHORS -doc/expat.png -doc/reference.html -doc/style.css -doc/valid-xhtml10.png -doc/xmlwf.1 -doc/xmlwf.xml -CMakeLists.txt -CMake.README -COPYING -Changes -ConfigureChecks.cmake -MANIFEST -Makefile.in -README.md -configure -configure.ac -expat_config.h.in -expat_config.h.cmake -expat.pc.in -aclocal.m4 -run.sh.in -conftools/PrintPath -conftools/ac_c_bigendian_cross.m4 -conftools/expat.m4 -conftools/get-version.sh -conftools/mkinstalldirs -conftools/config.guess -conftools/config.sub -conftools/install-sh -conftools/ltmain.sh -m4/libtool.m4 -m4/ltversion.m4 -m4/ltoptions.m4 -m4/ltsugar.m4 -m4/lt~obsolete.m4 -examples/elements.c -examples/outline.c -lib/ascii.h -lib/asciitab.h -lib/expat.h -lib/expat_external.h -lib/iasciitab.h -lib/internal.h -lib/latin1tab.h -lib/libexpat.def -lib/libexpatw.def -lib/loadlibrary.c -lib/nametab.h -lib/siphash.h -lib/utf8tab.h -lib/winconfig.h -lib/xmlparse.c -lib/xmlrole.c -lib/xmlrole.h -lib/xmltok.c -lib/xmltok.h -lib/xmltok_impl.c -lib/xmltok_impl.h -lib/xmltok_ns.c -tests/benchmark/README.txt -tests/benchmark/benchmark.c -tests/README.txt -tests/chardata.c -tests/chardata.h -tests/memcheck.c -tests/memcheck.h -tests/minicheck.c -tests/minicheck.h -tests/runtests.c -tests/runtestspp.cpp -tests/xmltest.sh -win32/MANIFEST.txt -win32/README.txt -win32/expat.iss -xmlwf/codepage.c -xmlwf/codepage.h -xmlwf/ct.c -xmlwf/filemap.h -xmlwf/readfilemap.c -xmlwf/unixfilemap.c -xmlwf/win32filemap.c -xmlwf/xmlfile.c -xmlwf/xmlfile.h -xmlwf/xmlmime.c -xmlwf/xmlmime.h -xmlwf/xmltchar.h -xmlwf/xmlurl.h -xmlwf/xmlwf.c -xmlwf/xmlwin32url.cxx diff --git a/expat/Makefile.am b/expat/Makefile.am new file mode 100644 index 00000000..5e34156c --- /dev/null +++ b/expat/Makefile.am @@ -0,0 +1,121 @@ +# +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017 Expat development team +# 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 \ + foreign \ + no-dist-gzip \ + subdir-objects + +ACLOCAL_AMFLAGS = -I m4 +LIBTOOLFLAGS = --verbose + +SUBDIRS = lib examples tests # lib goes first to build first +if WITH_XMLWF +SUBDIRS += xmlwf doc +endif + +pkgconfig_DATA = expat.pc +pkgconfigdir = $(libdir)/pkgconfig + + +EXTRA_DIST = \ + conftools/expat.m4 \ + conftools/get-version.sh \ + conftools/PrintPath \ + \ + win32/expat.iss \ + win32/MANIFEST.txt \ + win32/README.txt \ + \ + Changes \ + CMakeLists.txt \ + CMake.README \ + ConfigureChecks.cmake \ + expat_config.h.cmake \ + README.md \ + 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 + @echo 'ERROR: -e "s,libexpat\.la,libexpatw\.la," \' >&2 + @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 + tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + +tests/xmlts.zip: + 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 + +tests/xmlconf: tests/xmlts.zip + cd tests && unzip -q xmlts.zip + +.PHONY: run-xmltest +run-xmltest: tests/xmlconf +if WITH_XMLWF + $(MAKE) -C xmlwf + tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log + dos2unix tests/xmltest.log + diff -u tests/xmltest.log.expected tests/xmltest.log +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: + ./qa.sh address + ./qa.sh memory + ./qa.sh undefined + ./qa.sh coverage diff --git a/expat/Makefile.in b/expat/Makefile.in deleted file mode 100644 index f0acfe72..00000000 --- a/expat/Makefile.in +++ /dev/null @@ -1,239 +0,0 @@ -################################################################ -# Process this file with top-level configure script to produce Makefile -# -# Copyright 2000 Clark Cooper -# -# This file is part of EXPAT. -# -# EXPAT is free software; you can redistribute it and/or modify it -# under the terms of the License (based on the MIT/X license) contained -# in the file COPYING that comes with this distribution. -# -# EXPAT 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 EXPAT. -# - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -libdir = @libdir@ -includedir = @includedir@ -man1dir = @mandir@/man1 -pkgconfigdir = $(libdir)/pkgconfig - -top_builddir = . - - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs - -MANFILE = $(srcdir)/doc/xmlwf.1 -APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h expat_config.h -LIBRARY = libexpat.la - -DESTDIR = $(INSTALL_ROOT) - -XMLWF_ENABLED = test @with_xmlwf@ = yes - - -default: buildlib - if $(XMLWF_ENABLED) ; then $(MAKE) xmlwf/xmlwf@EXEEXT@ ; fi - -buildlib: $(LIBRARY) expat.pc - -all: $(LIBRARY) expat.pc examples/elements examples/outline $(MANFILE) - if $(XMLWF_ENABLED) ; then $(MAKE) xmlwf/xmlwf@EXEEXT@ ; fi - -clean: - cd lib && rm -f $(LIBRARY) *.@OBJEXT@ *.lo && rm -rf .libs _libs - cd xmlwf && rm -f xmlwf *.@OBJEXT@ *.lo && rm -rf .libs _libs - cd examples && rm -f elements outline *.@OBJEXT@ *.lo && rm -rf .libs _libs - cd tests && rm -rf .libs runtests@EXEEXT@ runtests.@OBJEXT@ runtestspp@EXEEXT@ runtestspp.@OBJEXT@ - cd tests && rm -f chardata.@OBJEXT@ memcheck.@OBJEXT@ minicheck.@OBJEXT@ - rm -rf .libs libexpat.la - rm -f examples/core tests/core xmlwf/core - -clobber: clean - -distclean: clean - rm -f expat_config.h config.status config.log config.cache libtool - rm -f Makefile expat.pc - -extraclean: distclean - rm -f expat_config.h.in configure - rm -f aclocal.m4 m4/* - rm -f conftools/ltmain.sh conftools/install-sh conftools/config.guess conftools/config.sub - -check: tests/runtests@EXEEXT@ tests/runtestspp@EXEEXT@ - ./run.sh tests/runtests@EXEEXT@ - ./run.sh tests/runtestspp@EXEEXT@ - -$(MANFILE): - $(MAKE) -C doc xmlwf.1 - -install: installlib - if $(XMLWF_ENABLED) ; then $(MAKE) installman installxmlwf ; fi - -.PHONY: installman -installman: $(MANFILE) - $(mkinstalldirs) $(DESTDIR)$(man1dir) - $(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir) - -.PHONY: installxmlwf -installxmlwf: xmlwf/xmlwf@EXEEXT@ installlib - $(mkinstalldirs) $(DESTDIR)$(bindir) - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf@EXEEXT@ $(DESTDIR)$(bindir)/xmlwf - -installlib: $(LIBRARY) $(APIHEADER) expat.pc - $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(pkgconfigdir) - $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY) - for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(DESTDIR)$(includedir) ; done - $(INSTALL_DATA) expat.pc $(DESTDIR)$(pkgconfigdir)/expat.pc - -uninstall: uninstalllib uninstallman uninstallxmlwf - -uninstalllib: - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY) - rm -f $(DESTDIR)$(includedir)/expat.h - rm -f $(DESTDIR)$(includedir)/expat_external.h - rm -f $(DESTDIR)$(pkgconfigdir)/expat.pc - -.PHONY: uninstallman -uninstallman: - rm -f $(DESTDIR)$(man1dir)/xmlwf.1 - -.PHONY: uninstallxmlwf -uninstallxmlwf: - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf@EXEEXT@ - -# for VPATH builds (invoked by configure) -mkdir-init: - @for d in lib xmlwf examples tests ; do \ - (mkdir $$d 2> /dev/null || test 1) ; \ - done - -CC = @CC@ -CXX = @CXX@ -LIBTOOL = @LIBTOOL@ - -INCLUDES = -I$(srcdir)/lib -I. -LDFLAGS = @LDFLAGS@ -CPPFLAGS = @CPPFLAGS@ -DHAVE_EXPAT_CONFIG_H -CFLAGS = @CFLAGS@ -CXXFLAGS = @CXXFLAGS@ -VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ - -### autoconf this? -LTFLAGS = --verbose - -COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(DEFS) $(CPPFLAGS) -CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) $(DEFS) $(CPPFLAGS) -LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) @LIBS@ -o $@ -LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@ -LINK_CXX_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CXXCOMPILE) $(LDFLAGS) -o $@ - -LIB_OBJS = lib/loadlibrary.lo lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo -$(LIBRARY): $(LIB_OBJS) - $(LINK_LIB) $(LIB_OBJS) - -expat.pc: $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $@ - -lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/siphash.h lib/xmlrole.h lib/xmltok.h \ - $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h - -lib/loadlibrary.lo: lib/loadlibrary.c - -lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \ - $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h - -lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \ - lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \ - lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \ - $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h - - -XMLWF_OBJS = xmlwf/xmlwf.@OBJEXT@ xmlwf/xmlfile.@OBJEXT@ xmlwf/codepage.@OBJEXT@ xmlwf/@FILEMAP@.@OBJEXT@ -xmlwf/xmlwf.@OBJEXT@: xmlwf/xmlwf.c -xmlwf/xmlfile.@OBJEXT@: xmlwf/xmlfile.c -xmlwf/codepage.@OBJEXT@: xmlwf/codepage.c -xmlwf/@FILEMAP@.@OBJEXT@: xmlwf/@FILEMAP@.c xmlwf/filemap.h -xmlwf/xmlwf@EXEEXT@: $(XMLWF_OBJS) $(LIBRARY) - $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY) - -examples/elements.@OBJEXT@: examples/elements.c -examples/elements: examples/elements.@OBJEXT@ $(LIBRARY) - $(LINK_EXE) examples/elements.@OBJEXT@ $(LIBRARY) - -examples/outline.@OBJEXT@: examples/outline.c -examples/outline: examples/outline.@OBJEXT@ $(LIBRARY) - $(LINK_EXE) examples/outline.@OBJEXT@ $(LIBRARY) - -tests/chardata.@OBJEXT@: tests/chardata.c tests/chardata.h -tests/minicheck.@OBJEXT@: tests/minicheck.c tests/minicheck.h -tests/memcheck.@OBJEXT@: tests/memcheck.c tests/memcheck.h -tests/runtests.@OBJEXT@: tests/runtests.c tests/chardata.h tests/memcheck.h lib/siphash.h -tests/runtests@EXEEXT@: tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ tests/memcheck.@OBJEXT@ $(LIBRARY) - $(LINK_EXE) tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ tests/memcheck.@OBJEXT@ $(LIBRARY) -tests/runtestspp.@OBJEXT@: tests/runtestspp.cpp tests/runtests.c tests/chardata.h tests/memcheck.h -tests/runtestspp@EXEEXT@: tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ tests/memcheck.@OBJEXT@ $(LIBRARY) - $(LINK_CXX_EXE) tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ tests/memcheck.@OBJEXT@ $(LIBRARY) - -tests/benchmark/benchmark.@OBJEXT@: tests/benchmark/benchmark.c -tests/benchmark/benchmark: tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) - $(LINK_EXE) tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) - -run-benchmark: tests/benchmark/benchmark - tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 - -tests/xmlts.zip: - 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 - -tests/xmlconf: tests/xmlts.zip - cd tests && unzip -q xmlts.zip - -run-xmltest: xmlwf/xmlwf@EXEEXT@ tests/xmlconf - tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log - dos2unix tests/xmltest.log - diff -u tests/xmltest.log.expected tests/xmltest.log - -.PHONY: qa -qa: - ./qa.sh address - ./qa.sh memory - ./qa.sh undefined - ./qa.sh coverage - -.SUFFIXES: .c .cpp .lo .@OBJEXT@ - -.cpp.@OBJEXT@: - $(CXXCOMPILE) -o $@ -c $< -.c.@OBJEXT@: - $(COMPILE) -o $@ -c $< -.c.lo: - $(LTCOMPILE) -o $@ -c $< - -.PHONY: buildlib all \ - clean distclean extraclean maintainer-clean \ - dist distdir \ - install uninstall diff --git a/expat/README.md b/expat/README.md index 61677e28..4fc3079c 100644 --- a/expat/README.md +++ b/expat/README.md @@ -76,6 +76,16 @@ these instructions (after having run `make distclean`). Please note that we configure with `--without-xmlwf` as xmlwf does not support this mode of compilation (yet): +1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name: +
+ `find -name Makefile.am -exec sed + -e 's,libexpat\.la,libexpatw\.la,' + -e 's,libexpat_la,libexpatw_la,' + -i {} +` + +1. Run `automake` to re-write `Makefile.in` files:
+ `automake` + 1. For UTF-16 output as unsigned short (and version/error strings as char), run:
`./configure CPPFLAGS=-DXML_UNICODE --without-xmlwf`
@@ -84,17 +94,9 @@ support this mode of compilation (yet): --without-xmlwf`
Note: The latter requires libc compiled with `-fshort-wchar`, as well. -1. Edit `Makefile`, changing:
- `LIBRARY = libexpat.la`
- to:
- `LIBRARY = libexpatw.la`
- (Note the additional "w" in the library name.) - 1. Run `make` (which excludes xmlwf). - Or, to save step 2, run `make LIBRARY=libexpatw.la`. 1. Run `make install` (again, excludes xmlwf). - Or, if step 2 was omitted, run `make install LIBRARY=libexpatw.la`. Using `DESTDIR` or `INSTALL_ROOT` is enabled, with `INSTALL_ROOT` being the default value for `DESTDIR`, and the rest of the make file using only diff --git a/expat/buildconf.sh b/expat/buildconf.sh index 8eb0a76d..907ce101 100755 --- a/expat/buildconf.sh +++ b/expat/buildconf.sh @@ -1,30 +1,2 @@ #! /bin/sh - -#-------------------------------------------------------------------------- -# autoconf 2.58 or newer -# -ac_version="`${AUTOCONF:-autoconf} --version 2> /dev/null | head -1 | sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`" -if test -z "$ac_version"; then - echo "ERROR: autoconf not found." - echo " You need autoconf version 2.58 or newer installed." - exit 1 -fi -IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "58" || test "$1" -lt "2"; then - echo "ERROR: autoconf version $ac_version found." - echo " You need autoconf version 2.58 or newer installed." - exit 1 -fi - -echo "Creating configure ..." -${AUTORECONF:-autoreconf} -fvi - -echo "Creating conftools/install-sh ..." -# .. for configure, despite not using automake -automake --add-missing 2>/dev/null || true - -# toss this; it gets created by autoconf on some systems -rm -rf autom4te*.cache - -# exit with the right value, so any calling script can continue -exit 0 +exec autoreconf -i diff --git a/expat/configure.ac b/expat/configure.ac index b9a00004..34ab87a7 100644 --- a/expat/configure.ac +++ b/expat/configure.ac @@ -31,6 +31,7 @@ undefine([expat_version]) AC_CONFIG_SRCDIR(Makefile.in) AC_CONFIG_AUX_DIR(conftools) +AM_INIT_AUTOMAKE AC_CONFIG_MACRO_DIR([m4]) @@ -49,6 +50,7 @@ LIBCURRENT=7 # sync LIBREVISION=5 # with LIBAGE=6 # CMakeLists.txt! +CPPFLAGS="${CPPFLAGS} -DHAVE_EXPAT_CONFIG_H" AC_CONFIG_HEADER(expat_config.h) sinclude(conftools/ac_c_bigendian_cross.m4) @@ -102,7 +104,7 @@ AC_CHECK_FUNCS(memmove bcopy) AC_ARG_WITH([xmlwf], [ AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], [], [with_xmlwf=yes]) -AC_SUBST(with_xmlwf) +AM_CONDITIONAL([WITH_XMLWF], [test x${with_xmlwf} = xyes]) AC_ARG_WITH([libbsd], [ @@ -224,11 +226,13 @@ AS_IF([test "x${enable_xml_context}" != "xno"], [ ]) AC_CONFIG_FILES([Makefile expat.pc]) +AC_CONFIG_FILES([ + doc/Makefile + examples/Makefile + lib/Makefile + tests/Makefile + tests/benchmark/Makefile + xmlwf/Makefile +]) AC_CONFIG_FILES([run.sh], [chmod +x run.sh]) AC_OUTPUT - -abs_srcdir="`cd $srcdir && pwd`" -abs_builddir="`pwd`" -if test "$abs_srcdir" != "$abs_builddir"; then - make mkdir-init -fi diff --git a/expat/conftools/.gitignore b/expat/conftools/.gitignore index 43c4c8e1..ff15588f 100644 --- a/expat/conftools/.gitignore +++ b/expat/conftools/.gitignore @@ -1,6 +1,10 @@ +compile config.guess config.sub +depcomp install-sh libtool.m4 ltconfig ltmain.sh +missing +test-driver diff --git a/expat/doc/Makefile.am b/expat/doc/Makefile.am new file mode 100644 index 00000000..8bb74e3c --- /dev/null +++ b/expat/doc/Makefile.am @@ -0,0 +1,50 @@ +# +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017 Expat development team +# 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. + +dist_man_MANS = xmlwf.1 + +xmlwf.1: doc.mk xmlwf.xml + $(MAKE) -f $(srcdir)/doc.mk xmlwf.1 srcdir=$(srcdir) + +# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned +.PHONY: clean-local +clean-local: clean-local-check + +.PHONY: clean-local-check +clean-local-check: + $(MAKE) -f $(srcdir)/doc.mk clean + +EXTRA_DIST = \ + doc.mk \ + expat.png \ + reference.html \ + style.css \ + valid-xhtml10.png \ + xmlwf.xml diff --git a/expat/doc/Makefile b/expat/doc/doc.mk similarity index 73% rename from expat/doc/Makefile rename to expat/doc/doc.mk index 01e5c239..828bc7f4 100644 --- a/expat/doc/Makefile +++ b/expat/doc/doc.mk @@ -3,14 +3,17 @@ DOCBOOK_TO_MAN = docbook2x-man +srcdir = . + + .PHONY: all all: xmlwf.1 xmlwf.1: XMLWF.1 cp $< $@ -XMLWF.1: xmlwf.xml - $(DOCBOOK_TO_MAN) xmlwf.xml +XMLWF.1: $(srcdir)/xmlwf.xml + $(DOCBOOK_TO_MAN) $(srcdir)/xmlwf.xml .PHONY: clean clean: diff --git a/expat/examples/Makefile.am b/expat/examples/Makefile.am new file mode 100644 index 00000000..99edf212 --- /dev/null +++ b/expat/examples/Makefile.am @@ -0,0 +1,39 @@ +# +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017 Expat development team +# 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. + +AM_CPPFLAGS = -I$(srcdir)/../lib + +noinst_PROGRAMS = elements outline + +elements_SOURCES = elements.c +elements_LDADD = ../lib/libexpat.la + +outline_SOURCES = outline.c +outline_LDADD = ../lib/libexpat.la diff --git a/expat/lib/Makefile.am b/expat/lib/Makefile.am new file mode 100644 index 00000000..05cfa3c4 --- /dev/null +++ b/expat/lib/Makefile.am @@ -0,0 +1,67 @@ +# +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017 Expat development team +# 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. + +include_HEADERS = \ + ../expat_config.h \ + expat.h \ + expat_external.h + +lib_LTLIBRARIES = libexpat.la + +libexpat_la_LDFLAGS = \ + -no-undefined \ + -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ \ + -rpath $(libdir) + +libexpat_la_SOURCES = \ + loadlibrary.c \ + xmlparse.c \ + xmltok.c \ + xmlrole.c + +EXTRA_DIST = \ + ascii.h \ + asciitab.h \ + expat_external.h \ + expat.h \ + iasciitab.h \ + internal.h \ + latin1tab.h \ + libexpat.def \ + libexpatw.def \ + nametab.h \ + siphash.h \ + utf8tab.h \ + winconfig.h \ + xmlrole.h \ + xmltok.h \ + xmltok_impl.c \ + xmltok_impl.h \ + xmltok_ns.c diff --git a/expat/make-release.sh b/expat/make-release.sh deleted file mode 100755 index dc507311..00000000 --- a/expat/make-release.sh +++ /dev/null @@ -1,75 +0,0 @@ -#! /bin/bash -# -# make-release.sh: make an Expat release -# -# USAGE: make-release.sh tagname -# -# Note: tagname may be HEAD to just grab the head revision (e.g. for testing) -# - -if test $# != 1; then - echo "USAGE: $0 tagname" - exit 1 -fi - -tmpdir=expat-release.$$ -if test -e $tmpdir; then - echo "ERROR: oops. chose the $tmpdir subdir, but it exists." - exit 1 -fi - -echo "Checking out into temporary area: $tmpdir" -mkdir -p "${tmpdir}" || exit 1 -git archive --format=tar -o /dev/stdout "$1" | ( cd $tmpdir && tar xf -) || exit 1 - -echo "" -echo "----------------------------------------------------------------------" -echo "Preparing $tmpdir for release" -(cd $tmpdir && ./buildconf.sh) || exit 1 -(make -C $tmpdir/doc xmlwf.1) || exit 1 - -# figure out the release version -vsn="`$tmpdir/conftools/get-version.sh $tmpdir/lib/expat.h`" - -echo "" -echo "Release version: $vsn" - -if test "$1" = HEAD ; then - distdir=expat-`date '+%Y-%m-%d'` -else - distdir=expat-$vsn -fi -if test -e $distdir; then - echo "ERROR: for safety, you must manually remove $distdir." - rm -rf $tmpdir - exit 1 -fi -mkdir $distdir || exit 1 - -CPOPTS=-Pp -if (cp --version 2>/dev/null | grep -q 'Free Software Foundation') ; then - # If we're using GNU cp, we can avoid the warnings about forward - # compatibility of the options. - CPOPTS='--parents --preserve' -fi - -echo "" -echo "----------------------------------------------------------------------" -echo "Building $distdir based on the MANIFEST:" -files="`sed -e 's/[ ]:.*$//' $tmpdir/MANIFEST`" -for file in $files; do - echo "Copying $file..." - (cd $tmpdir && cp $CPOPTS $file ../$distdir) || exit 1 -done - -echo "" -echo "----------------------------------------------------------------------" -echo "Removing (temporary) checkout directory..." -rm -rf $tmpdir - -tarball=$distdir.tar.bz2 -echo "Constructing $tarball..." -tar cf - $distdir | bzip2 -9 > $tarball || exit $? -rm -r $distdir - -echo "Done." diff --git a/expat/test-driver-wrapper.sh b/expat/test-driver-wrapper.sh new file mode 100755 index 00000000..30b34d54 --- /dev/null +++ b/expat/test-driver-wrapper.sh @@ -0,0 +1,43 @@ +#! /bin/bash +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017 Expat development team +# 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. + +set -e +top_srcdir="$(dirname "$(type -p "$0")")" +top_builddir=.. + +# Suck up all dash-dash test-driver arguments +test_driver_args=() +while [[ ${1} != '--' ]]; do + test_driver_args=( "${test_driver_args[@]}" "${1}" ) + shift +done +shift # drop "--" + +exec "${top_srcdir}"/conftools/test-driver "${test_driver_args[@]}" "${top_builddir}"/run.sh "$@" diff --git a/expat/tests/Makefile.am b/expat/tests/Makefile.am new file mode 100644 index 00000000..9274fc2e --- /dev/null +++ b/expat/tests/Makefile.am @@ -0,0 +1,62 @@ +# +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017 Expat development team +# 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. + +SUBDIRS = . benchmark + +AM_CPPFLAGS = -I$(srcdir)/../lib + +noinst_LIBRARIES = libruntests.a + +check_PROGRAMS = runtests runtestspp +TESTS = runtests runtestspp + +# To support MinGW and Non-MinGW at the same time: +LOG_DRIVER = $(srcdir)/../test-driver-wrapper.sh + +libruntests_a_SOURCES = \ + chardata.c \ + memcheck.c \ + minicheck.c + +runtests_SOURCES = \ + runtests.c + +runtestspp_SOURCES = \ + runtestspp.cpp + +runtests_LDADD = libruntests.a ../lib/libexpat.la +runtestspp_LDADD = libruntests.a ../lib/libexpat.la + +EXTRA_DIST = \ + chardata.h \ + minicheck.h \ + memcheck.h \ + README.txt \ + xmltest.sh diff --git a/expat/tests/benchmark/Makefile.am b/expat/tests/benchmark/Makefile.am new file mode 100644 index 00000000..f4d7a8e2 --- /dev/null +++ b/expat/tests/benchmark/Makefile.am @@ -0,0 +1,40 @@ +# +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017 Expat development team +# 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. + +AM_CPPFLAGS = -I$(srcdir)/../../lib + +noinst_PROGRAMS = benchmark + +benchmark_SOURCES = benchmark.c + +benchmark_LDADD = ../../lib/libexpat.la + +EXTRA_DIST = \ + README.txt diff --git a/expat/xmlwf/Makefile.am b/expat/xmlwf/Makefile.am new file mode 100644 index 00000000..0ef113c6 --- /dev/null +++ b/expat/xmlwf/Makefile.am @@ -0,0 +1,54 @@ +# +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017 Expat development team +# 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. + +AM_CPPFLAGS = -I$(srcdir)/../lib + +bin_PROGRAMS = xmlwf + +xmlwf_LDADD = ../lib/libexpat.la +xmlwf_SOURCES = \ + xmlwf.c \ + xmlfile.c \ + codepage.c \ + @FILEMAP@.c + +EXTRA_DIST = \ + codepage.h \ + ct.c \ + filemap.h \ + readfilemap.c \ + unixfilemap.c \ + win32filemap.c \ + xmlfile.h \ + xmlmime.c \ + xmlmime.h \ + xmltchar.h \ + xmlurl.h \ + xmlwin32url.cxx -- 2.40.0