diff options
-rw-r--r-- | configure.ac | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index fa31cde..cf7c28b 100644 --- a/configure.ac +++ b/configure.ac @@ -157,13 +157,37 @@ 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]) ;; *) ;; |