ICU-5279 Hide -fvisibility=hidden from icu-config users.

Also try a different fix for the Intel compiler, which seems to work differently
from an interactive shell.
This option is not needed for tools or tests.

X-SVN-Rev: 21623
This commit is contained in:
George Rhoten 2007-06-04 05:52:08 +00:00
parent bf6c17b986
commit 26a0e7ebd5
10 changed files with 45 additions and 13 deletions

View File

@ -54,6 +54,8 @@ ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS) $(BATCH_TARGET)
DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
ifneq ($(top_builddir),$(top_srcdir))
CPPFLAGS += -I$(top_builddir)/common

View File

@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION LIB_VERSION LIB_VERSION_MAJOR UNICODE_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os CPPFLAGS CC CFLAGS LDFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA U_MAKE DOXYGEN ARFLAGS COMPILE_LINK_ENVVAR LIB_M ENABLE_SHARED ENABLE_STATIC ENABLE_DEBUG ENABLE_RELEASE U_DEFAULT_SHOW_DRAFT U_USE_GCC_VISIBILITY_ATTRIBUTE RANLIB ac_ct_RANLIB AR U_DISABLE_RENAMING U_ENABLE_TRACING ENABLE_RPATH U_INLINE THREADS_TRUE ICU_USE_THREADS HAVE_MMAP GENCCODE_ASSEMBLY CPP EGREP U_HAVE_INTTYPES_H U_IOSTREAM_SOURCE U_IS_BIG_ENDIAN U_HAVE_NL_LANGINFO_CODESET U_NL_LANGINFO_CODESET U_HAVE_NAMESPACE U_OVERRIDE_CXX_ALLOCATION U_HAVE_PLACEMENT_NEW U_HAVE_POPEN U_HAVE_TZSET U_TZSET U_HAVE_TZNAME U_TZNAME U_HAVE_TIMEZONE U_TIMEZONE U_HAVE_DAYLIGHT U_DAYLIGHT HAVE_INT8_T HAVE_UINT8_T HAVE_INT16_T HAVE_UINT16_T HAVE_INT32_T HAVE_UINT32_T HAVE_INT64_T HAVE_UINT64_T U_HAVE_WCHAR_H U_HAVE_WCSCPY U_SIZEOF_WCHAR_T U_CHECK_UTF16_STRING EXTRAS_TRUE ICUIO_TRUE LAYOUT_TRUE pkgicudatadir thepkgicudatadir DATA_PACKAGING_MODE ICULIBSUFFIX U_HAVE_LIB_SUFFIX ICULIBSUFFIXCNAME TESTS_TRUE SAMPLES_TRUE ICUDATA_CHAR platform platform_make_fragment_name platform_make_fragment LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION LIB_VERSION LIB_VERSION_MAJOR UNICODE_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os CPPFLAGS CC CFLAGS LDFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA U_MAKE DOXYGEN ARFLAGS COMPILE_LINK_ENVVAR LIB_M ENABLE_SHARED ENABLE_STATIC ENABLE_DEBUG ENABLE_RELEASE U_DEFAULT_SHOW_DRAFT U_USE_GCC_VISIBILITY_ATTRIBUTE LIBCFLAGS LIBCXXFLAGS RANLIB ac_ct_RANLIB AR U_DISABLE_RENAMING U_ENABLE_TRACING ENABLE_RPATH U_INLINE THREADS_TRUE ICU_USE_THREADS HAVE_MMAP GENCCODE_ASSEMBLY CPP EGREP U_HAVE_INTTYPES_H U_IOSTREAM_SOURCE U_IS_BIG_ENDIAN U_HAVE_NL_LANGINFO_CODESET U_NL_LANGINFO_CODESET U_HAVE_NAMESPACE U_OVERRIDE_CXX_ALLOCATION U_HAVE_PLACEMENT_NEW U_HAVE_POPEN U_HAVE_TZSET U_TZSET U_HAVE_TZNAME U_TZNAME U_HAVE_TIMEZONE U_TIMEZONE U_HAVE_DAYLIGHT U_DAYLIGHT HAVE_INT8_T HAVE_UINT8_T HAVE_INT16_T HAVE_UINT16_T HAVE_INT32_T HAVE_UINT32_T HAVE_INT64_T HAVE_UINT64_T U_HAVE_WCHAR_H U_HAVE_WCSCPY U_SIZEOF_WCHAR_T U_CHECK_UTF16_STRING EXTRAS_TRUE ICUIO_TRUE LAYOUT_TRUE pkgicudatadir thepkgicudatadir DATA_PACKAGING_MODE ICULIBSUFFIX U_HAVE_LIB_SUFFIX ICULIBSUFFIXCNAME TESTS_TRUE SAMPLES_TRUE ICUDATA_CHAR platform platform_make_fragment_name platform_make_fragment LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@ -3656,8 +3656,10 @@ U_USE_GCC_VISIBILITY_ATTRIBUTE=0
if test "$ac_cv_c_compiler_gnu" = yes; then
OLD_CFLAGS="${CFLAGS}"
OLD_CXXFLAGS="${CXXFLAGS}"
CFLAGS="${CFLAGS} -fvisibility=hidden"
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
LIBCFLAGS="-fvisibility=hidden"
LIBCXXFLAGS="-fvisibility=hidden"
CFLAGS="${CFLAGS} ${LIBCFLAGS}"
CXXFLAGS="${CXXFLAGS} ${LIBCXXFLAGS}"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@ -3703,10 +3705,12 @@ sed 's/^/| /' conftest.$ac_ext >&5
SHAREDLIBEXPORT=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$SHAREDLIBEXPORT" = no; then
CFLAGS="${OLD_CFLAGS}"
CXXFLAGS="${OLD_CXXFLAGS}"
else
# Restore to their original state because the Intel compiler chokes
# on this option when checking for the wchar_t size, but the
# option otherwise works.
CFLAGS="${OLD_CFLAGS}"
CXXFLAGS="${OLD_CXXFLAGS}"
if test "$SHAREDLIBEXPORT" = yes; then
U_USE_GCC_VISIBILITY_ATTRIBUTE=1
fi
fi
@ -3714,6 +3718,8 @@ echo "$as_me:$LINENO: result: $SHAREDLIBEXPORT" >&5
echo "${ECHO_T}$SHAREDLIBEXPORT" >&6
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
@ -9090,6 +9096,8 @@ s,@ENABLE_DEBUG@,$ENABLE_DEBUG,;t t
s,@ENABLE_RELEASE@,$ENABLE_RELEASE,;t t
s,@U_DEFAULT_SHOW_DRAFT@,$U_DEFAULT_SHOW_DRAFT,;t t
s,@U_USE_GCC_VISIBILITY_ATTRIBUTE@,$U_USE_GCC_VISIBILITY_ATTRIBUTE,;t t
s,@LIBCFLAGS@,$LIBCFLAGS,;t t
s,@LIBCXXFLAGS@,$LIBCXXFLAGS,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@AR@,$AR,;t t

