summaryrefslogtreecommitdiff
path: root/m4/woe32-dll.m4
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-01-08 11:53:52 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-01-08 11:53:52 +0100
commitfa838e76139763f902c7d27cb9e1d393ed6a15e4 (patch)
tree7d0ae09775ea950056193eaa2ca93844299d46f1 /m4/woe32-dll.m4
parentc78359d9542c86b972aac373efcf7bc7a8a560e5 (diff)
parent2959e59fab3bab834368adefd90bd4b1b094366b (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'm4/woe32-dll.m4')
-rw-r--r--m4/woe32-dll.m432
1 files changed, 22 insertions, 10 deletions
diff --git a/m4/woe32-dll.m4 b/m4/woe32-dll.m4
index a25f5ac..8a14c2c 100644
--- a/m4/woe32-dll.m4
+++ b/m4/woe32-dll.m4
@@ -1,5 +1,5 @@
-# woe32-dll.m4 serial 3
-dnl Copyright (C) 2005-2006, 2011, 2015-2016 Free Software Foundation, Inc.
+# woe32-dll.m4 serial 6
+dnl Copyright (C) 2005-2006, 2011, 2018, 2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -25,19 +25,31 @@ dnl From Bruno Haible.
# exported struct variable, or to a particular element of an exported
# array variable), requiring code modifications. One platform
# dictates code modifications on all platforms.
-# See <http://www.haible.de/bruno/woe32dll.html> for more details.
+# See <https://haible.de/bruno/woe32dll.html> for more details.
AC_DEFUN([gl_WOE32_DLL],
[
AC_REQUIRE([AC_CANONICAL_HOST])
case "$host_os" in
mingw* | cygwin*)
- AC_MSG_CHECKING([for auto-import of symbols])
- AC_CACHE_VAL([gl_cv_ld_autoimport], [
- gl_save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,--disable-auto-import"
- AC_TRY_LINK([], [], [gl_cv_ld_autoimport=yes], [gl_cv_ld_autoimport=no])
- LDFLAGS="$gl_save_LDFLAGS"])
- AC_MSG_RESULT([$gl_cv_ld_autoimport])
+ AC_CACHE_CHECK([for auto-import of symbols],
+ [gl_cv_ld_autoimport],
+ [dnl --disable-auto-import is unsupported in MSVC and in MSVC/clang.
+ dnl We need to sort out this case explicitly, because with clang,
+ dnl -Wl,--disable-auto-import does not yield an error, however later
+ dnl libtool turns it into --disable-auto-import, which does produce
+ dnl an error.
+ AC_EGREP_CPP([Known], [
+ #ifdef _MSC_VER
+ Known
+ #endif
+ ],
+ [gl_cv_ld_autoimport=no],
+ [gl_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,--disable-auto-import"
+ AC_LINK_IFELSE([], [gl_cv_ld_autoimport=yes], [gl_cv_ld_autoimport=no])
+ LDFLAGS="$gl_save_LDFLAGS"
+ ])
+ ])
if test $gl_cv_ld_autoimport = yes; then
LDFLAGS="$LDFLAGS -Wl,--disable-auto-import"
fi