summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-08-29 13:31:09 +0200
committerDavid Tardon <dtardon@redhat.com>2014-11-24 16:39:03 +0100
commit10c788bbe08ca71b2acd53b7ea0496da0f9672ee (patch)
tree0565787e9458635a29151f2948cf1c8a07c41285
parent79586a2932b51568c76e46b1c0c0559840b5a6ac (diff)
only export public symbols
-rw-r--r--configure.ac19
-rw-r--r--inc/libtext602/WT602Document.h4
2 files changed, 23 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index f0d011e..46a7be4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -162,6 +162,25 @@ AS_CASE([$host],
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL([PLATFORM_WIN32], [test "x$platform_win32" = "xyes"])
+AS_IF([test "x$platform_win32" == "xyes"],
+ [],
+ [
+ AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
+ saved_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+ AC_TRY_COMPILE([], [],
+ [
+ AC_MSG_RESULT([yes])
+ CXXFLAGS="$CXXFLAGS -DLIBTEXT602_VISIBILITY"
+ ],
+ [
+ AC_MSG_RESULT([no])
+ CXXFLAGS="$saved_CXXFLAGS"
+ ]
+ )
+ ]
+)
+
# ================
# Check for cflags
# ================
diff --git a/inc/libtext602/WT602Document.h b/inc/libtext602/WT602Document.h
index 178ba78..fe8033d 100644
--- a/inc/libtext602/WT602Document.h
+++ b/inc/libtext602/WT602Document.h
@@ -18,9 +18,13 @@
#else
#define TEXT602API __declspec(dllimport)
#endif
+#else // !DLL_EXPORT
+#ifdef LIBTEXT602_VISIBILITY
+#define TEXT602API __attribute__((visibility("default")))
#else
#define TEXT602API
#endif
+#endif
namespace libtext602
{