diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2020-04-27 10:20:00 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2020-04-27 11:16:59 +0100 |
commit | f210e4c009f7d401767336a264c2e4b9cf668216 (patch) | |
tree | 95728b0ebfc6e12963d78739e04bedd2ce436f13 /configure.ac | |
parent | 7c96228899ea05b40cdb31dc5a4c3f61aa0d39e6 (diff) | |
download | ghostpdl-f210e4c009f7d401767336a264c2e4b9cf668216.tar.gz |
Bug 702349: Fix symbol clash between lcms2mt and lcms2
Shared library (libgs) with lcms2mt could clash if the calling app also
included lcms2.
Using gcc (or compatible) this builds lcms2mt using the -fvisibility=hidden
option, so symbols are not exported.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 19 |
1 files changed, 19 insertions, 0 deletions
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" |