aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-08-08 07:40:52 +0000
committerNIIBE Yutaka <[email protected]>2023-08-08 07:40:52 +0000
commit8dd210e9e15905f8c6d155c64b09378d65382335 (patch)
tree2f5569e601666c3ad4c9ef186bcc28b88022ab04
parentbuild: Add build-aux/libtool.patch in the tarball. (diff)
downloadlibgpg-error-8dd210e9e15905f8c6d155c64b09378d65382335.tar.gz
libgpg-error-8dd210e9e15905f8c6d155c64b09378d65382335.zip
build: Use sed for --with-libtool-modification.
* configure.ac (--with-libtool-modification): Use sed. -- I crafted a sed script so that it can work well against multiple versions of libtool. Tested with 2.4.2 and 2.4.7. GnuPG-bug-id: 6619 Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--Makefile.am2
-rw-r--r--build-aux/libtool-patch.sed34
-rw-r--r--configure.ac3
3 files changed, 37 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 69b12bd..d1e33a4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -37,7 +37,7 @@ EXTRA_DIST = autogen.sh autogen.rc libgpg-error.spec.in \
VERSION COPYING COPYING.LIB doc/HACKING ChangeLog-2011 \
po/ChangeLog-2011 m4/ChangeLog-2011 \
build-aux/git-log-footer build-aux/git-log-fix \
- build-aux/libtool.patch
+ build-aux/libtool-patch.sed
if LANGUAGES_SOME
lang_subdirs = lang
diff --git a/build-aux/libtool-patch.sed b/build-aux/libtool-patch.sed
new file mode 100644
index 0000000..bd021fe
--- /dev/null
+++ b/build-aux/libtool-patch.sed
@@ -0,0 +1,34 @@
+#
+# This is a sed script to patch the generated libtool,
+# which works well against both of libtool 2.4.2 and 2.4.7.
+#
+/^[ \t]*# bleh windows$/{
+:loop0
+s/^[ \t]*esac$/\0/
+t done0
+s/^[ \t]*case \$host in$/\0/
+t insert0
+n
+b loop0
+:insert0 n
+i\
+ x86_64-*mingw32*)
+i\
+ func_arith $current - $age
+i\
+ major=$func_arith_result
+i\
+ versuffix="6-$major"
+i\
+ ;;
+b loop0
+:done0
+}
+/^[ \t]*# extension on DOS 8.3 file.*systems.$/{
+:loop1
+s/^[ \t]*\(versuffix=\)\(.*\)\(-$major\)\(.*\)$/\t case \$host in\n\t x86_64-*mingw32*)\n\t \1\26\3\4\n\t ;;\n\t *)\n\t \1\2\3\4\n\t ;;\n\t esac/
+t done1
+n
+b loop1
+:done1
+}
diff --git a/configure.ac b/configure.ac
index cf7c28b..7a0abb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -178,7 +178,8 @@ case $host in
AC_CONFIG_COMMANDS([libtool-patch],[[
if test "$build_selection" = never; then
echo "patch not applied"
- elif patch -p0 < $srcdir/build-aux/libtool.patch; then
+ elif (mv -f libtool libtool.orig; \
+ sed -f $srcdir/build-aux/libtool-patch.sed libtool.orig >libtool); then
echo "applied successfully"
elif test "$build_selection" = try; then
mv -f libtool.orig libtool