2021-05-01 17:30:12 -04:00
|
|
|
# __ __ _
|
|
|
|
# ___\ \/ /_ __ __ _| |_
|
|
|
|
# / _ \\ /| '_ \ / _` | __|
|
|
|
|
# | __// \| |_) | (_| | |_
|
|
|
|
# \___/_/\_\ .__/ \__,_|\__|
|
|
|
|
# |_| XML parser
|
|
|
|
#
|
|
|
|
# Copyright (c) 2021 Sebastian Pipping <sebastian@pipping.org>
|
|
|
|
# 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.
|
2021-03-22 17:22:02 -04:00
|
|
|
|
2021-04-05 09:13:23 -04:00
|
|
|
name: Ensure that GNU Autotools and CMake build systems agree
|
2021-03-22 17:22:02 -04:00
|
|
|
|
|
|
|
on:
|
2021-04-05 12:10:58 -04:00
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 2 * * 5' # Every Friday at 2am
|
2021-03-22 17:22:02 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
checks:
|
2021-04-05 09:13:23 -04:00
|
|
|
name: Ensure that GNU Autotools and CMake build systems agree
|
2021-05-20 17:32:29 -04:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: macos-10.15
|
|
|
|
configure_args:
|
|
|
|
cmake_args:
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
configure_args:
|
|
|
|
cmake_args:
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
configure_args: --host=i686-w64-mingw32
|
|
|
|
cmake_args: -DCMAKE_TOOLCHAIN_FILE=cmake/mingw-toolchain.cmake
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
runs-on: "${{ matrix.os }}"
|
2021-03-22 17:22:02 -04:00
|
|
|
steps:
|
2021-10-18 08:05:03 -04:00
|
|
|
- uses: actions/checkout@v2.3.5
|
2021-03-22 17:22:02 -04:00
|
|
|
|
2021-05-20 17:32:29 -04:00
|
|
|
- name: (Linux) Install build dependencies
|
|
|
|
if: "${{ runner.os == 'Linux' }}"
|
2021-03-22 17:22:02 -04:00
|
|
|
run: |-
|
|
|
|
sudo apt-get install --yes --no-install-recommends -V \
|
|
|
|
cmake \
|
|
|
|
docbook2x \
|
2021-05-20 17:32:29 -04:00
|
|
|
lzip \
|
|
|
|
mingw-w64
|
|
|
|
|
|
|
|
- name: (macOS) Install build dependencies
|
|
|
|
if: "${{ runner.os == 'macOS' }}"
|
|
|
|
run: |
|
|
|
|
brew install \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
cmake \
|
|
|
|
docbook2x \
|
2021-09-08 11:57:00 -04:00
|
|
|
gnu-sed \
|
2021-05-20 17:32:29 -04:00
|
|
|
libtool \
|
2021-03-22 17:22:02 -04:00
|
|
|
lzip
|
|
|
|
|
2021-04-05 09:13:23 -04:00
|
|
|
- name: Produce and extract a release archive
|
2021-03-22 17:22:02 -04:00
|
|
|
run: |
|
|
|
|
set -x
|
2021-04-05 09:13:23 -04:00
|
|
|
cd expat
|
2021-03-22 17:22:02 -04:00
|
|
|
./buildconf.sh
|
|
|
|
./configure
|
|
|
|
make dist
|
2021-03-22 18:46:04 -04:00
|
|
|
tar xf expat-*.*.*.tar.gz
|
2021-03-22 17:22:02 -04:00
|
|
|
|
2021-04-05 09:13:23 -04:00
|
|
|
- name: Build and install using GNU Autotools
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
cd expat/expat-*.*.*/
|
2021-03-22 17:22:02 -04:00
|
|
|
mkdir build_autotools
|
2021-04-05 09:13:23 -04:00
|
|
|
cd build_autotools
|
2021-05-20 17:32:29 -04:00
|
|
|
../configure \
|
|
|
|
--libdir='${exec_prefix}/lib123' \
|
|
|
|
${{matrix.configure_args}}
|
2021-04-05 09:13:23 -04:00
|
|
|
make install DESTDIR="${PWD}"/ROOT
|
2021-05-20 17:32:29 -04:00
|
|
|
find ROOT | sort | xargs ls -ld
|
2021-03-22 17:22:02 -04:00
|
|
|
|
2021-04-05 09:13:23 -04:00
|
|
|
- name: Build and install using CMake
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
cd expat/expat-*.*.*/
|
2021-03-22 17:22:02 -04:00
|
|
|
mkdir build_cmake
|
2021-04-05 09:13:23 -04:00
|
|
|
cd build_cmake
|
2021-05-20 17:32:29 -04:00
|
|
|
cmake \
|
|
|
|
-DCMAKE_INSTALL_LIBDIR=lib123 \
|
|
|
|
${{matrix.cmake_args}} \
|
|
|
|
..
|
2021-04-05 09:13:23 -04:00
|
|
|
make install DESTDIR="${PWD}"/ROOT
|
2021-05-20 17:32:29 -04:00
|
|
|
find ROOT | sort | xargs ls -ld
|
2021-03-22 17:22:02 -04:00
|
|
|
|
2021-04-05 09:13:23 -04:00
|
|
|
- name: Check for identical CMake files from both build systems
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
cd expat/expat-*.*.*/
|
2021-05-20 17:32:29 -04:00
|
|
|
|
|
|
|
if [[ "${{ matrix.configure_args }}" == *mingw* ]]; then
|
|
|
|
# There is one known difference between Autotools and CMake for MinGW:
|
|
|
|
# Autotools: usr/local/bin/libexpat-<major>.dll
|
|
|
|
# CMake: usr/local/bin/libexpat.dll
|
2021-09-10 09:56:17 -04:00
|
|
|
# We patch the Autotools side in line here to get the differ below to empty.
|
2021-05-20 17:32:29 -04:00
|
|
|
mv build_autotools/ROOT/usr/local/bin/libexpat{-*,}.dll
|
|
|
|
( cd build_autotools/ROOT/usr/local/lib*/cmake/expat-*/ \
|
|
|
|
&& sed 's,libexpat-[0-9]\+\.dll,libexpat.dll,g' expat-noconfig.cmake > expat-noconfig-patched.cmake \
|
|
|
|
&& ! diff -u0 expat-noconfig{,-patched}.cmake \
|
|
|
|
&& mv expat-noconfig{-patched,}.cmake )
|
|
|
|
fi
|
|
|
|
|
2021-09-08 11:57:00 -04:00
|
|
|
if [[ "${{ runner.os }}" == macOS ]]; then
|
|
|
|
# Autotools' LT_LIB_M has a hardcoded exclude for "*-*-darwin*" hosts,
|
|
|
|
# while macOS does have libm and is successfully found by CMake.
|
|
|
|
# We patch the CMake side in line here to get the differ below to empty.
|
|
|
|
export PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:${PATH}"
|
|
|
|
sed 's,-lm,,' -i build_cmake/ROOT/usr/local/lib*/pkgconfig/expat.pc
|
|
|
|
fi
|
|
|
|
|
2021-03-22 17:22:02 -04:00
|
|
|
diff \
|
|
|
|
--recursive \
|
|
|
|
--unified \
|
|
|
|
--exclude=xmlwf \
|
2021-05-20 17:32:29 -04:00
|
|
|
--exclude=xmlwf.exe \
|
2021-03-22 17:22:02 -04:00
|
|
|
--exclude=libexpat.a \
|
2021-05-20 17:32:29 -04:00
|
|
|
--exclude=libexpat.dll \
|
|
|
|
--exclude=libexpat.dll.a \
|
2021-03-22 17:22:02 -04:00
|
|
|
--exclude=libexpat.la \
|
2021-05-20 17:32:29 -04:00
|
|
|
--exclude=libexpat.so\* \
|
|
|
|
--exclude=libexpat.\*dylib \
|
2021-03-22 17:22:02 -04:00
|
|
|
--exclude=expat_config.h \
|
|
|
|
build_{autotools,cmake}/ROOT
|
2021-04-05 09:29:18 -04:00
|
|
|
|
2021-05-20 17:32:29 -04:00
|
|
|
- name: (Linux except MinGW) Check for identical exported symbols from both build systems
|
|
|
|
if: "${{ runner.os == 'Linux' && ! contains(matrix.configure_args, 'mingw') }}"
|
2021-04-05 09:29:18 -04:00
|
|
|
run: |
|
|
|
|
list_shared_library_symbols_sh="${GITHUB_WORKSPACE}"/.github/workflows/scripts/list-shared-library-symbols.sh
|
|
|
|
exported_symbols_txt="${GITHUB_WORKSPACE}"/.github/workflows/data/exported-symbols.txt
|
|
|
|
|
|
|
|
set -x
|
|
|
|
cd expat/expat-*.*.*/
|
|
|
|
diff -u "${exported_symbols_txt}" <("${list_shared_library_symbols_sh}" build_autotools/ROOT/usr/local/lib*/libexpat.so)
|
|
|
|
diff -u "${exported_symbols_txt}" <("${list_shared_library_symbols_sh}" build_cmake/ROOT/usr/local/lib*/libexpat.so)
|