From 6fffcb6be0f136a82a8db1a738d415033c10e3a4 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 14 Dec 2021 23:01:02 +0300
Subject: [PATCH] ignore visibility attributes for irrelevant targets.
---
configure | 7 +++++++
configure.ac | 7 ++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 1222a00..65eaccf 100755
--- a/configure
+++ b/configure
@@ -18603,6 +18603,13 @@ CheckVisibilityHidden()
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -fvisibility=hidden option" >&5
$as_echo_n "checking for GCC -fvisibility=hidden option... " >&6; }
have_gcc_fvisibility=no
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ignored for $host_os" >&5
+$as_echo "ignored for $host_os" >&6; }
+ return
+ ;;
+ esac
visibility_CFLAGS="-fvisibility=hidden"
save_CFLAGS="$CFLAGS"
diff --git a/configure.ac b/configure.ac
index 255b876..c4ebbdc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,11 +203,16 @@ AM_CONDITIONAL(OS_WIN32, test x$hb_os_win32 = xyes)
AM_CONDITIONAL(USE_BUILTIN_HARFBUZZ, test x$enable_harfbuzz_builtin = xyes)
dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
-dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
CheckVisibilityHidden()
{
AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
have_gcc_fvisibility=no
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2*)
+ AC_MSG_RESULT([ignored for $host_os])
+ return
+ ;;
+ esac
visibility_CFLAGS="-fvisibility=hidden"
save_CFLAGS="$CFLAGS"