diff --git a/icu4c/source/common/icucfg.h.in b/icu4c/source/common/icucfg.h.in index b8b501c558e..59ed2744977 100644 --- a/icu4c/source/common/icucfg.h.in +++ b/icu4c/source/common/icucfg.h.in @@ -1,16 +1,14 @@ -/* -******************************************************************************* -* -* Copyright (C) 1999, International Business Machines -* Corporation and others. All Rights Reserved. -* -******************************************************************************* -*/ /* common/icucfg.h.in. Generated automatically from configure.in by autoheader. */ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Copyright (c) 1999-2000, International Business Machines Corporation and + others. All Rights Reserved. */ /* Define to signed char if not in */ #undef int8_t @@ -32,9 +30,21 @@ /* Define to signed char if not in */ #undef bool_t +/* The number of bytes in a wchar_t. */ +#undef SIZEOF_WCHAR_T + /* Define if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define if you have the cma library (-lcma). */ +#undef HAVE_LIBCMA + +/* Define if you have the dl library (-ldl). */ +#undef HAVE_LIBDL + +/* Define if you have the dld library (-ldld). */ +#undef HAVE_LIBDLD + /* Define if you have the m library (-lm). */ #undef HAVE_LIBM @@ -43,3 +53,6 @@ /* Define if you have the pthreads library (-lpthreads). */ #undef HAVE_LIBPTHREADS + +/* Define if you have the wcs library (-lwcs). */ +#undef HAVE_LIBWCS diff --git a/icu4c/source/common/unicode/platform.h.in b/icu4c/source/common/unicode/platform.h.in index 126e6a98264..cb0a9bd7985 100644 --- a/icu4c/source/common/unicode/platform.h.in +++ b/icu4c/source/common/unicode/platform.h.in @@ -113,12 +113,14 @@ typedef unsigned short uint16_t; #ifdef OS390 # define U_CHARSET_FAMILY 1 -# define U_SIZEOF_WCHAR_T 2 #endif -#ifdef AIX -# define U_SIZEOF_WCHAR_T 2 -#endif +/*===========================================================================*/ +/* Information about wchar support */ +/*===========================================================================*/ + +#define U_HAVE_WCHAR_H @U_HAVE_WCHAR_H@ +#define U_SIZEOF_WCHAR_T @U_SIZEOF_WCHAR_T@ /*===========================================================================*/ /* Symbol import-export control */ diff --git a/icu4c/source/configure b/icu4c/source/configure index 73992c84168..5c8f98321b0 100755 --- a/icu4c/source/configure +++ b/icu4c/source/configure @@ -1093,8 +1093,6 @@ case "${host}" in *-*-solaris*) if test "$ac_cv_prog_gcc" = yes; then icu_cv_host_frag=$srcdir/config/mh-solaris-gcc - elif test "$host_cpu" = sparcv9; then - icu_cv_host_frag=$srcdir/config/mh-solaris-sparcv9 else icu_cv_host_frag=$srcdir/config/mh-solaris fi ;; @@ -2114,13 +2112,108 @@ fi + +ac_safe=`echo "wchar.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for wchar.h""... $ac_c" 1>&6 +echo "configure:2119: checking for wchar.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + +if test "$ac_cv_header_wchar_h" = no +then + U_HAVE_WCHAR_H=0 +else + cat >> confdefs.h <<\EOF +#define HAVE_WCHAR_H 1 +EOF + + U_HAVE_WCHAR_H=1 +fi + + +ac_default_sizeof_wchar_t=4 +echo $ac_n "checking size of wchar_t""... $ac_c" 1>&6 +echo "configure:2164: checking size of wchar_t" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_wchar_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_sizeof_wchar_t=$ac_default_sizeof_wchar_t +else + cat > conftest.$ac_ext < +#endif +#if HAVE_WCHAR_H +#include +#endif +#include +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(wchar_t)); + exit(0); +} +EOF +if { (eval echo configure:2189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_wchar_t=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_wchar_t=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_wchar_t" 1>&6 +cat >> confdefs.h <&6 -echo "configure:2117: checking for ANSI C header files" >&5 +echo "configure:2212: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2128,7 +2221,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2145,7 +2238,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2163,7 +2256,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2184,7 +2277,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2195,7 +2288,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2219,12 +2312,12 @@ EOF fi echo $ac_n "checking for int8_t""... $ac_c" 1>&6 -echo "configure:2221: checking for int8_t" >&5 +echo "configure:2316: checking for int8_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int8_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2252,12 +2345,12 @@ EOF fi echo $ac_n "checking for uint8_t""... $ac_c" 1>&6 -echo "configure:2254: checking for uint8_t" >&5 +echo "configure:2349: checking for uint8_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_uint8_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2285,12 +2378,12 @@ EOF fi echo $ac_n "checking for int16_t""... $ac_c" 1>&6 -echo "configure:2287: checking for int16_t" >&5 +echo "configure:2382: checking for int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2318,12 +2411,12 @@ EOF fi echo $ac_n "checking for uint16_t""... $ac_c" 1>&6 -echo "configure:2320: checking for uint16_t" >&5 +echo "configure:2415: checking for uint16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_uint16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2351,12 +2444,12 @@ EOF fi echo $ac_n "checking for int32_t""... $ac_c" 1>&6 -echo "configure:2353: checking for int32_t" >&5 +echo "configure:2448: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2384,12 +2477,12 @@ EOF fi echo $ac_n "checking for uint32_t""... $ac_c" 1>&6 -echo "configure:2386: checking for uint32_t" >&5 +echo "configure:2481: checking for uint32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_uint32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2417,12 +2510,12 @@ EOF fi echo $ac_n "checking for bool_t""... $ac_c" 1>&6 -echo "configure:2419: checking for bool_t" >&5 +echo "configure:2514: checking for bool_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_bool_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2769,7 +2862,7 @@ ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile \ - common/Makefile common/unicode/platform.h config/Makefile i18n/Makefile \ + common/Makefile config/Makefile i18n/Makefile \ extra/Makefile extra/ustdio/Makefile \ tools/Makefile tools/ctestfw/Makefile tools/makeconv/Makefile \ tools/genrb/Makefile tools/gencol/Makefile \ @@ -2778,7 +2871,8 @@ trap 'rm -fr `echo "Makefile \ test/Makefile test/intltest/Makefile test/cintltst/Makefile \ test/ieeetest/Makefile \ samples/Makefile samples/date/Makefile samples/cal/Makefile \ - samples/XMLConverter/Makefile common/icucfg.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 + samples/XMLConverter/Makefile \ + common/unicode/platform.h common/icucfg.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/icu4c/source/configure.in b/icu4c/source/configure.in index cde7e243a32..ceaff95d39e 100644 --- a/icu4c/source/configure.in +++ b/icu4c/source/configure.in @@ -191,6 +191,57 @@ U_IS_BIG_ENDIAN=1 fi AC_SUBST(U_IS_BIG_ENDIAN) +dnl Define a sizeof checking macro that is a bit better than autoconf's +dnl builtin (and heavily based on it, of course). The new macro is +dnl AC_DO_CHECK_SIZEOF(TYPE [, CROSS_SIZE [, INCLUDES]) +AC_DEFUN(AC_DO_CHECK_SIZEOF, +[changequote(<<, >>)dnl +dnl The name to #define. +define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl +dnl The cache variable name. +define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl +changequote([, ])dnl +AC_MSG_CHECKING(size of $1) +AC_CACHE_VAL(AC_CV_NAME, +[AC_TRY_RUN($3 +[#include +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof($1)); + exit(0); +}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl +AC_MSG_RESULT($AC_CV_NAME) +AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) +undefine([AC_TYPE_NAME])dnl +undefine([AC_CV_NAME])dnl +]) + +dnl Do various wchar_t related checks +AC_CHECK_HEADER(wchar.h) +if test "$ac_cv_header_wchar_h" = no +then + U_HAVE_WCHAR_H=0 +else + AC_DEFINE(HAVE_WCHAR_H) + U_HAVE_WCHAR_H=1 +fi +AC_SUBST(U_HAVE_WCHAR_H) + +ac_default_sizeof_wchar_t=4 +AC_DO_CHECK_SIZEOF(wchar_t,$ac_default_sizeof_wchar_t,[ +#if STDC_HEADERS +#include +#endif +#if HAVE_WCHAR_H +#include +#endif]) +dnl We could set ac_cv_sizeof_wchar_t to the default if the check returned +dnl 0 (unknown) but we'd rather do it in the headers, so we know we had no +dnl clue at configure time. +U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t +AC_SUBST(U_SIZEOF_WCHAR_T) dnl Checks for typedefs AC_CHECK_TYPE(int8_t,signed char) @@ -385,7 +436,7 @@ fi dnl output the Makefiles AC_OUTPUT([Makefile \ - common/Makefile common/unicode/platform.h config/Makefile i18n/Makefile \ + common/Makefile config/Makefile i18n/Makefile \ extra/Makefile extra/ustdio/Makefile \ tools/Makefile tools/ctestfw/Makefile tools/makeconv/Makefile \ tools/genrb/Makefile tools/gencol/Makefile \ @@ -394,7 +445,8 @@ AC_OUTPUT([Makefile \ test/Makefile test/intltest/Makefile test/cintltst/Makefile \ test/ieeetest/Makefile \ samples/Makefile samples/date/Makefile samples/cal/Makefile \ - samples/XMLConverter/Makefile]) + samples/XMLConverter/Makefile \ + common/unicode/platform.h]) dnl create the data directory