diff options
author | Bruno Haible <bruno@clisp.org> | 2020-09-06 11:41:35 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-09-06 11:41:35 +0200 |
commit | 34460e6cbbf329d36fdfe253b0c857d860a29f63 (patch) | |
tree | 22c65fdae3b2db2ce08a78373e58e9113918424d | |
parent | e4529ee17f1998363e55809170242fe2ba82f28e (diff) | |
download | libunistring-34460e6cbbf329d36fdfe253b0c857d860a29f63.tar.gz |
build: Add support for clang on Windows.
* m4/woe32-dll.m4 (gl_WOE32_DLL): Set gl_cv_ld_autoimport to 'no' on
MSVC and MSVC/clang.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | m4/woe32-dll.m4 | 28 |
2 files changed, 26 insertions, 8 deletions
@@ -1,3 +1,9 @@ +2020-09-06 Bruno Haible <bruno@clisp.org> + + build: Add support for clang on Windows. + * m4/woe32-dll.m4 (gl_WOE32_DLL): Set gl_cv_ld_autoimport to 'no' on + MSVC and MSVC/clang. + 2020-08-30 Bruno Haible <bruno@clisp.org> build: Update after gnulib changed. diff --git a/m4/woe32-dll.m4 b/m4/woe32-dll.m4 index 261401f..792394c 100644 --- a/m4/woe32-dll.m4 +++ b/m4/woe32-dll.m4 @@ -1,4 +1,4 @@ -# woe32-dll.m4 serial 4 +# woe32-dll.m4 serial 5 dnl Copyright (C) 2005-2006, 2011, 2015-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -31,13 +31,25 @@ 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_TRY_LINK([], [], [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 |