From 64532db11fcda9b886df74c00c730108852f4f52 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 2 Aug 2023 10:19:59 +0900 Subject: build: New configure option --with-libtool-modification. * configure.ac (--with-libtool-modification): New. -- GnuPG-bug-id: 6619 Signed-off-by: NIIBE Yutaka --- configure.ac | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index fa31cde..cf7c28b 100644 --- a/configure.ac +++ b/configure.ac @@ -156,14 +156,38 @@ LT_PREREQ([2.2.6]) LT_INIT([win32-dll disable-static]) LT_LANG([Windows Resource]) +# +# 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],[[ - patch -p0 < $srcdir/build-aux/libtool.patch || as_fn_exit 1 -]]) + if test "$build_selection" = never; then + echo "patch not applied" + elif patch -p0 < $srcdir/build-aux/libtool.patch; 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]) ;; *) ;; -- cgit v1.2.3