View File

@ -187,19 +187,25 @@ U_USE_GCC_VISIBILITY_ATTRIBUTE=0
if test "$ac_cv_c_compiler_gnu" = yes; then
OLD_CFLAGS="${CFLAGS}"
OLD_CXXFLAGS="${CXXFLAGS}"
CFLAGS="${CFLAGS} -fvisibility=hidden"
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
LIBCFLAGS="-fvisibility=hidden"
LIBCXXFLAGS="-fvisibility=hidden"
CFLAGS="${CFLAGS} ${LIBCFLAGS}"
CXXFLAGS="${CXXFLAGS} ${LIBCXXFLAGS}"
AC_TRY_COMPILE([__attribute__ ((visibility ("default"))) void f(void);],[],
[SHAREDLIBEXPORT=yes],[SHAREDLIBEXPORT=no])
if test "$SHAREDLIBEXPORT" = no; then
CFLAGS="${OLD_CFLAGS}"
CXXFLAGS="${OLD_CXXFLAGS}"
else
# Restore to their original state because the Intel compiler chokes
# on this option when checking for the wchar_t size, but the
# option otherwise works.
CFLAGS="${OLD_CFLAGS}"
CXXFLAGS="${OLD_CXXFLAGS}"
if test "$SHAREDLIBEXPORT" = yes; then
U_USE_GCC_VISIBILITY_ATTRIBUTE=1
fi
fi
AC_MSG_RESULT($SHAREDLIBEXPORT)
AC_SUBST(U_USE_GCC_VISIBILITY_ATTRIBUTE)
AC_SUBST(LIBCFLAGS)
AC_SUBST(LIBCXXFLAGS)
AC_PROG_RANLIB
AC_PATH_PROG(AR,ar,[echo archiver ar not found re-run configure ; false],$PATH:/bin:/usr/bin:/usr/ccs/bin)

View File

@ -50,6 +50,8 @@ ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS) $(BATCH_TARGET)
DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
ifneq ($(top_builddir),$(top_srcdir))
CPPFLAGS += -I$(top_builddir)/common

View File

@ -117,6 +117,10 @@ CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
# CPPFLAGS is for C Pre-Processor flags
CPPFLAGS = @CPPFLAGS@
# LIBCFLAGS are the flags for static and shared libraries.
LIBCFLAGS = @LIBCFLAGS@
# LIBCXXFLAGS are the flags for static and shared libraries.
LIBCXXFLAGS = @LIBCXXFLAGS@
# DEFAULT_LIBS are the default libraries to link against
DEFAULT_LIBS = @LIBS@
# LIB_M is for linking against the math library

View File

@ -50,6 +50,8 @@ ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS) $(BATCH_TARGET)
DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
ifneq ($(top_builddir),$(top_srcdir))
CPPFLAGS += -I$(top_builddir)/common

View File

@ -49,6 +49,8 @@ ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS) $(BATCH_TARGET)
DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
ifneq ($(top_builddir),$(top_srcdir))
CPPFLAGS += -I$(top_builddir)/common

View File

@ -49,6 +49,8 @@ ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS) $(BATCH_TARGET)
DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
ifneq ($(top_builddir),$(top_srcdir))
CPPFLAGS += -I$(top_builddir)/common

View File

@ -40,6 +40,8 @@ ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS)
DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
ifneq ($(top_builddir),$(top_srcdir))
CPPFLAGS += -I$(top_builddir)/common

View File

@ -40,6 +40,8 @@ ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS)
DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
ifneq ($(top_builddir),$(top_srcdir))
CPPFLAGS += -I$(top_builddir)/common