diff -urp libbraille-0.19.0.orig/configure.ac libbraille-0.19.0/configure.ac --- libbraille-0.19.0.orig/configure.ac 2006-03-03 18:31:27.000000000 -0600 +++ libbraille-0.19.0/configure.ac 2024-04-21 12:08:43.799885754 -0500 @@ -208,6 +208,44 @@ AC_SUBST(JAVA_INC) AC_SUBST(JAVA_INC_NATIVE) AM_CONDITIONAL(JAVAWRAPPER, test x$enable_java = xyes) +dnl ************************************************************ +dnl Enable hiding of internal symbols in library to reduce its size and +dnl speed dynamic linking of applications. This currently is only supported +dnl on gcc >= 4.0 and SunPro C. +dnl +AC_MSG_CHECKING([whether to enable hidden symbols in the library]) +AC_ARG_ENABLE(hidden-symbols, +AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library]) +AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_CHECKING([whether $CC supports it]) + if test "$GCC" = yes ; then + if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then + AC_MSG_RESULT(yes) + AC_DEFINE(BRAILLE_API, [__attribute__ ((visibility ("default")))], [to make a symbol visible]) + CFLAGS="$CFLAGS -fvisibility=hidden" + else + AC_MSG_RESULT(no) + fi + + else + dnl Test for SunPro cc + if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then + AC_MSG_RESULT(yes) + AC_DEFINE(BRAILLE_API, [__global], [to make a symbol visible]) + CFLAGS="$CFLAGS -xldscope=hidden" + else + AC_MSG_RESULT(no) + fi + fi + ;; + esac ], + AC_MSG_RESULT(no) +) # Finally create all the generated files # The configure script takes "file.in" and substitutes variables to produce # "file". In this case we are just generating the Makefiles, but this could diff -urp libbraille-0.19.0.orig/include/braille.h libbraille-0.19.0/include/braille.h --- libbraille-0.19.0.orig/include/braille.h 2006-03-03 18:31:25.000000000 -0600 +++ libbraille-0.19.0/include/braille.h 2024-04-21 12:08:43.799885754 -0500 @@ -25,13 +25,7 @@ extern "C" { // that uses this DLL. This way any other project whose source files include this file see // LIBBRAILLE_API functions as being imported from a DLL, wheras this DLL sees symbols // defined with this macro as being exported. -#ifdef WIN32 -#ifdef LIBBRAILLE_EXPORTS -#define BRAILLE_API __declspec(dllexport) -#else -#define BRAILLE_API __declspec(dllimport) -#endif -#else +#ifndef BRAILLE_API #define BRAILLE_API #endif