diff options
author | NIIBE Yutaka <[email protected]> | 2023-08-08 07:46:59 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2023-08-08 07:46:59 +0000 |
commit | 9bb7a2a1a066b20022714b21ca2ae5ccb9d19d55 (patch) | |
tree | dadee0e6274d024090d1e1e8bd749ab55202b9ee | |
parent | Add NEWS entries for 2.5.6 from libassuan 2.5 branch. (diff) | |
download | libassuan-9bb7a2a1a066b20022714b21ca2ae5ccb9d19d55.tar.gz libassuan-9bb7a2a1a066b20022714b21ca2ae5ccb9d19d55.zip |
build: New configure option --with-libtool-modification.
* Makefile.am (EXTRA_DIST): Add build-aux/libtool-patch.sed.
* build-aux/libtool-patch.sed: New.
* configure.ac (--with-libtool-modification): New.
* build-aux/ltmain.sh: Revert our own local modification.
--
Fixes-commit: f88eb9e98f491b503f46c7d995c9651f1e46b9e9
GnuPG-bug-id: 6619
Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | build-aux/libtool-patch.sed | 33 | ||||
-rwxr-xr-x | build-aux/ltmain.sh | 13 | ||||
-rw-r--r-- | configure.ac | 38 |
4 files changed, 74 insertions, 16 deletions
diff --git a/Makefile.am b/Makefile.am index 0da00ea..c6a2afb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,9 +25,9 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-doc # (A suitable gitlog-to-changelog script can be found in GnuPG master.) GITLOG_TO_CHANGELOG=gitlog-to-changelog -EXTRA_DIST = autogen.sh autogen.rc README.GIT VERSION \ - ChangeLog-2011 doc/ChangeLog-2011 src/ChangeLog-2011 \ - tests/ChangeLog-2011 \ +EXTRA_DIST = autogen.sh autogen.rc README.GIT VERSION \ + ChangeLog-2011 doc/ChangeLog-2011 src/ChangeLog-2011 \ + tests/ChangeLog-2011 build-aux/libtool-patch.sed \ build-aux/git-log-footer build-aux/git-log-fix if BUILD_DOC diff --git a/build-aux/libtool-patch.sed b/build-aux/libtool-patch.sed new file mode 100644 index 0000000..f0e6da9 --- /dev/null +++ b/build-aux/libtool-patch.sed @@ -0,0 +1,33 @@ +# +# This is a sed script to patch the generated libtool +# +/^[ \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/build-aux/ltmain.sh b/build-aux/ltmain.sh index f8c3614..859599a 100755 --- a/build-aux/ltmain.sh +++ b/build-aux/ltmain.sh @@ -6766,11 +6766,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*) func_arith $current - $age major=$func_arith_result @@ -7504,14 +7499,6 @@ func_mode_link () 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/configure.ac b/configure.ac index b37d739..00da3da 100644 --- a/configure.ac +++ b/configure.ac @@ -148,6 +148,44 @@ esac AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") +# +# Specify how we support our local modification of libtool for Windows +# 64-bit. Options are: +# +# (1) apply: when appying patch fails, it results failure of entire build +# (2) never: never apply the patch (no try) +# (3) try: use patched if it goes well, use original if fails +# +AC_ARG_WITH([libtool-modification], + AS_HELP_STRING([--with-libtool-modification=apply|never|try], + [how to handle libtool modification (default=apply)]), + build_libtool_modification=$withval, + build_libtool_modification=apply) + +# +# Apply a patch (locally maintained one of ours) to libtool +# +case $host in + x86_64-*mingw32*) +AC_CONFIG_COMMANDS([libtool-patch],[[ + if test "$build_selection" = never; then + echo "patch not applied" + 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 + echo "patch failed, thus, using original" + else + echo "patch failed" + as_fn_exit 1 + fi +]],[build_selection=$build_libtool_modification]) + ;; + *) + ;; +esac + AH_TOP([ #ifndef _ASSUAN_CONFIG_H_INCLUDED #define _ASSUAN_CONFIG_H_INCLUDED |