]> granicus.if.org Git - gc/commitdiff
Pass -D GC_DLL -fvisibility=hidden if default configure build is requested
authorIvan Maidanski <ivmai@mail.ru>
Fri, 26 Jul 2019 18:24:18 +0000 (21:24 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 26 Jul 2019 18:24:18 +0000 (21:24 +0300)
(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.

configure.ac

index 08a4dbc241d8664fd5ff0caae811d8727f0e9b03..5720f220f0304339b2f88f172f67ede23c38d2ab 100644 (file)
@@ -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).])
       ;;