From 981fc8a22e9143fc1031d5bd6aa58d24562db29b Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 23 Nov 1999 04:49:35 +0000 Subject: [PATCH] ICU-157 posix support for udata.. linux dll support.. posix should work with mmapped files OK X-SVN-Rev: 235 --- icu4c/source/Makefile.in | 6 +- icu4c/source/common/Makefile.in | 13 +- icu4c/source/common/putil.c | 22 +- icu4c/source/common/udata.c | 6 +- icu4c/source/configure | 265 +++++++++++++++++------- icu4c/source/configure.in | 20 +- icu4c/source/test/cintltst/Makefile.in | 9 +- icu4c/source/test/cintltst/cloctst.c | 3 +- icu4c/source/test/cintltst/cucdtst.c | 8 + icu4c/source/test/intltest/Makefile.in | 2 +- icu4c/source/tools/Makefile.in | 78 ++++++- icu4c/source/tools/genccode/Makefile.in | 110 ++++++++++ icu4c/source/tools/genccode/genccode.c | 2 +- icu4c/source/tools/gencmn/Makefile.in | 109 ++++++++++ icu4c/source/tools/gencmn/gencmn.c | 4 +- 15 files changed, 558 insertions(+), 99 deletions(-) create mode 100644 icu4c/source/tools/genccode/Makefile.in create mode 100644 icu4c/source/tools/gencmn/Makefile.in diff --git a/icu4c/source/Makefile.in b/icu4c/source/Makefile.in index eb0644ac82d..0b767c020d2 100644 --- a/icu4c/source/Makefile.in +++ b/icu4c/source/Makefile.in @@ -36,6 +36,7 @@ AUTOCONF = @AUTOCONF@ ## Pacakge information PACKAGE = @PACKAGE@ VERSION = @VERSION@ +UNICODE_VERSION = @UNICODE_VERSION@ ## Optional directory setup @EXTRAS_TRUE@EXTRA = extra @@ -52,10 +53,10 @@ DOCDIRS = common i18n SUBDIRS = common i18n $(EXTRA) tools $(TEST) $(SAMPLE) ## Extra files to install -EXTRA_DATA = convrtrs.txt UnicodeData-3.0.0.txt +EXTRA_DATA = convrtrs.txt UnicodeData-$(UNICODE_VERSION).txt ## List of phony targets -.PHONY : all all-local all-recursive install install-local \ +.PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls \ install-recursive clean clean-local clean-recursive distclean \ distclean-local distclean-recursive doc dist dist-local dist-recursive \ check check-local check-recursive @@ -91,6 +92,7 @@ all-recursive install-recursive clean-recursive distclean-recursive dist-recursi all-local: configure + install-local: @for file in $(EXTRA_DATA); do \ echo $(INSTALL_DATA) $(top_builddir)/../data/$$file $(pkgdatadir)/$(VERSION)/$$file; \ diff --git a/icu4c/source/common/Makefile.in b/icu4c/source/common/Makefile.in index 6c12fb5506e..e4fc7f4c7f9 100644 --- a/icu4c/source/common/Makefile.in +++ b/icu4c/source/common/Makefile.in @@ -47,18 +47,27 @@ CLEANFILES = *~ TARGET = libicu-uc.$(SO) DEFS = @DEFS@ -CPPFLAGS = @CPPFLAGS@ -DICU_DATA_DIR=\"$(pkgdatadir)/$(VERSION)/\" +CPPFLAGS = @CPPFLAGS@ -DICU_DATA_DIR=\"$(pkgdatadir)/$(VERSION)/\" -DUDATA_SO_SUFFIX=\".$(SO)\" -DU_COMMON_LIBNAME=\"$(TARGET)\" CFLAGS = @CFLAGS@ CXXFLAGS = @CXXFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ +### use the "--enable-mapped=" option to configure, to get mapped file behavior. +# the case where '--enable-mapped=yes' +@USE_MAPPED_TRUE@CPPFLAGS += -DUDATA_MAP + +# the case where '--enable-mapped=no' (DEFAULT) +@USE_MAPPED_FALSE@CPPFLAGS += -DUDATA_DLL +### + + OBJECTS = chariter.o umutex.o compdata.o compitr.o convert.o \ cpputils.o cstring.o dcmpdata.o digitlst.o filestrm.o locid.o locmap.o \ mutex.o normlzr.o putil.o rbcache.o resbund.o schriter.o scsu.o \ uchar.o uchriter.o ucmp8.o ucmp16.o ucmp32.o ucnv.o ucnv_bld.o \ ucnv_cnv.o ucnv_err.o ucnv_io.o uhash.o uloc.o unicode.o unistr.o \ -ures.o ustring.o rbread.o rbdata.o ubidi.o ubidiln.o bidi.o uvector.o +ures.o ustring.o rbread.o rbdata.o ubidi.o ubidiln.o bidi.o uvector.o udata.o unames.o DEPS = $(OBJECTS:.o=.d) diff --git a/icu4c/source/common/putil.c b/icu4c/source/common/putil.c index b81dcb85eba..0427e32c002 100644 --- a/icu4c/source/common/putil.c +++ b/icu4c/source/common/putil.c @@ -776,7 +776,7 @@ getLibraryPath(char *path, int size) { # elif defined(OS400) # elif defined(XP_MAC) # elif defined(SOLARIS) - void *handle=dlopen("libicuuc.so", RTLD_LAZY); + void *handle=dlopen(U_COMMON_LIBNAME, RTLD_LAZY); /* "libicu-uc.so" */ if(handle!=NULL) { Link_map *p=NULL; char *s; @@ -787,7 +787,7 @@ getLibraryPath(char *path, int size) { if(rc>=0) { /* search for the list item for the library itself */ while(p!=NULL) { - s=icu_strstr(p->l_name, "libicuuc.so"); + s=icu_strstr(p->l_name, U_COMMON_LIBNAME); /* "libicu-uc.so" */ if(s!=NULL) { if(s>p->l_name) { /* copy the path, without the basename and the last separator */ @@ -809,7 +809,7 @@ getLibraryPath(char *path, int size) { } # elif defined(LINUX) # elif defined(AIX) - void *handle=load("libicuuc.a", L_LIBPATH_EXEC, "."); + void *handle=load(U_COMMON_LIBNAME, L_LIBPATH_EXEC, "."); /* "libicu-uc.a" */ if(handle!=NULL) { uint8_t buffer[4096]; struct ld_info *p=NULL; @@ -828,7 +828,7 @@ getLibraryPath(char *path, int size) { } p=(struct ld_info *)((uint8_t *)p+p->ldinfo_next); - s=icu_strstr(p->ldinfo_filename, "libicuuc.a"); + s=icu_strstr(p->ldinfo_filename, U_COMMON_LIBNAME); /* "libicuuc.a" */ if(s!=NULL) { if(s>p->ldinfo_filename) { /* copy the path, without the basename and the last separator */ @@ -861,7 +861,7 @@ getLibraryPath(char *path, int size) { break; } - s=icu_strstr(p->filename, "libicuuc.sl"); + s=icu_strstr(p->filename, U_COMMON_LIBNAME); if(s!=NULL) { if(s>p->l_name) { /* copy the path, without the basename and the last separator */ @@ -971,6 +971,10 @@ findLibraryPath(char *path, int size) { /* define a path for fallbacks */ #define FALLBACK_PATH U_FILE_SEP_STRING "share" U_FILE_SEP_STRING "icu" U_FILE_SEP_STRING ICU_VERSION U_FILE_SEP_STRING +/* #include */ +/* #include */ + + U_CAPI const char * U_EXPORT2 u_getDataDirectory(void) { /* if we have the directory, then return it immediately */ @@ -983,6 +987,14 @@ u_getDataDirectory(void) { # if !defined(OS400) && !defined(XP_MAC) /* first try to get the environment variable */ path=getenv("ICU_DATA"); +/* fprintf(stderr, " ******** ICU_DATA=%s ********** \n", path); */ +/* { */ +/* int i; */ +/* fprintf(stderr, "E=%08X\n", __environ); */ +/* if(__environ) */ +/* for(i=0;__environ[i] && __environ[i][0];i++) */ +/* puts(__environ[i]); */ +/* } */ # endif # ifdef WIN32 diff --git a/icu4c/source/common/udata.c b/icu4c/source/common/udata.c index 5061faeaf5b..0f5ae983300 100644 --- a/icu4c/source/common/udata.c +++ b/icu4c/source/common/udata.c @@ -224,7 +224,8 @@ typedef struct { #include #endif -# if defined(UDATA_DLL) /* POSIX dll implementation ----------------------- */ +/* add more to this list as more platform's dll support is written */ +# if defined(UDATA_DLL) && (defined(LINUX)||defined(SOLARIS)) /* POSIX dll implementation ----------------------- */ struct UDataMemory { void *lib; @@ -294,6 +295,7 @@ LOAD_LIBRARY(const char *path, const char *basename, bool_t isCommon) { const char *dataDir; struct stat mystat; void *data; + UErrorCode errorCode = U_ZERO_ERROR; /* determine the length of the file */ if(stat(path, &mystat)) @@ -338,7 +340,7 @@ LOAD_LIBRARY(const char *path, const char *basename, bool_t isCommon) { pData->p =(MappedData *)data; /* is it acceptable? */ - if(NULL=getChoice(pData, NULL, DATA_TYPE, COMMON_DATA_NAME, isCommonDataAcceptable, NULL, &errorCode)) { + if(NULL==getChoice(pData, NULL, DATA_TYPE, COMMON_DATA_NAME, isCommonDataAcceptable, NULL, &errorCode)) { udata_close(pData); return NULL; } diff --git a/icu4c/source/configure b/icu4c/source/configure index 876afe63be2..195aa4731ae 100755 --- a/icu4c/source/configure +++ b/icu4c/source/configure @@ -13,6 +13,8 @@ ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --enable-extras build ICU extras [default=yes]" +ac_help="$ac_help + --enable-mapped try to use memory-mapped files (instead of DLLs) when possible [default=no]" ac_help="$ac_help --enable-tests build ICU tests [default=yes]" ac_help="$ac_help @@ -532,11 +534,13 @@ PACKAGE="icu" VERSION="1.3.1" +UNICODE_VERSION="3.0.0" + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:540: checking for $ac_word" >&5 +echo "configure:544: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -566,7 +570,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:570: checking for $ac_word" >&5 +echo "configure:574: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -617,7 +621,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:621: checking for $ac_word" >&5 +echo "configure:625: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -649,7 +653,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:653: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:657: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -660,12 +664,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 664 "configure" +#line 668 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -691,12 +695,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:695: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:699: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:700: checking whether we are using GNU C" >&5 +echo "configure:704: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -705,7 +709,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -724,7 +728,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:728: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:732: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -760,7 +764,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:764: checking for $ac_word" >&5 +echo "configure:768: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -792,7 +796,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:796: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:800: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -803,12 +807,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 807 "configure" +#line 811 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -834,12 +838,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:838: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:842: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:843: checking whether we are using GNU C++" >&5 +echo "configure:847: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -848,7 +852,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -867,7 +871,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:871: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:875: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -929,7 +933,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:933: checking for a BSD compatible install" >&5 +echo "configure:937: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -984,7 +988,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "autoconf", so it can be a program name with args. set dummy autoconf; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:988: checking for $ac_word" >&5 +echo "configure:992: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AUTOCONF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1011,6 +1015,36 @@ else echo "$ac_t""no" 1>&6 fi +# Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1022: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_STRIP="strip" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP="true" +fi +fi +STRIP="$ac_cv_prog_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + # Make sure we can run config.sub. @@ -1019,7 +1053,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1023: checking host system type" >&5 +echo "configure:1057: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1041,7 +1075,7 @@ echo "$ac_t""$host" 1>&6 echo $ac_n "checking which Makefile fragment to use""... $ac_c" 1>&6 -echo "configure:1045: checking which Makefile fragment to use" >&5 +echo "configure:1079: checking which Makefile fragment to use" >&5 if eval "test \"`echo '$''{'icu_cv_host_frag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1072,7 +1106,7 @@ echo "$ac_t""$icu_cv_host_frag" 1>&6 case "${host}" in *-*-hpux*) echo $ac_n "checking for floor in -lm""... $ac_c" 1>&6 -echo "configure:1076: checking for floor in -lm" >&5 +echo "configure:1110: checking for floor in -lm" >&5 ac_lib_var=`echo m'_'floor | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1080,7 +1114,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1112,7 +1146,7 @@ else fi ;; *) echo $ac_n "checking for floor in -lm""... $ac_c" 1>&6 -echo "configure:1116: checking for floor in -lm" >&5 +echo "configure:1150: checking for floor in -lm" >&5 ac_lib_var=`echo m'_'floor | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1120,7 +1154,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1163,7 +1197,7 @@ esac echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:1167: checking for pthread_create in -lpthread" >&5 +echo "configure:1201: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1171,7 +1205,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1211,7 +1245,7 @@ fi if test $ac_cv_lib_pthread_pthread_create = no; then echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:1215: checking for pthread_create in -lpthreads" >&5 +echo "configure:1249: checking for pthread_create in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1219,7 +1253,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1260,7 +1294,7 @@ fi fi if test $ac_cv_lib_pthread_pthread_create = no; then echo $ac_n "checking for pthread_create in -lcma""... $ac_c" 1>&6 -echo "configure:1264: checking for pthread_create in -lcma" >&5 +echo "configure:1298: checking for pthread_create in -lcma" >&5 ac_lib_var=`echo cma'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1268,7 +1302,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcma $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1308,8 +1342,57 @@ fi fi +#only LINUX for now +echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 +echo "configure:1348: checking for dlopen in -ldl" >&5 +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1313: checking how to run the C preprocessor" >&5 +echo "configure:1396: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1324,13 +1407,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1417: \"$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 : @@ -1341,13 +1424,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1434: \"$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 : @@ -1358,13 +1441,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1368: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1451: \"$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 : @@ -1392,17 +1475,17 @@ for ac_hdr in inttypes.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1396: checking for $ac_hdr" >&5 +echo "configure:1479: checking for $ac_hdr" >&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:1406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1489: \"$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* @@ -1436,14 +1519,14 @@ fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1440: checking whether byte ordering is bigendian" >&5 +echo "configure:1523: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1454,11 +1537,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1469,7 +1552,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1489,7 +1572,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1534,12 +1617,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1538: checking for ANSI C header files" >&5 +echo "configure:1621: 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 @@ -1547,7 +1630,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1634: \"$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* @@ -1564,7 +1647,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 @@ -1582,7 +1665,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 @@ -1603,7 +1686,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1614,7 +1697,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1638,12 +1721,12 @@ EOF fi echo $ac_n "checking for int8_t""... $ac_c" 1>&6 -echo "configure:1642: checking for int8_t" >&5 +echo "configure:1725: 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 @@ -1671,12 +1754,12 @@ EOF fi echo $ac_n "checking for uint8_t""... $ac_c" 1>&6 -echo "configure:1675: checking for uint8_t" >&5 +echo "configure:1758: 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 @@ -1704,12 +1787,12 @@ EOF fi echo $ac_n "checking for int16_t""... $ac_c" 1>&6 -echo "configure:1708: checking for int16_t" >&5 +echo "configure:1791: 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 @@ -1737,12 +1820,12 @@ EOF fi echo $ac_n "checking for uint16_t""... $ac_c" 1>&6 -echo "configure:1741: checking for uint16_t" >&5 +echo "configure:1824: 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 @@ -1770,12 +1853,12 @@ EOF fi echo $ac_n "checking for int32_t""... $ac_c" 1>&6 -echo "configure:1774: checking for int32_t" >&5 +echo "configure:1857: 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 @@ -1803,12 +1886,12 @@ EOF fi echo $ac_n "checking for uint32_t""... $ac_c" 1>&6 -echo "configure:1807: checking for uint32_t" >&5 +echo "configure:1890: 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 @@ -1836,12 +1919,12 @@ EOF fi echo $ac_n "checking for bool_t""... $ac_c" 1>&6 -echo "configure:1840: checking for bool_t" >&5 +echo "configure:1923: 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 @@ -1940,6 +2023,28 @@ else EXTRAS_FALSE= fi +# Check whether --enable-mapped or --disable-mapped was given. +if test "${enable_mapped+set}" = set; then + enableval="$enable_mapped" + case "${enableval}" in + yes) mapped=true ;; + no) mapped=false ;; + *) { echo "configure: error: bad value ${enableval} for --enable-mapped" 1>&2; exit 1; } ;; + esac +else + mapped=false +fi + + + +if test "$mapped" = true; then + USE_MAPPED_TRUE= + USE_MAPPED_FALSE='#' +else + USE_MAPPED_TRUE='#' + USE_MAPPED_FALSE= +fi + # Check whether --enable-tests or --disable-tests was given. if test "${enable_tests+set}" = set; then enableval="$enable_tests" @@ -2125,7 +2230,8 @@ trap 'rm -fr `echo "Makefile \ extra/Makefile extra/ustdio/Makefile \ tools/Makefile tools/ctestfw/Makefile tools/makeconv/Makefile \ tools/genrb/Makefile tools/gencol/Makefile \ - tools/rbdump/Makefile \ + tools/rbdump/Makefile tools/genccode/Makefile tools/gencmn/Makefile \ + tools/gennames/Makefile tools/toolutil/Makefile \ test/Makefile test/intltest/Makefile test/cintltst/Makefile \ test/ieeetest/Makefile \ samples/Makefile samples/date/Makefile samples/cal/Makefile \ @@ -2163,12 +2269,14 @@ s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g +s%@UNICODE_VERSION@%$UNICODE_VERSION%g s%@CC@%$CC%g s%@CXX@%$CXX%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@AUTOCONF@%$AUTOCONF%g +s%@STRIP@%$STRIP%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g @@ -2187,6 +2295,8 @@ s%@HAVE_UINT32_T@%$HAVE_UINT32_T%g s%@HAVE_BOOL_T@%$HAVE_BOOL_T%g s%@EXTRAS_TRUE@%$EXTRAS_TRUE%g s%@EXTRAS_FALSE@%$EXTRAS_FALSE%g +s%@USE_MAPPED_TRUE@%$USE_MAPPED_TRUE%g +s%@USE_MAPPED_FALSE@%$USE_MAPPED_FALSE%g s%@TESTS_TRUE@%$TESTS_TRUE%g s%@TESTS_FALSE@%$TESTS_FALSE%g s%@SAMPLES_TRUE@%$SAMPLES_TRUE%g @@ -2241,7 +2351,8 @@ CONFIG_FILES=\${CONFIG_FILES-"Makefile \ extra/Makefile extra/ustdio/Makefile \ tools/Makefile tools/ctestfw/Makefile tools/makeconv/Makefile \ tools/genrb/Makefile tools/gencol/Makefile \ - tools/rbdump/Makefile \ + tools/rbdump/Makefile tools/genccode/Makefile tools/gencmn/Makefile \ + tools/gennames/Makefile tools/toolutil/Makefile \ test/Makefile test/intltest/Makefile test/cintltst/Makefile \ test/ieeetest/Makefile \ samples/Makefile samples/date/Makefile samples/cal/Makefile \ diff --git a/icu4c/source/configure.in b/icu4c/source/configure.in index 7ed29cdd39f..3eccae29698 100644 --- a/icu4c/source/configure.in +++ b/icu4c/source/configure.in @@ -9,12 +9,15 @@ PACKAGE="icu" AC_SUBST(PACKAGE) VERSION="1.3.1" AC_SUBST(VERSION) +UNICODE_VERSION="3.0.0" +AC_SUBST(UNICODE_VERSION) dnl Checks for programs AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true) +AC_CHECK_PROG(STRIP, strip, strip, true) dnl Determine the host system and Makefile fragment AC_CANONICAL_HOST @@ -40,6 +43,9 @@ if test $ac_cv_lib_pthread_pthread_create = no; then AC_CHECK_LIB(cma, pthread_create) fi +#only LINUX for now +AC_CHECK_LIB(dl, dlopen) + dnl Checks for header files AC_CHECK_HEADERS(inttypes.h) if test $ac_cv_header_inttypes_h = no; then @@ -128,6 +134,17 @@ AC_ARG_ENABLE(extras, extras=true) ICU_CONDITIONAL(EXTRAS, test "$extras" = true) +dnl Enable/disable mapped files [default DLL] +AC_ARG_ENABLE(mapped, + [ --enable-mapped try to use memory-mapped files (instead of DLLs) when possible [default=no]], + [case "${enableval}" in + yes) mapped=true ;; + no) mapped=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-mapped) ;; + esac], + mapped=false) +ICU_CONDITIONAL(USE_MAPPED, test "$mapped" = true) + dnl Enable/disable tests AC_ARG_ENABLE(tests, [ --enable-tests build ICU tests [default=yes]], @@ -196,7 +213,8 @@ AC_OUTPUT([Makefile \ extra/Makefile extra/ustdio/Makefile \ tools/Makefile tools/ctestfw/Makefile tools/makeconv/Makefile \ tools/genrb/Makefile tools/gencol/Makefile \ - tools/rbdump/Makefile \ + tools/rbdump/Makefile tools/genccode/Makefile tools/gencmn/Makefile \ + tools/gennames/Makefile tools/toolutil/Makefile \ test/Makefile test/intltest/Makefile test/cintltst/Makefile \ test/ieeetest/Makefile \ samples/Makefile samples/date/Makefile samples/cal/Makefile \ diff --git a/icu4c/source/test/cintltst/Makefile.in b/icu4c/source/test/cintltst/Makefile.in index 8e80ee5bd5b..1b0196fd8e4 100644 --- a/icu4c/source/test/cintltst/Makefile.in +++ b/icu4c/source/test/cintltst/Makefile.in @@ -4,6 +4,9 @@ ## Shell to use SHELL = @SHELL@ +UNICODE_VERSION = @UNICODE_VERSION@ + + ## Install directory information srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -46,8 +49,12 @@ CLEANFILES = *~ ## Target information TARGET = cintltst + DEFS = @DEFS@ -CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/ctestfw + +# we define ICU_UNICODE_VERSION so we can test it +CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/ctestfw \ + -DICU_UNICODE_VERSION=\"$(UNICODE_VERSION)\" CFLAGS = @CFLAGS@ CXXFLAGS = @CXXFLAGS@ LDFLAGS = @LDFLAGS@ \ diff --git a/icu4c/source/test/cintltst/cloctst.c b/icu4c/source/test/cintltst/cloctst.c index 1e9493eb1bd..0d9c1523c53 100644 --- a/icu4c/source/test/cintltst/cloctst.c +++ b/icu4c/source/test/cintltst/cloctst.c @@ -307,6 +307,7 @@ void TestDataDirectory() UErrorCode err = U_ZERO_ERROR; const char path[40] ="d:\\icu\\source\\test\\intltest\\" ; /*give the required path */ + path[strlen(path)-1] =U_FILE_SEP_CHAR; /* c'mon.. at least end it with a valid sepchar for this platform! */ log_verbose("Testing getDataDirectory()\n"); temp = uloc_getDataDirectory(); @@ -326,7 +327,7 @@ void TestDataDirectory() if(strcmp(path, uloc_getDataDirectory())==0) log_verbose("setDataDirectory working fine\n"); else - log_err("Error in setDataDirectory. Directory not set correctly"); + log_err("Error in setDataDirectory. Directory not set correctly - came back as [%s], expected [%s]\n", uloc_getDataDirectory(), path); testValue2=uloc_getISO3Language("en_US"); log_verbose("second fetch of language retrieved %s \n", testValue2); diff --git a/icu4c/source/test/cintltst/cucdtst.c b/icu4c/source/test/cintltst/cucdtst.c index 500bca463de..9c3e6e928f4 100644 --- a/icu4c/source/test/cintltst/cucdtst.c +++ b/icu4c/source/test/cintltst/cucdtst.c @@ -358,6 +358,14 @@ void TestUnicodeData() { log_err("Testing u_getVersion() - expected %s got %s\n", expectString, u_getVersion()); } + +#if defined(ICU_UNICODE_VERSION) + /* test only happens where we have configure.in with UNICODE_VERSION - sanity check. */ + if(strcmp(expectVersion, ICU_UNICODE_VERSION)) + { + log_err("Testing configure.in's UNICODE_VERSION - expected %s got %s\n", expectVersion, ICU_UNICODE_VERSION); + } +#endif input = fopen(newPath, "r"); diff --git a/icu4c/source/test/intltest/Makefile.in b/icu4c/source/test/intltest/Makefile.in index b129b51d2e0..35d671d5cf9 100644 --- a/icu4c/source/test/intltest/Makefile.in +++ b/icu4c/source/test/intltest/Makefile.in @@ -63,7 +63,7 @@ loctest.o miscdtfm.o mnkytst.o msfmrgts.o nmfmapts.o nmfmtrt.o \ numfmtst.o numrgts.o pptest.o regcoll.o restest.o sdtfmtts.o tchcfmt.o \ tfsmalls.o tmsgfmt.o trcoll.o tscoll.o tsdate.o tsdcfmsy.o tsdtfmsy.o \ tsmthred.o tsmutex.o tsnmfmt.o tsputil.o tstnorm.o tzbdtest.o \ -tzregts.o tztest.o ucdtest.o usettest.o ustrtest.o transtst.o +tzregts.o tztest.o ucdtest.o usettest.o ustrtest.o transtst.o strtest.o DEPS = $(OBJECTS:.o=.d) diff --git a/icu4c/source/tools/Makefile.in b/icu4c/source/tools/Makefile.in index a24e3fd8a03..9dd9bd73b55 100644 --- a/icu4c/source/tools/Makefile.in +++ b/icu4c/source/tools/Makefile.in @@ -3,6 +3,7 @@ ## Shell to use SHELL = @SHELL@ +VERSION = @VERSION@ ## Install directory information srcdir = @srcdir@ @@ -10,6 +11,11 @@ top_srcdir = @top_srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/common + + +@host_frag@ + bindir = @bindir@ sbindir = @sbindir@ datadir = @datadir@ @@ -20,6 +26,9 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +ICUDATADIR=$(pkgdatadir)/$(VERSION) +SRCDATADIR=$(top_builddir)/../data/ + ## Build directory information top_builddir = .. subdir = tools @@ -32,6 +41,9 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ +## for cleaning up libraries +STRIP = @STRIP@ + ## Package information PACKAGE = @PACKAGE@ VERSION = @VERSION@ @@ -39,10 +51,11 @@ VERSION = @VERSION@ ## Files to remove for 'make clean' CLEANFILES = *~ -SUBDIRS = ctestfw makeconv genrb gencol rbdump +SUBDIRS = ctestfw makeconv genrb gencol rbdump \ +toolutil genccode gennames gencmn ## List of phony targets -.PHONY : all all-local all-recursive install install-local \ +.PHONY : all all-local all-recursive install install-local install-everything install-files install-dlls build-data build-cmnfile build-dll \ install-recursive clean clean-local clean-recursive distclean \ distclean-local distclean-recursive dist dist-local dist-recursive \ check check-local check-recursive @@ -76,9 +89,66 @@ all-recursive install-recursive clean-recursive distclean-recursive dist-recursi $(MAKE) "$$target-local" || exit 1; \ fi -all-local: +all-local: build-local + +DATAFILES=$(SRCDATADIR)/unames.dat +SRCDATAFILES=$(DATAFILES:.dat=_dat.c) +OBJDATAFILES=$(SRCDATAFILES:.c=.o) +COMMONFILE=$(SRCDATADIR)/icudata.dat +COMMONDLL=$(SRCDATADIR)/libicudata.$(SO) + +# the files to be installed -- the COMMON ones + any stragglers +UDATA_FILES=icudata.dat +UDATA_DLLS=libicudata.$(SO) + +build-local: build-data build-cmnfile build-dll + +# check for any other generated data here +install-data: $(DATAFILES) + +build-cmnfile: $(COMMONFILE) + +$(COMMONFILE): $(DATAFILES) + -rm -f $(COMMONFILE) + echo "$(DATAFILES)" > mkmap.tmp + ICU_DATA=$(SRCDATADIR) ./gencmn/gencmn 1000000 mkmap.tmp + +build-dll: $(COMMONDLL) + +%_dat.c: %.dat + ./genccode/genccode $< + +# strip is optional +$(COMMONDLL): $(OBJDATAFILES) + $(SHLIB.c) -o $@ $^ + -$(STRIP) $@ + -ls -l $@ + + +### use the "--enable-mapped=" option to configure, to get mapped file behavior. +# the case where '--enable-mapped=yes' - raw files [which can be mapped] +@USE_MAPPED_TRUE@install-udata: install-files + +# the case where '--enable-mapped=no' (DEFAULT) - DLL's [so's to you] +@USE_MAPPED_FALSE@install-udata: install-dlls +### + +install-local: build-local install-udata + +install-everything: install-files install-dlls + +install-files: + @for file in $(UDATA_FILES); do \ + echo $(INSTALL_DATA) $(top_builddir)/../data/$$file $(pkgdatadir)/$(VERSION)/$$file; \ + $(INSTALL_DATA) $(top_builddir)/../data/$$file $(pkgdatadir)/$(VERSION)/$$file; \ + done + +install-dlls: + @for file in $(UDATA_DLLS); do \ + echo $(INSTALL_DATA) $(top_builddir)/../data/$$file $(pkgdatadir)/$(VERSION)/$$file; \ + $(INSTALL_DATA) $(top_builddir)/../data/$$file $(pkgdatadir)/$(VERSION)/$$file; \ + done -install-local: dist-local: diff --git a/icu4c/source/tools/genccode/Makefile.in b/icu4c/source/tools/genccode/Makefile.in new file mode 100644 index 00000000000..8478db364ad --- /dev/null +++ b/icu4c/source/tools/genccode/Makefile.in @@ -0,0 +1,110 @@ +## Makefile.in for ICU - tools/genccode +## Steven R. Loomi + +## Shell to use +SHELL = @SHELL@ + +## Install directory information +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +datadir = @datadir@ +libdir = @libdir@ +includedir = @includedir@ + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +## Install program information +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +## Compiler/tools information +CC = @CC@ +CXX = @CXX@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +## Platform-specific setup +@host_frag@ + +## Build directory information +top_builddir = ../.. +subdir = tools/genccode + +## Extra files to remove for 'make clean' +CLEANFILES = *~ + +## Target information +TARGET = genccode + +DEFS = @DEFS@ +CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/common -I../toolutil +CFLAGS = @CFLAGS@ +CXXFLAGS = @CXXFLAGS@ +LDFLAGS = @LDFLAGS@ \ +$(LD_RPATH)$(LD_RPATH_PRE)$(libdir)@ld_rpath_suf@$(LD_RPATH_PRE)$(top_builddir)/common@ld_rpath_suf@$(LD_RPATH_PRE)$(top_builddir)/tools/toolutil +LIBS = $(LIBICU-UC) @LIBS@ @LIB_M@ -L$(top_builddir)/tools/toolutil -licu-toolutil + +OBJECTS = genccode.o + +DEPS = $(OBJECTS:.o=.d) + + +## List of phony targets +.PHONY : all all-local install install-local clean clean-local \ +distclean distclean-local target-clean-local dist dist-local check \ +check-local + +## Clear suffix list +.SUFFIXES : + +## List of standard targets +all: all-local +install: install-local +clean: clean-local +distclean : distclean-local +dist: dist-local +check: check-local + +all-local: $(TARGET) $(RES_FILES) $(TRANSLIT_RES) $(TEST_FILES) + +install-local: target-clean-local all-local + $(mkinstalldirs) $(sbindir) + $(INSTALL) $(TARGET) $(sbindir)/$(TARGET) + +dist-local: + +target-clean-local: + rm -f $(TARGET) + +clean-local: target-clean-local + test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + rm -f $(OBJECTS) + +distclean-local: clean-local + rm -f Makefile $(DEPS) $(RES_FILES) $(TEST_FILES) + +check-local: + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(TARGET) : $(OBJECTS) + $(LINK.c) -o $@ $^ $(LIBS) + +ifneq ($(MAKECMDGOALS),distclean) +-include $(DEPS) +endif + + + diff --git a/icu4c/source/tools/genccode/genccode.c b/icu4c/source/tools/genccode/genccode.c index 873a2bee0fb..86f47c9ed55 100644 --- a/icu4c/source/tools/genccode/genccode.c +++ b/icu4c/source/tools/genccode/genccode.c @@ -26,7 +26,7 @@ #include "cmemory.h" #include "cstring.h" #include "filestrm.h" -#include "../toolutil/toolutil.h" +#include "toolutil.h" static uint16_t column=0xffff; diff --git a/icu4c/source/tools/gencmn/Makefile.in b/icu4c/source/tools/gencmn/Makefile.in new file mode 100644 index 00000000000..6175809b8fe --- /dev/null +++ b/icu4c/source/tools/gencmn/Makefile.in @@ -0,0 +1,109 @@ +## Makefile.in for ICU - tools/gencmn +## Steven R. Loomi + +## Shell to use +SHELL = @SHELL@ + +## Install directory information +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +datadir = @datadir@ +libdir = @libdir@ +includedir = @includedir@ + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +## Install program information +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +## Compiler/tools information +CC = @CC@ +CXX = @CXX@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +## Platform-specific setup +@host_frag@ + +## Build directory information +top_builddir = ../.. +subdir = tools/gencmn + +## Extra files to remove for 'make clean' +CLEANFILES = *~ + +## Target information +TARGET = gencmn + +DEFS = @DEFS@ +CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/common -I../toolutil +CFLAGS = @CFLAGS@ +CXXFLAGS = @CXXFLAGS@ +LDFLAGS = @LDFLAGS@ \ +$(LD_RPATH)$(LD_RPATH_PRE)$(libdir)@ld_rpath_suf@$(LD_RPATH_PRE)$(top_builddir)/common@ld_rpath_suf@$(LD_RPATH_PRE)$(top_builddir)/tools/toolutil +LIBS = $(LIBICU-UC) @LIBS@ @LIB_M@ -L$(top_builddir)/tools/toolutil -licu-toolutil + +OBJECTS = gencmn.o + +DEPS = $(OBJECTS:.o=.d) + + +## List of phony targets +.PHONY : all all-local install install-local clean clean-local \ +distclean distclean-local target-clean-local dist dist-local check \ +check-local + +## Clear suffix list +.SUFFIXES : + +## List of standard targets +all: all-local +install: install-local +clean: clean-local +distclean : distclean-local +dist: dist-local +check: check-local + +all-local: $(TARGET) $(RES_FILES) $(TRANSLIT_RES) $(TEST_FILES) + +install-local: target-clean-local all-local + $(mkinstalldirs) $(sbindir) + $(INSTALL) $(TARGET) $(sbindir)/$(TARGET) + +dist-local: + +target-clean-local: + rm -f $(TARGET) + +clean-local: target-clean-local + test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + rm -f $(OBJECTS) + +distclean-local: clean-local + rm -f Makefile $(DEPS) $(RES_FILES) $(TEST_FILES) + +check-local: + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(TARGET) : $(OBJECTS) + $(LINK.c) -o $@ $^ $(LIBS) + +ifneq ($(MAKECMDGOALS),distclean) +-include $(DEPS) +endif + + diff --git a/icu4c/source/tools/gencmn/gencmn.c b/icu4c/source/tools/gencmn/gencmn.c index c6475dcfda0..e5935092754 100644 --- a/icu4c/source/tools/gencmn/gencmn.c +++ b/icu4c/source/tools/gencmn/gencmn.c @@ -26,8 +26,8 @@ #include "cmemory.h" #include "cstring.h" #include "filestrm.h" -#include "../toolutil/toolutil.h" -#include "../toolutil/unewdata.h" +#include "toolutil.h" +#include "unewdata.h" #define STRING_STORE_SIZE 100000 #define MAX_FILE_COUNT 2000