From c1d3f5952f621a553c122cee7a20e990d982a715 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 28 Jul 2023 08:57:01 +0900 Subject: build: Apply libtool.patch at the last stage of configure. * build-aux/libtool.patch: New. * build-aux/ltmain.sh: Revert our local change to original. * configure.ac [x86_64-*mingw32*] (libtool-patch): Introduce a construct with AC_CONFIG_COMMANDS to apply build-aux/libtool.patch after libtool generation. -- GnuPG-bug-id: 6619 Signed-off-by: NIIBE Yutaka --- build-aux/libtool.patch | 45 +++++++++++++++++++++++++++++++++++++++++++++ build-aux/ltmain.sh | 14 +------------- configure.ac | 12 ++++++++++++ 3 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 build-aux/libtool.patch diff --git a/build-aux/libtool.patch b/build-aux/libtool.patch new file mode 100644 index 0000000..cc1340e --- /dev/null +++ b/build-aux/libtool.patch @@ -0,0 +1,45 @@ +# +# We used to maintain our local changes to ltmain.sh. +# +# But it doesn't work well when a user tries to run libtoolize with +# newer libtool on his system. +# +# So, instead of keeping a change in ltmain.sh, we introduce patching +# libtool, at the last stage of configure just libtool is generated. +# +# When new libtool is released, please update this patch. Currently, +# we assume: +# +# package_revision=2.4.7 +# + +--- libtool.orig 2023-07-27 15:45:41.026220580 +0900 ++++ libtool 2023-07-27 11:20:52.933295428 +0900 +@@ -9016,6 +9016,11 @@ + elif test -n "$soname_spec"; then + # bleh windows + case $host in ++ x86_64-*mingw32*) ++ func_arith $current - $age ++ major=$func_arith_result ++ versuffix="6-$major" ++ ;; + *cygwin* | mingw* | *cegcc* | *os2*) + func_arith $current - $age + major=$func_arith_result +@@ -9794,7 +9799,14 @@ + # extension on DOS 8.3 file systems. + func_arith $current - $age + major=$func_arith_result +- versuffix="-$major" ++ case $host in ++ x86_64-*mingw32*) ++ versuffix="6-$major" ++ ;; ++ *) ++ versuffix="-$major" ++ ;; ++ esac + ;; + + *) diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh index ab1b7dc..f495350 100644 --- a/build-aux/ltmain.sh +++ b/build-aux/ltmain.sh @@ -8497,11 +8497,6 @@ func_mode_link () elif test -n "$soname_spec"; then # bleh windows case $host in - x86_64-*mingw32*) - func_arith $current - $age - major=$func_arith_result - versuffix="6-$major" - ;; *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result @@ -9280,14 +9275,7 @@ func_mode_link () # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result - case $host in - x86_64-*mingw32*) - versuffix="6-$major" - ;; - *) - versuffix="-$major" - ;; - esac + versuffix="-$major" ;; *) diff --git a/configure.ac b/configure.ac index ca7731c..385ccf8 100644 --- a/configure.ac +++ b/configure.ac @@ -156,6 +156,18 @@ LT_PREREQ([2.2.6]) LT_INIT([win32-dll disable-static]) LT_LANG([Windows Resource]) +# +# Apply a patch (locally maintained one of ours) to libtool +# +case $host in + x86_64-*mingw32*) +AC_CONFIG_COMMANDS([libtool-patch],[[ + patch -p0 < $srcdir/build-aux/libtool.patch +]]) + ;; + *) + ;; +esac # We need to compile and run a program on the build machine. AX_CC_FOR_BUILD -- cgit v1.2.3