diff --git a/configure.ac b/configure.ac index 3e2ab7a..31de3d3 100644 --- a/configure.ac +++ b/configure.ac @@ -82,6 +82,18 @@ else AC_CHECK_CXXFLAG([CXXFLAGS], [DNDEBUG]) fi +dnl see if we have to enable visibility support +AC_ARG_ENABLE([visibility-support], + AS_HELP_STRING([--enable-visibility-support], + [enable the new GCC visibility support; requires GCC >= 4.0 to work.]), + [enable_gcc_visibility="$enableval"], + [enable_gcc_visibility="no"]) +AC_MSG_CHECKING([whether to use new GCC visibility attributes]) +if test "x$enable_gcc_visibility" = "xno"; then + CPPFLAGS="${CPPFLAGS} -DDISABLE_VISIBILITY_SUPPORT" +fi +AC_MSG_RESULT([$enable_gcc_visibility]) + AC_PROG_INSTALL diff --git a/distro/ebuild/sgpemv2-1.0.ebuild b/distro/ebuild/sgpemv2-1.0.ebuild index 8a5fbc1..92ce75b 100644 --- a/distro/ebuild/sgpemv2-1.0.ebuild +++ b/distro/ebuild/sgpemv2-1.0.ebuild @@ -35,7 +35,7 @@ src_compile() { conf_opts="--disable-tests" fi - conf_opts="${conf_opts} --disable-static" + conf_opts="${conf_opts} --enable-visibility-support" mkdir build && cd build diff --git a/src/backend/sgpemv2/sgpemv2-visibility.hh b/src/backend/sgpemv2/sgpemv2-visibility.hh index d8e4793..fb18785 100644 --- a/src/backend/sgpemv2/sgpemv2-visibility.hh +++ b/src/backend/sgpemv2/sgpemv2-visibility.hh @@ -1,7 +1,12 @@ +#ifndef VISIBILITY_SUPPORT_HH +#define VISIBILITY_SUPPORT_HH 1 + +// ----------------------------------------------------------- + // Visibility macros for GNU GCC -#if defined __GNUC__ && (__GNUC__) >= 4 +#if defined __GNUC__ && (__GNUC__) >= 4 && (not defined DISABLE_VISIBILITY_SUPPORT) /* Attribute for objects to be exported from DSOs */ #define SG_DLLEXPORT __attribute__ ((visibility("default"))) @@ -30,3 +35,7 @@ #define SG_DLLPUBLIC /* Unsupported */ #endif + +// ------------------------------------------------------------ + +#endif