ICU-2957 Enable UTF-16 strings on Solaris for ICU only (not ICU users).
X-SVN-Rev: 21606
This commit is contained in:
parent
ab0628ec13
commit
a7e2d26372
@ -235,16 +235,14 @@ typedef unsigned int uint32_t;
|
||||
* instead.
|
||||
* @internal
|
||||
*/
|
||||
#if @CHECK_UTF16_STRING_PREFIX@
|
||||
#if @U_CHECK_UTF16_STRING@ || defined(U_CHECK_UTF16_STRING)
|
||||
#if (defined(__xlC__) && defined(__IBM_UTF_LITERAL)) \
|
||||
|| (defined(__HP_aCC) && __HP_aCC >= 035000) \
|
||||
|| (defined(__HP_cc) && __HP_cc >= 111106)
|
||||
#define U_DECLARE_UTF16(string) u ## string
|
||||
/* We can't detect from the Sun compiler when this option is available */
|
||||
/*
|
||||
#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
|
||||
#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
|
||||
|| (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
|
||||
#define U_DECLARE_UTF16(string) U ## string
|
||||
*/
|
||||
#elif (defined(U_WINDOWS) || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
|
||||
#define U_DECLARE_UTF16(string) L ## string
|
||||
#endif
|
||||
|
48
icu4c/source/configure
vendored
48
icu4c/source/configure
vendored
@ -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 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 CHECK_UTF16_STRING_PREFIX 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 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.
|
||||
@ -7555,7 +7555,7 @@ fi
|
||||
|
||||
echo "$as_me:$LINENO: checking for UTF-16 string literal support" >&5
|
||||
echo $ECHO_N "checking for UTF-16 string literal support... $ECHO_C" >&6
|
||||
CHECK_UTF16_STRING_PREFIX=1
|
||||
U_CHECK_UTF16_STRING=1
|
||||
CHECK_UTF16_STRING_RESULT="unknown"
|
||||
case "${host}" in
|
||||
*-*-aix*|powerpc64-*-linux*)
|
||||
@ -7601,15 +7601,15 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
CHECK_UTF16_STRING_PREFIX=1
|
||||
U_CHECK_UTF16_STRING=1
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
CHECK_UTF16_STRING_PREFIX=0
|
||||
U_CHECK_UTF16_STRING=0
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
if test "$CHECK_UTF16_STRING_PREFIX" = 0; then
|
||||
if test "$U_CHECK_UTF16_STRING" = 0; then
|
||||
CFLAGS="${OLD_CFLAGS}"
|
||||
CXXFLAGS="${OLD_CXXFLAGS}"
|
||||
else
|
||||
@ -7619,17 +7619,11 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
;;
|
||||
*-*-solaris*)
|
||||
if test "$ac_cv_c_compiler_gnu" = no; then
|
||||
OLD_CFLAGS="${CFLAGS}"
|
||||
OLD_CXXFLAGS="${CXXFLAGS}"
|
||||
CFLAGS="${CFLAGS} -xustr=ascii_utf16_ushort"
|
||||
CXXFLAGS="${CXXFLAGS} -xustr=ascii_utf16_ushort"
|
||||
|
||||
|
||||
ac_ext=cc
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
@ -7653,7 +7647,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_cxx_werror_flag"
|
||||
{ ac_try='test -z "$ac_c_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
@ -7666,25 +7660,27 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
CHECK_UTF16_STRING_PREFIX=1
|
||||
U_CHECK_UTF16_STRING=1
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
CHECK_UTF16_STRING_PREFIX=0
|
||||
U_CHECK_UTF16_STRING=0
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
CHECK_UTF16_STRING_PREFIX=0
|
||||
if test "$CHECK_UTF16_STRING_PREFIX" = 0; then
|
||||
if test "$U_CHECK_UTF16_STRING" = 0; then
|
||||
CFLAGS="${OLD_CFLAGS}"
|
||||
CXXFLAGS="${OLD_CXXFLAGS}"
|
||||
else
|
||||
CHECK_UTF16_STRING_RESULT="-xustr=ascii_utf16_ushort"
|
||||
|
||||
# Since we can't detect the availability of this UTF-16 syntax at compile time,
|
||||
# we depend on configure telling us that we can use it.
|
||||
# Since we can't ensure ICU users use -xustr=ascii_utf16_ushort,
|
||||
# we only use this macro within ICU.
|
||||
# If an ICU user uses icu-config, this feature will be enabled.
|
||||
CPPFLAGS="${CPPFLAGS} -DU_CHECK_UTF16_STRING=1"
|
||||
U_CHECK_UTF16_STRING=0
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
@ -8656,7 +8652,7 @@ s,@HAVE_UINT64_T@,$HAVE_UINT64_T,;t t
|
||||
s,@U_HAVE_WCHAR_H@,$U_HAVE_WCHAR_H,;t t
|
||||
s,@U_HAVE_WCSCPY@,$U_HAVE_WCSCPY,;t t
|
||||
s,@U_SIZEOF_WCHAR_T@,$U_SIZEOF_WCHAR_T,;t t
|
||||
s,@CHECK_UTF16_STRING_PREFIX@,$CHECK_UTF16_STRING_PREFIX,;t t
|
||||
s,@U_CHECK_UTF16_STRING@,$U_CHECK_UTF16_STRING,;t t
|
||||
s,@EXTRAS_TRUE@,$EXTRAS_TRUE,;t t
|
||||
s,@ICUIO_TRUE@,$ICUIO_TRUE,;t t
|
||||
s,@LAYOUT_TRUE@,$LAYOUT_TRUE,;t t
|
||||
|
@ -804,7 +804,7 @@ fi
|
||||
AC_SUBST(U_SIZEOF_WCHAR_T)
|
||||
|
||||
AC_MSG_CHECKING([for UTF-16 string literal support])
|
||||
CHECK_UTF16_STRING_PREFIX=1
|
||||
U_CHECK_UTF16_STRING=1
|
||||
CHECK_UTF16_STRING_RESULT="unknown"
|
||||
case "${host}" in
|
||||
*-*-aix*|powerpc64-*-linux*)
|
||||
@ -814,8 +814,8 @@ case "${host}" in
|
||||
CFLAGS="${CFLAGS} -qutf"
|
||||
CXXFLAGS="${CXXFLAGS} -qutf"
|
||||
AC_TRY_COMPILE([const unsigned short hello[] = u"hello";],[],
|
||||
[CHECK_UTF16_STRING_PREFIX=1],[CHECK_UTF16_STRING_PREFIX=0])
|
||||
if test "$CHECK_UTF16_STRING_PREFIX" = 0; then
|
||||
[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
|
||||
if test "$U_CHECK_UTF16_STRING" = 0; then
|
||||
CFLAGS="${OLD_CFLAGS}"
|
||||
CXXFLAGS="${OLD_CXXFLAGS}"
|
||||
else
|
||||
@ -825,21 +825,25 @@ case "${host}" in
|
||||
;;
|
||||
*-*-solaris*)
|
||||
if test "$ac_cv_prog_gcc" = no; then
|
||||
OLD_CFLAGS="${CFLAGS}"
|
||||
OLD_CXXFLAGS="${CXXFLAGS}"
|
||||
CFLAGS="${CFLAGS} -xustr=ascii_utf16_ushort"
|
||||
CXXFLAGS="${CXXFLAGS} -xustr=ascii_utf16_ushort"
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
dnl The C compiler does not support UTF-16 literals, but the C++ can support it.
|
||||
AC_TRY_COMPILE([const unsigned short hello[] = U"hello";],[],
|
||||
[CHECK_UTF16_STRING_PREFIX=1],[CHECK_UTF16_STRING_PREFIX=0])
|
||||
AC_LANG_RESTORE
|
||||
dnl TODO We can't reliably depend on users using -xustr=ascii_utf16_ushort to use ICU macros.
|
||||
dnl Remove the following line when that assumption changes.
|
||||
CHECK_UTF16_STRING_PREFIX=0
|
||||
if test "$CHECK_UTF16_STRING_PREFIX" = 0; then
|
||||
[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
|
||||
if test "$U_CHECK_UTF16_STRING" = 0; then
|
||||
CFLAGS="${OLD_CFLAGS}"
|
||||
CXXFLAGS="${OLD_CXXFLAGS}"
|
||||
else
|
||||
CHECK_UTF16_STRING_RESULT="-xustr=ascii_utf16_ushort"
|
||||
|
||||
# Since we can't detect the availability of this UTF-16 syntax at compile time,
|
||||
# we depend on configure telling us that we can use it.
|
||||
# Since we can't ensure ICU users use -xustr=ascii_utf16_ushort,
|
||||
# we only use this macro within ICU.
|
||||
# If an ICU user uses icu-config, this feature will be enabled.
|
||||
CPPFLAGS="${CPPFLAGS} -DU_CHECK_UTF16_STRING=1"
|
||||
U_CHECK_UTF16_STRING=0
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
@ -857,7 +861,7 @@ case "${host}" in
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT($CHECK_UTF16_STRING_RESULT)
|
||||
AC_SUBST(CHECK_UTF16_STRING_PREFIX)
|
||||
AC_SUBST(U_CHECK_UTF16_STRING)
|
||||
|
||||
dnl Enable/disable extras
|
||||
AC_ARG_ENABLE(extras,
|
||||
|
Loading…
Reference in New Issue
Block a user