From c9584096e033850c77c4c3d4ee99e8073f7b26da Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Thu, 25 Nov 2010 17:12:31 +0100 Subject: Control symbol exports using -fvisibility On systems using GCC 4.0 or newer which support symbol visibility in shared libraries, use -fvisibility=hidden and only export explict API functions defined in zmq.cpp. We do not enable -fvisibility on MinGW since this uses a separate mechanism (__declspec). Signed-off-by: Martin Lucina --- configure.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 27f8bab..b7d524a 100644 --- a/configure.in +++ b/configure.in @@ -223,6 +223,18 @@ case "${host_os}" in ;; esac +# Check if the compiler supports -fvisibility=hidden. If so, use it, but not +# on MinGW32 where we use a separate mechanism (__declspec). +_LT_COMPILER_OPTION([if $compiler supports -fvisibility=hidden], + ac_cv_prog_compiler_visibility, + [-fvisibility=hidden], + [], + [have_dso_visibility=yes]) +if test "x$have_dso_visibility" = "xyes" -a "x$on_mingw32" = "xno"; then + LIBZMQ_EXTRA_CFLAGS="-fvisibility=hidden $LIBZMQ_EXTRA_CFLAGS" + LIBZMQ_EXTRA_CXXFLAGS="-fvisibility=hidden $LIBZMQ_EXTRA_CXXFLAGS" +fi + # CPU-specific optimizations case "${host_cpu}" in *sparc*) -- cgit v1.2.3