summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2010-11-25 17:12:31 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-11-25 17:12:31 +0100
commitc9584096e033850c77c4c3d4ee99e8073f7b26da (patch)
tree1c87497cffc99288743e21798b9ac452917f618d /configure.in
parent734624be760b3c7942eb26bea77fca918cb1540d (diff)
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 <mato@kotelna.sk>
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in12
1 files changed, 12 insertions, 0 deletions
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*)