summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in2
-rw-r--r--base/lcms2mt.mak2
-rw-r--r--configure.ac19
3 files changed, 22 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index af395bcfe..2640c34f0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -462,6 +462,8 @@ DBUS_LIBS=@DBUS_LIBS@
# defines from autoconf; note that we don't use all of these at present.
ACDEFS=@DEFS@
+CFLAGS_VISIBILITY=@CFLAGS_VISIBILITY@
+
CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(AC_CFLAGS) $(XCFLAGS) @CLUSTER_CFLAGS@
CFLAGSAUX=$(CFLAGSAUX_STANDARD) $(GCFLAGSAUX) $(XCFLAGSAUX)
diff --git a/base/lcms2mt.mak b/base/lcms2mt.mak
index dc7352150..689745790 100644
--- a/base/lcms2mt.mak
+++ b/base/lcms2mt.mak
@@ -80,7 +80,7 @@ lcms2.config-clean :
# NB: we can't use the normal $(CC_) here because msvccmd.mak
# adds /Za which conflicts with the lcms source.
-LCMS2_CC=$(CC) $(D_)SHARE_LCMS=$(SHARE_LCMS)$(_D) $(GENOPT) $(CAPOPT) $(CFLAGS) $(LCMS2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)include $(LCMS2CF_)
+LCMS2_CC=$(CC) $(CFLAGS_VISIBILITY) $(D_)SHARE_LCMS=$(SHARE_LCMS)$(_D) $(GENOPT) $(CAPOPT) $(CFLAGS) $(LCMS2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)include $(LCMS2CF_)
LCMS2O_=$(O_)$(LCMS2OBJ)
# switch in the version of lcms2mt.dev we're actually using
diff --git a/configure.ac b/configure.ac
index 39ff9f754..5a005ff16 100644
--- a/configure.ac
+++ b/configure.ac
@@ -279,6 +279,7 @@ dnl Set build flags based on environment
dnl --------------------------------------------------
CC_OPT_FLAGS_TO_TRY="-O -DNDEBUG"
+CC_VISIBILITY_FLAGS_TO_TRY=""
SET_DT_SONAME="-soname="
CFLAGS_LARGEFILE=""
@@ -287,18 +288,21 @@ case $host in
if test $GCC = yes; then
CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
+ CC_VISIBILITY_FLAGS_TO_TRY="-fvisibility=hidden"
fi
;;
*bsd*)
if test $GCC = yes; then
CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
+ CC_VISIBILITY_FLAGS_TO_TRY="-fvisibility=hidden"
fi
;;
*-darwin*)
if test $GCC = yes; then
CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
+ CC_VISIBILITY_FLAGS_TO_TRY="-fvisibility=hidden"
fi
SET_DT_SONAME=""
;;
@@ -306,6 +310,7 @@ case $host in
if test $GCC = yes; then
CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
+ CC_VISIBILITY_FLAGS_TO_TRY="-fvisibility=hidden"
fi
SET_DT_SONAME=""
;;
@@ -319,6 +324,7 @@ case $host in
if test $GCC = yes; then
CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
+ CC_VISIBILITY_FLAGS_TO_TRY="-fvisibility=hidden"
else
CC_DBG_FLAGS_TO_TRY="-g -O0"
fi
@@ -328,6 +334,7 @@ case $host in
CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
SET_DT_SONAME="so"
+ CC_VISIBILITY_FLAGS_TO_TRY="-fvisibility=hidden"
fi
;;
esac
@@ -448,6 +455,17 @@ for flag in $dbgflags_to_try; do
CFLAGS=$old_cflags
done
+CFLAGS_VISIBILITY=""
+
+for flag in $CC_VISIBILITY_FLAGS_TO_TRY; do
+ CFLAGS="$CFLAGS $flag"
+ AC_TRY_COMPILE(, [return 0;], [
+ echo " $flag"
+ CFLAGS_VISIBILITY="$CFLAGS_VISIBILITY $flag"
+ ])
+ CFLAGS=$old_cflags
+done
+
AC_MSG_RESULT([ ...done.])
dnl ----------------------------
@@ -3485,6 +3503,7 @@ AC_SUBST(CFLAGSAUX_PROFILE)
AC_SUBST(LDFLAGSAUX)
AC_SUBST(AUXEXTRALIBS)
AC_SUBST(ARCH_AUTOCONF_HEADER)
+AC_SUBST(CFLAGS_VISIBILITY)
CONFIG_FILES_LIST="$CONFIG_FILES_LIST $THEMAKEFILE"