From fa53e1bbfb752f6771afabadfd60c9759d0f0fcc Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 7 Jun 2025 11:38:00 +0200 Subject: [PATCH 1/2] fix: autotools aclocal search dir autools are using system or local builds depending on the version of system tools. This ensures: - `/usr/local/share/aclocal` is searched when using system automake. - system aclocal dir is searched when using local automake. --- docker/build_scripts/install-automake.sh | 5 +++++ tests/autotools/AUTHORS | 0 tests/autotools/COPYING | 21 +++++++++++++++++++++ tests/autotools/ChangeLog | 0 tests/autotools/Makefile.am | 0 tests/autotools/NEWS | 0 tests/autotools/README | 0 tests/autotools/configure.ac | 8 ++++++++ tests/run_tests.sh | 7 +++++++ 9 files changed, 41 insertions(+) create mode 100644 tests/autotools/AUTHORS create mode 100644 tests/autotools/COPYING create mode 100644 tests/autotools/ChangeLog create mode 100644 tests/autotools/Makefile.am create mode 100644 tests/autotools/NEWS create mode 100644 tests/autotools/README create mode 100644 tests/autotools/configure.ac diff --git a/docker/build_scripts/install-automake.sh b/docker/build_scripts/install-automake.sh index a33e4f8db..c8ced2202 100755 --- a/docker/build_scripts/install-automake.sh +++ b/docker/build_scripts/install-automake.sh @@ -23,11 +23,16 @@ if automake --version > /dev/null 2>&1; then INSTALLED=$( (automake --version | head -1 || test $? -eq 141) | awk '{ print $NF }') SMALLEST=$(echo -e "${INSTALLED}\n${AUTOMAKE_VERSION}" | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | head -1 || test $? -eq 141) if [ "${SMALLEST}" == "${AUTOMAKE_VERSION}" ]; then + # add local aclocal files to system automake + echo "/usr/local/share/aclocal" >> "$(aclocal --print-ac-dir)/dirlist" echo "skipping installation of automake ${AUTOMAKE_VERSION}, system provides automake ${INSTALLED}" exit 0 fi fi +# keep system aclocal files with local automake +aclocal --print-ac-dir >> "/usr/local/share/aclocal/dirlist" + fetch_source "${AUTOMAKE_ROOT}.tar.gz" "${AUTOMAKE_DOWNLOAD_URL}" check_sha256sum "${AUTOMAKE_ROOT}.tar.gz" "${AUTOMAKE_HASH}" tar -zxf "${AUTOMAKE_ROOT}.tar.gz" diff --git a/tests/autotools/AUTHORS b/tests/autotools/AUTHORS new file mode 100644 index 000000000..e69de29bb diff --git a/tests/autotools/COPYING b/tests/autotools/COPYING new file mode 100644 index 000000000..7d8f7841a --- /dev/null +++ b/tests/autotools/COPYING @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 manylinux + +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. diff --git a/tests/autotools/ChangeLog b/tests/autotools/ChangeLog new file mode 100644 index 000000000..e69de29bb diff --git a/tests/autotools/Makefile.am b/tests/autotools/Makefile.am new file mode 100644 index 000000000..e69de29bb diff --git a/tests/autotools/NEWS b/tests/autotools/NEWS new file mode 100644 index 000000000..e69de29bb diff --git a/tests/autotools/README b/tests/autotools/README new file mode 100644 index 000000000..e69de29bb diff --git a/tests/autotools/configure.ac b/tests/autotools/configure.ac new file mode 100644 index 000000000..8254e2d45 --- /dev/null +++ b/tests/autotools/configure.ac @@ -0,0 +1,8 @@ +AC_PREREQ([2.72]) +AC_INIT(test_autotools,1.0.0) +AM_INIT_AUTOMAKE([1.17]) +AC_PROG_LIBTOOL +LT_PREREQ([2.5.3]) +LT_INIT() +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 0a6c003fa..dc53348fa 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -186,5 +186,12 @@ int main(int argc, char* argv[]) EOF /tmp/repro +# check autotools +pushd "$(mktemp -d)" +cp -rf "${MY_DIR}/autotools"/* ./ +autoreconf -ifv +./configure +popd + # final report echo "run_tests successful!" From 7ebcece95a394453dedf00f5ec2998638b9bc796 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 7 Jun 2025 11:49:45 +0200 Subject: [PATCH 2/2] Update install-automake.sh --- docker/build_scripts/install-automake.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/build_scripts/install-automake.sh b/docker/build_scripts/install-automake.sh index c8ced2202..962236470 100755 --- a/docker/build_scripts/install-automake.sh +++ b/docker/build_scripts/install-automake.sh @@ -30,8 +30,7 @@ if automake --version > /dev/null 2>&1; then fi fi -# keep system aclocal files with local automake -aclocal --print-ac-dir >> "/usr/local/share/aclocal/dirlist" +SYSTEM_ACLOCAL="$(which aclocal)" fetch_source "${AUTOMAKE_ROOT}.tar.gz" "${AUTOMAKE_DOWNLOAD_URL}" check_sha256sum "${AUTOMAKE_ROOT}.tar.gz" "${AUTOMAKE_HASH}" @@ -50,5 +49,8 @@ cp -rlf /manylinux-rootfs/* / # Remove temporary rootfs rm -rf /manylinux-rootfs +# keep system aclocal files with local automake +"${SYSTEM_ACLOCAL}" --print-ac-dir >> "/usr/local/share/aclocal/dirlist" + hash -r automake --version