From 4bd99d1590b1a3cb9a8403ac420aa2571bc78af5 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Thu, 25 Jan 2024 20:32:12 -0500 Subject: [PATCH] Add AM_PROG_AR to configure.ac. Without this, Automake fails to build static libraries with the Microsoft compiler tools. Update DX_AUTOMAKE_COMPAT to wrap ar-lib just like is currently done with compile, so that it is run with the configured shell instead of hardcoded /bin/sh. --- .gitignore | 2 ++ configure.ac | 3 ++- m4/am-compat.m4 | 9 ++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 88555f8..e000784 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ *.a +*.exe *.lo *.o .deps .dirstamp /aclocal.m4 +/ar-lib /atconfig /atlocal /autom4te.cache diff --git a/configure.ac b/configure.ac index b10b625..8bbda6e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -dnl Copyright © 2015, 2019-2023 Nick Bowler +dnl Copyright © 2015, 2019-2024 Nick Bowler dnl dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2. dnl This is free software: you are free to do what the fuck you want to. @@ -23,6 +23,7 @@ AC_PROG_AWK AC_USE_SYSTEM_EXTENSIONS AC_C_INLINE +AM_PROG_AR AC_SUBST([STUB_INCLUDES], [@&t@]) diff --git a/m4/am-compat.m4 b/m4/am-compat.m4 index 852fe87..f56b4b2 100644 --- a/m4/am-compat.m4 +++ b/m4/am-compat.m4 @@ -1,4 +1,4 @@ -dnl Copyright © 2012, 2021, 2023 Nick Bowler +dnl Copyright © 2012, 2021, 2023-2024 Nick Bowler dnl dnl Definitions to help maintain compatibility with multiple Automake versions. dnl @@ -42,6 +42,7 @@ dnl in Automake 1.11). AC_DEFUN_ONCE([DX_AUTOMAKE_COMPAT], [AC_REQUIRE([DX_INIT])dnl AC_REQUIRE([_DX_AUTOMAKE_COMPAT_PATCH_CC])dnl +AC_REQUIRE([_DX_AUTOMAKE_COMPAT_PATCH_AR])dnl AC_CONFIG_COMMANDS_PRE([# Patch install-sh references to include $SHELL AS_CASE([$MKDIR_P], ["$ac_install_sh"*], [MKDIR_P="$SHELL $MKDIR_P"]) AS_CASE([$INSTALL], ["$ac_install_sh"*], [INSTALL="$SHELL $INSTALL"]) @@ -90,3 +91,9 @@ AC_DEFUN_ONCE([_DX_AUTOMAKE_COMPAT_PATCH_CC], DX_PATCH_MACRO([_AM_PROG_CC_C_O], ["[$]am_aux_dir/compile], ["$SHELL $am_aux_dir/compile])]) + +AC_DEFUN_ONCE([_DX_AUTOMAKE_COMPAT_PATCH_AR], +[AC_BEFORE([$0], [AM_PROG_AR])dnl +DX_PATCH_MACRO([AM_PROG_AR], + ["[$]am_aux_dir/ar-lib], + ["$SHELL $am_aux_dir/ar-lib])]) -- 2.43.2