From ae26b12f3e93e3f0938cc7e13f8ece57a7843e9c Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 1 Jul 2014 17:20:17 -0700 Subject: If -fvisibility=hidden isn't supported, try -xldscope=hidden. That's the option for newer versions of Sun^WOracle C. Change-Id: I62c12d5870d84587f81a8789732675021523e9ed Reviewed-on: https://code.wireshark.org/review/2769 Reviewed-by: Guy Harris --- configure.ac | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 15f910c59b..fb865fb662 100644 --- a/configure.ac +++ b/configure.ac @@ -903,12 +903,29 @@ esac # AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fexcess-precision=fast) +# +# Try to have the compiler default to hiding symbols, so that only +# symbols explicitly exported with WS_DLL_PUBLIC will be visible +# outside (shared) libraries; that way, more UN*X builds will catch +# failures to export symbols, rather than having that fail only on +# Windows. +# CFLAGS_before_fvhidden="$CFLAGS" +# +# GCC and GCC-compatible compilers +# AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fvisibility=hidden) if test "x$CFLAGS" = "x$CFLAGS_before_fvhidden" then - # TODO add other ways of hiding symbols - AC_MSG_WARN(Compiler will export all symbols from shared libraries) + # + # Sun^WOracle C. + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xldscope=hidden) + if test "x$CFLAGS" = "x$CFLAGS_before_fvhidden" + then + # TODO add other ways of hiding symbols + AC_MSG_WARN(Compiler will export all symbols from shared libraries) + fi fi AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed]) -- cgit v1.2.3