From: Ivan Maidanski Date: Fri, 26 Jul 2019 18:24:18 +0000 (+0300) Subject: Pass -D GC_DLL -fvisibility=hidden if default configure build is requested X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ffd39036002e6ecdd69a1ebe327a0db039149c9b;p=gc Pass -D GC_DLL -fvisibility=hidden if default configure build is requested (fix of commit c9964cfc0) If --disable-shared and --enable-static are not passed to configure then build generates only shared libraries, thus the internal symbols visibility could be restricted. * configure.ac [$enable_shared="" && $enable_static!=yes || $enable_shared=yes && $enable_static==""] (GC_DLL): Define AC macro. * configure.ac [($enable_shared="" && $enable_static!=yes || $enable_shared=yes && $enable_static=="") && $GCC=yes && $ac_cv_fvisibility_hidden=yes] (CFLAGS): Add -DGC_VISIBILITY_HIDDEN_SET -fvisibility=hidden. --- diff --git a/configure.ac b/configure.ac index 08a4dbc2..5720f220 100644 --- a/configure.ac +++ b/configure.ac @@ -532,8 +532,7 @@ esac AC_MSG_RESULT($enable_shared) # Compile with GC_DLL defined unless building static libraries. -if test "${enable_shared}" = yes; then - if test "${enable_static}" = no; then +if test "${enable_shared}" != no -a "${enable_static}" != yes; then AC_DEFINE(GC_DLL) if test "$GCC" = yes; then # Pass -fvisibility=hidden option if supported @@ -548,13 +547,11 @@ if test "${enable_shared}" = yes; then [CFLAGS="-DGC_NO_VISIBILITY $CFLAGS"]) AC_MSG_RESULT($ac_cv_fvisibility_hidden) fi - fi -fi +else -# Do not require the clients to link with "user32" system library. -if test "${enable_static}" = yes -o "${enable_shared}" = no; then case "$host" in *-*-cygwin* | *-*-mingw* | *-*-msys*) + # Do not require the clients to link with "user32" system library. AC_DEFINE([DONT_USE_USER32_DLL], 1, [Do not use user32.dll import library (Win32).]) ;;