ICU-7583 checkin for source drop

X-SVN-Rev: 28764
This commit is contained in:
Steven R. Loomis 2010-10-06 15:13:14 +00:00
parent df4608dd59
commit 2d61714acc
9 changed files with 218 additions and 94 deletions

1
.gitattributes vendored
View File

@ -571,6 +571,7 @@ tools/multi/common/Makefile-multi.inc -text
tools/multi/j/Makefile-j.inc -text
tools/multi/proj/provider/Makefile.local-sample -text
tools/multi/proj/provider/icu-config.sed -text
tools/multi/proj/provider/readme.txt -text
tools/release/java/.classpath -text
tools/release/java/.project -text
tools/release/java/Makefile -text

1
.gitignore vendored
View File

@ -942,6 +942,7 @@ icu4j/tools/misc/out
tools/multi/packages/*.jar
tools/multi/packages/*.tgz
tools/multi/proj/chello/out
tools/multi/proj/provider/Makefile.local
tools/multi/proj/provider/out
tools/multi/tmp
tools/release/java/APIChangeReport*

View File

@ -23,9 +23,11 @@ INS=$(C_INS)
SRC=$(C_SRC)
ALLICUS=$(ICUVERS:%=$(BLD)/%/$(S_BLD)) $(ICUVERS:%=$(BLD)/r%/$(S_BLD))
IICUS=$(ICUVERS:%=$(INS)/%/$(S_INS)) $(ICUVERS:%=$(INS)/r%/$(S_INS))
RICUS=$(ICUVERS:%=$(INS)/r%/$(S_INS))
IICUS=$(ICUVERS:%=$(INS)/%/$(S_INS)) $(RICUS)
APRECIOUS=$(ICUVERS:%=$(BLD)/%/$(S_SRC)) $(ICUVERS:%=$(BLD)/%/$(S_BLD)) $(ICUVERS:%=$(INS)/%/$(S_INS)) $(ICUVERS:%=$(BLD)/r%/$(S_BLD)) $(ICUVERS:%=$(INS)/r%/$(S_INS))
APRECIOUS=$(ICUVERS:%=$(BLD)/%/$(S_SRC)) $(ICUVERS:%=$(BLD)/r%/$(S_SRC)) $(ICUVERS:%=$(BLD)/%/$(S_BLD)) $(ICUVERS:%=$(INS)/%/$(S_INS)) $(ICUVERS:%=$(BLD)/r%/$(S_BLD)) $(ICUVERS:%=$(INS)/r%/$(S_INS))
.PRECIOUS: $(APRECIOUS)
@ -97,3 +99,4 @@ all-icus: iicus
iicus: $(BLD) $(IICUS)
ricus: $(RICUS)

View File

@ -10,10 +10,12 @@ LIBPATH_VAR=LD_LIBRARY_PATH
PLUG_EXTRA_LDFLAGS=-fPIC
PBLD_EXTRA_FLAGS=-fPIC
GLUE_EXTRA_CFLAGS= -fPIC
PLUGLIB_SO=so
else
ifeq ($(UNAME),Darwin)
LIBPATH_VAR=DYLD_LIBRARY_PATH
PLUG_EXTRA_LDFLAGS=-exported_symbols_list glue/export.txt -dynamiclib -dynamic
PLUGLIB_SO=dylib
else
$(warning **********************************)
$(warning this script may not know how to handle your $(UNAME) system)
@ -21,6 +23,25 @@ endif
endif
PROVIDER=provider
LIBPROVIDER=lib$(PROVIDER).a
#libs: $(ICU_TARBALLS_VERS:%=$(OUT)/%/lib/$(LIBPROVIDER))
PLUGLIB=$(shell echo $(PROVIDER_TARGET) | tr '.' '_' )
PLUGLIB_MAJ=$(shell echo $(PROVIDER_TARGET) | cut -d. -f1-2 | tr -d '.' )
PLUGLIB_ICU_CONFIG=$(C_INS)/r$(PLUGLIB)/bin/icu-config
#PLUGLIB_SO=$(shell $(PLUGLIB_ICU_CONFIG) --so 2>/dev/null )
PLUGLIB_NAME=libicuprov.$(PLUGLIB_MAJ).$(PLUGLIB_SO)
#PLUGLIB_MAJ=$(echo $(PLUGLIB) | cut -d_ -f-1 | tr -d _ )
#GLOUT_ICU=$(ICU_TARBALLS_VERS:%=$(GLOUT)/%/$(OK))
PLUGLIB_AVAILABLE=$(shell echo $(PROVIDER_AVAILABLE) | tr '.' '_')
PLUGLIB_AVAILABLE_DATA=$(PLUGLIB_AVAILABLE:%=$(BUILD)/%/data/out/tmp/*.o)
PLUGLIB_AVAILABLE_STATICS=$(PLUGLIB_AVAILABLE:%=$(BUILD)/%/[ci]*/*.ao)
PLUGLIB_OUTLIBS=$(PLUGLIB:%=$(OUT)/%/lib/$(PLUGLIB_NAME))
## configuration
# Absolute path to this dir.
# dir holding ICUs to be built
@ -55,16 +76,17 @@ MOPTS=
# directories that need to be built
ALLDIRS=$(INST) $(BUILD) $(SRC) $(GLOUT) $(OUT)
# The 'ok' flag file for installations
INST_ICU=$(ICU_TARBALLS_VERS:%=$(INST)/%/$(OK))
BUILD_ICU=$(ICU_TARBALLS_VERS:%=$(BUILD)/%/$(OK))
GLOUT_ICU=$(ICU_TARBALLS_VERS:%=$(GLOUT)/%/$(OK))
SRC_ICU=$(ICU_TARBALLS_VERS:%=$(SRC)/%/$(OK))
INST_ICU=$(PLUGLIB_AVAILABLE:%=$(INST)/%/$(OK))
BUILD_ICU=$(PLUGLIB_AVAILABLE:%=$(BUILD)/%/$(OK))
# this has to do with the pluglib
GLOUT_ICU=$(PLUGLIB:%=$(GLOUT)/%/obj-$(OK))
#SRC_ICU=$(ICU_TARBALLS_VERS:%=$(SRC)/%/$(OK))
# gluren.h files for each version
GLUREN_ICU=$(ICU_TARBALLS_VERS:%=$(BUILD)/%/$(GLUREN_H))
GLUREN_ICU=$(PLUGLIB_AVAILABLE:%=$(BUILD)/%/$(GLUREN_H))
#?
CONFIGURE_CMD=
# Options passed to configure
CONFIGURE_OPTS=--enable-static --disable-shared --with-data-packaging=static --disable-extras --disable-icuio --disable-layout --disable-tests --disable-samples $(EXTRA_CONFIGURE_OPTS) CFLAGS=$(PBLD_EXTRA_FLAGS) CXXFLAGS=$(PBLD_EXTRA_FLAGS)
CONFIGURE_OPTS=--enable-static --disable-shared --with-data-packaging=static --disable-extras --disable-icuio --disable-layout --disable-tests --disable-samples $(EXTRA_CONFIGURE_OPTS)
# additional options passed to make
MAKE_XTRA_OPTS="PKGDATA_MODE=static"
# additional options passed to make install
@ -89,73 +111,59 @@ ICU_CONFIG_CC=--cc $(ICU_CONFIG_COMMON) --cflags
# icu-config switches for C++
ICU_CONFIG_CXX=--cxx $(ICU_CONFIG_COMMON) --cxxflags
include Makefile.local
## @build All installed ICUs
ii: $(GLOUT_ICU)
# Don't delete these files
.PRECIOUS: $(INST_ICU) $(BUILD_ICU) $(SRC_ICU) $(ICU_TARBALLS_VERS:%=$(BUILD)/%/config.status) $(ICU_TARBALLS_VERS:%=$(GLOUT)/%/obj-$(OK)) $(ICU_TARBALLS_VERS:%=$(BUILD)/%/config/$(ICU_CONFIG))
.PRECIOUS: (INST_ICU) $(BUILD_ICU) $(SRC_ICU) $(ICU_TARBALLS_VERS:%=$(BUILD)/%/config.status) $(ICU_TARBALLS_VERS:%=$(GLOUT)/%/obj-$(OK)) $(ICU_TARBALLS_VERS:%=$(BUILD)/%/config/$(ICU_CONFIG)) $(PLUGLIB_ICU_CONFIG)
# cleanup
clean:
-rm -rf $(ALLDIRS)
-mkdir $(ALLDIRS)
-$(MAKE) -C ../.. clean
# create all empty work dirs
$(ALLDIRS):
-mkdir -p $(@)
# build the glue objects
$(GLOUT)/%/obj-$(OK): $(GLOUT) glurens $(INST)/%/$(OK) $(BUILD)/%/config/$(ICU_CONFIG)
-mkdir $(GLOUT)/$*
# $(shell $(BUILD)/$*/config/$(ICU_CONFIG) $(ICU_CONFIG_CC)) $(GLUE_CFLAGS) -c -DICUGLUE_VER=$* -o $(GLOUT)/$*/gl_be_c_$*.o $(GL_BE_C:%.c=$(GLUE)/%.c)
# $(shell $(BUILD)/$*/config/$(ICU_CONFIG) $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -c -DICUGLUE_VER=$* -o $(GLOUT)/$*/gl_be_cxx_$*.o $(GL_BE_CXX:%.cpp=$(GLUE)/%.cpp)
-rm -rf $(GLOUT)/$*/include
mkdir -p $(GLOUT)/$*/include/icuglue/include
# Build r$(PLUGLIB) from ../../c
$(PLUGLIB_ICU_CONFIG):
$(MAKE) -C ../../c ICUVERS=$(PLUGLIB) ricus
# build the glue objects for TARGET
# used to be %/* instead of $(PLUGLIB) - now, wire it down to pluglib.
$(GLOUT)/$(PLUGLIB)/obj-$(OK): $(GLOUT) glurens $(PLUGLIB_ICU_CONFIG)
-mkdir $(GLOUT)/$(PLUGLIB)
# $(shell $(BUILD)/$(PLUGLIB)/config/$(ICU_CONFIG) $(ICU_CONFIG_CC)) $(GLUE_CFLAGS) -c -DICUGLUE_VER=$(PLUGLIB) -o $(GLOUT)/$(PLUGLIB)/gl_be_c_$(PLUGLIB).o $(GL_BE_C:%.c=$(GLUE)/%.c)
# $(shell $(BUILD)/$(PLUGLIB)/config/$(ICU_CONFIG) $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -c -DICUGLUE_VER=$(PLUGLIB) -o $(GLOUT)/$(PLUGLIB)/gl_be_cxx_$(PLUGLIB).o $(GL_BE_CXX:%.cpp=$(GLUE)/%.cpp)
-rm -rf $(GLOUT)/$(PLUGLIB)/include
mkdir -p $(GLOUT)/$(PLUGLIB)/include/icuglue/include
# for each version.. build all OTHER FE files
for ver in $(ICU_TARBALLS_VERS) ; \
# TODO: check is unnecessary, not permitted.
# TODO: change to depend instead of for list.
for ver in $(PLUGLIB_AVAILABLE) ; \
do \
echo building $$ver for $* ; \
if [ ! "$$ver" = "$*" ]; \
echo building $$ver for $(PLUGLIB) ; \
if [ ! "$$ver" = "$(PLUGLIB)" ]; \
then \
echo $(GLOUT)/$*/gl_fe_c_$${ver}_x_$*.o \
$(shell $(BUILD)/$*/config/$(ICU_CONFIG) $(ICU_CONFIG_CC)) $(GLUE_CFLAGS) -c -I$(TOP)/$(BUILD)/$$ver/gluren/include -DICUGLUE_VER=$$ver "-DICUGLUE_VER_STR=\"$$ver\"" "-DGLUE_SYM(x)=glue ## x ## $$ver" -o $(GLOUT)/$*/gl_fe_c_$${ver}_x_$*.o $(GL_FE_C:%.c=$(GLUE)/%.c) $(XOPTS) ; \
$(shell $(BUILD)/$*/config/$(ICU_CONFIG) $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -c -I$(TOP)/$(BUILD)/$$ver/gluren/include -DICUGLUE_VER=$$ver "-DICUGLUE_VER_STR=\"$$ver\"" "-DGLUE_SYM(x)=glue ## x ## $$ver" -o $(GLOUT)/$*/gl_fe_cxx_$${ver}_x_$*.o $(GL_FE_CXX:%.cpp=$(GLUE)/%.cpp) $(XOPTS) ; \
echo " GLUE_VER( $$ver ) " >> $(GLOUT)/$*/include/icuglue/glver.h; \
echo $(GLOUT)/$(PLUGLIB)/gl_fe_c_$${ver}_x_$(PLUGLIB).o \
$(shell $(PLUGLIB_ICU_CONFIG) --noverify $(ICU_CONFIG_CC)) $(GLUE_CFLAGS) -c -I$(TOP)/$(BUILD)/$$ver/gluren/include -DICUGLUE_VER=$$ver "-DICUGLUE_VER_STR=\"$$ver\"" "-DGLUE_SYM(x)=glue ## x ## $$ver" -o $(GLOUT)/$(PLUGLIB)/gl_fe_c_$${ver}_x_$(PLUGLIB).o $(GL_FE_C:%.c=$(GLUE)/%.c) $(XOPTS) ; \
$(shell $(PLUGLIB_ICU_CONFIG) --noverify $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -c -I$(TOP)/$(BUILD)/$$ver/gluren/include -DICUGLUE_VER=$$ver "-DICUGLUE_VER_STR=\"$$ver\"" "-DGLUE_SYM(x)=glue ## x ## $$ver" -o $(GLOUT)/$(PLUGLIB)/gl_fe_cxx_$${ver}_x_$(PLUGLIB).o $(GL_FE_CXX:%.cpp=$(GLUE)/%.cpp) $(XOPTS) ; \
echo " GLUE_VER( $$ver ) " >> $(GLOUT)/$(PLUGLIB)/include/icuglue/glver.h; \
fi \
done
# build 'this version' FE files
@echo Building FE for $*
$(shell $(BUILD)/$*/config/$(ICU_CONFIG) $(ICU_CONFIG_CC)) $(GLUE_CFLAGS) -I$(GLOUT)/$*/include -c -o $(GLOUT)/$*/gl_fe_c_$*.o $(GL_FE_C:%.c=$(GLUE)/%.c) $(XOPTS)
$(shell $(BUILD)/$*/config/$(ICU_CONFIG) $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -I$(GLOUT)/$*/include -c -o $(GLOUT)/$*/gl_fe_cxx_$*.o $(GL_FE_CXX:%.cpp=$(GLUE)/%.cpp) $(XOPTS)
@echo Building FE for $(PLUGLIB)
$(shell $(PLUGLIB_ICU_CONFIG) --noverify $(ICU_CONFIG_CC)) $(GLUE_CFLAGS) -I$(GLOUT)/$(PLUGLIB)/include -c -o $(GLOUT)/$(PLUGLIB)/gl_fe_c_$(PLUGLIB).o $(GL_FE_C:%.c=$(GLUE)/%.c) $(XOPTS)
$(shell $(PLUGLIB_ICU_CONFIG) --noverify $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -I$(GLOUT)/$(PLUGLIB)/include -c -o $(GLOUT)/$(PLUGLIB)/gl_fe_cxx_$(PLUGLIB).o $(GL_FE_CXX:%.cpp=$(GLUE)/%.cpp) $(XOPTS)
# build 'this version' BE files (disabled for now)
# $(shell $(BUILD)/$*/config/$(ICU_CONFIG) $(ICU_CONFIG_CC)) $(GLUE_CFLAGS) -c -DICUGLUE_VER=$* -o $(GLOUT)/$*/gl_be_c_$*.o $(GL_BE_C:%.c=$(GLUE)/%.c)
# $(shell $(BUILD)/$*/config/$(ICU_CONFIG) $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -c -DICUGLUE_VER=$* -o $(GLOUT)/$*/gl_be_cxx_$*.o $(GL_BE_CXX:%.cpp=$(GLUE)/%.cpp)
# $(shell $(BUILD)/$(PLUGLIB)/config/$(ICU_CONFIG) $(ICU_CONFIG_CC)) $(GLUE_CFLAGS) -c -DICUGLUE_VER=$(PLUGLIB) -o $(GLOUT)/$(PLUGLIB)/gl_be_c_$(PLUGLIB).o $(GL_BE_C:%.c=$(GLUE)/%.c)
# $(shell $(BUILD)/$(PLUGLIB)/config/$(ICU_CONFIG) $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -c -DICUGLUE_VER=$(PLUGLIB) -o $(GLOUT)/$(PLUGLIB)/gl_be_cxx_$(PLUGLIB).o $(GL_BE_CXX:%.cpp=$(GLUE)/%.cpp)
touch $@
# for now, glue is OK when the objects are OK.
# TODO: replace this with build of a specific lib.
$(GLOUT)/%/$(OK): $(GLOUT)/%/obj-$(OK)
touch $@
PROVIDER=provider
LIBPROVIDER=lib$(PROVIDER).a
#libs: $(ICU_TARBALLS_VERS:%=$(OUT)/%/lib/$(LIBPROVIDER))
PLUGLIB=4_4_1
PLUGLIB_MAJ=44
PLUGLIB_ICU_CONFIG=$(C_INS)/r$(PLUGLIB)/bin/icu-config
PLUGLIB_SO=$(shell $(PLUGLIB_ICU_CONFIG) --so)
PLUGLIB_NAME=libicuprov.$(PLUGLIB_MAJ).$(PLUGLIB_SO)
#PLUGLIB_MAJ=$(echo $(PLUGLIB) | cut -d_ -f-1 | tr -d _ )
#GLOUT_ICU=$(ICU_TARBALLS_VERS:%=$(GLOUT)/%/$(OK))
PLUGLIB_TARGETS=3_8_1 4_2_0_1
PLUGLIB_TARGET_DATA=$(PLUGLIB_TARGETS:%=$(BUILD)/%/data/out/tmp/*.o)
PLUGLIB_TARGET_STATICS=$(PLUGLIB_TARGETS:%=$(BUILD)/%/[ci]*/*.ao)
PLUGLIB_OUTLIBS=$(PLUGLIB:%=$(OUT)/%/lib/$(PLUGLIB_NAME))
plugs: $(PLUGLIB_OUTLIBS) $(OUT)/$(PLUGLIB_MAJ:%=icuplugins%.txt)
install-plugs: $(C_INS)/r$(PLUGLIB)/lib/$(PLUGLIB_NAME) $(C_INS)/r$(PLUGLIB)/lib/icu/icuplugins$(PLUGLIB_MAJ).txt
@ -171,9 +179,9 @@ $(OUT)/icuplugins$(PLUGLIB_MAJ).txt: $(PLUGLIB_OUTLIBS)
TESTPROG=coldiff
testprog: $(PLUGLIB:%=$(OUT)/%/bin/$(TESTPROG))
testprog: $(PLUGLIB:%=$(OUT)/%/bin/$(TESTPROG))
check: testprog $(OUT)/icuplugins$(PLUGLIB_MAJ).txt
check: all testprog $(OUT)/icuplugins$(PLUGLIB_MAJ).txt
ICU_PLUGINS=$(OUT) $(LIBPATH_VAR)=$(C_INS)/r$(PLUGLIB)/lib:out/$(PLUGLIB)/lib $(C_INS)/r$(PLUGLIB)/bin/icuinfo || ( echo "ICU broken." ; /bin/false )
ICU_PLUGINS=$(OUT) $(LIBPATH_VAR)=$(C_INS)/r$(PLUGLIB)/lib:out/$(PLUGLIB)/lib $(C_INS)/r$(PLUGLIB)/bin/icuinfo -L || ( echo "Plugin broken." ; /bin/false )
ICU_PLUGINS=$(OUT) $(LIBPATH_VAR)=$(C_INS)/r$(PLUGLIB)/lib:out/$(PLUGLIB)/lib out/$(PLUGLIB)/bin/coldiff || ( echo "coldiff failed." ; /bin/false )
@ -182,14 +190,15 @@ install-check: install-plugs
$(LIBPATH_VAR)=$(C_INS)/r$(PLUGLIB)/lib $(C_INS)/r$(PLUGLIB)/bin/icuinfo -L || ( echo "Plugin broken." ; /bin/false )
$(LIBPATH_VAR)=$(C_INS)/r$(PLUGLIB)/lib out/$(PLUGLIB)/bin/coldiff || ( echo "coldiff failed." ; /bin/false )
$(OUT)/%/bin/$(TESTPROG): $(TESTPROG).cpp
$(OUT)/%/bin/$(TESTPROG): $(TESTPROG).cpp $(OUT)/$(PLUGLIB)/provider_version.h
-mkdir -p $(OUT)/$*/bin
$(shell $(PLUGLIB_ICU_CONFIG) --cxx --cxxflags --cppflags --ldflags) -o $@ $^
$(shell $(PLUGLIB_ICU_CONFIG) --cxx --cxxflags --cppflags --ldflags) -o $@ -I$(OUT)/$(PLUGLIB) $(TESTPROG).cpp
$(OUT)/%/lib/$(PLUGLIB_NAME):
$(OUT)/%/lib/$(PLUGLIB_NAME): $(GLOUT)/%/obj-$(OK)
-mkdir -p $(OUT)/$*/lib
$(shell $(PLUGLIB_ICU_CONFIG) --cxx --cxxflags --cppflags --ldflags) $(PLUG_EXTRA_LDFLAGS) -shared -o $@ $(GLOUT)/$*/*.o $(PLUGLIB_TARGET_DATA) $(PLUGLIB_TARGET_STATICS)
cp $@ $(C_INS)/r$*/lib/
$(shell $(PLUGLIB_ICU_CONFIG) --cxx --cxxflags --cppflags --ldflags) $(PLUG_EXTRA_LDFLAGS) -shared -o $@ $(GLOUT)/$*/*.o $(PLUGLIB_AVAILABLE_DATA) $(PLUGLIB_AVAILABLE_STATICS)
# cp $@ $(C_INS)/r$*/lib/
$(OUT)/%/lib/$(LIBPROVIDER): $(GLOUT)/%/obj-$(OK)
-mkdir -p $(OUT)/$*/lib
@ -197,13 +206,10 @@ $(OUT)/%/lib/$(LIBPROVIDER): $(GLOUT)/%/obj-$(OK)
ar -rv $@ $(GLOUT)/$*/*.o
ranlib $@
# -[ -d $(SRC)/$* ] && rm -rf $(SRC)/$*
## @@ build glu rename files
glurens: $(GLUREN_ICU)
# build single gluren.h
# build single gluren.h
$(BUILD)/%/$(GLUREN_H): $(BUILD)/%/ok Makefile
-mkdir -p $(BUILD)/$*/$(GLUREN)
cat $(GLUE)/gluren-top.h > $@
@ -242,32 +248,49 @@ $(BUILD)/%/config.status: $(SRC)/%/ok
@echo "Configging" $*
-[ -d $(BUILD)/$* ] && rm -rf $(BUILD)/$*
mkdir -p $(BUILD)/$*
( cd $(BUILD)/$* && $(shell $(SUPERCONF) $(TOP)/$(SRC)/$*/$(SOURCE) $*) $(CONFIGURE_OPTS) --srcdir=$(TOP)/$(SRC)/$*/$(SOURCE) --prefix=$(TOP)/$(INST)/$* )
( cd $(BUILD)/$* && env CFLAGS=$(PBLD_EXTRA_FLAGS) CXXFLAGS=$(PBLD_EXTRA_FLAGS) $(shell $(SUPERCONF) $(TOP)/$(SRC)/$*/$(SOURCE) $*) $(CONFIGURE_OPTS) --srcdir=$(TOP)/$(SRC)/$*/$(SOURCE) --prefix=$(TOP)/$(INST)/$* )
# build
# note: regex had renaming problems, and spoof depends on regex. Nuke them.
$(BUILD)/%/ok: $(BUILD)/%/config.status
@echo "Building" $*
( $(MAKE) $(MOPTS) -C $(BUILD)/$* all $(MAKE_XTRA_OPTS) )
-rm -f $(BUILD)/$*/i18n/uregex*.*
@if [ ! -f $(BUILD)/$*/common/putil.ao ]; \
then \
echo re-unpacking $(BUILD)/$*/common ; \
( cd $(BUILD)/$*/common && ar xf ../lib/libsicuuc.a || echo could not unpack ../lib/libsicuuc.a ) ; \
echo re-unpacking $(BUILD)/$*/i18n ; \
( cd $(BUILD)/$*/i18n && ar xf ../lib/libsicui18n.a || echo could not unpack ../lib/libsicui18n.a ) ; \
fi
@if [ ! -f $(BUILD)/$*/common/putil.ao ]; \
then \
echo ERROR: still could not find $(BUILD)/$*/common/putil.ao - build may fail.; \
fi
-rm -f $(BUILD)/$*/i18n/uregex*.* $(BUILD)/$*/i18n/uspoof*.*o*
touch $@
# ( cd $(BUILD_ICU)/% ; echo tar xvfpz $(ICUS)/icu4c-$*-src.tgz )
# touch $@
#
help:
info help:
@echo ICU Provider Build
@echo "Targetting Provider against ICU $(PROVIDER_TARGET) ($(PLUGLIB), major $(PLUGLIB_MAJ))"
@echo "Available plugins: $(PROVIDER_AVAILABLE) ($(PLUGLIB_AVAILABLE))"
@echo "Available keywords:"
@for ver in $(PROVIDER_AVAILABLE); do \
echo " ...@provider=icu"`echo $$ver | cut -d. -f1-2 | tr -d .`; \
done
@echo "Plugin library will be $(PLUGLIB_NAME)"
@echo
@echo Available ICU tarballs: $(ICU_TARBALLS)
@echo Available ICU versions: $(ICU_TARBALLS_VERS)
@echo Available ICU versions: $(shell echo $(ICU_TARBALLS_VERS) | tr '_' '.')
# from makefoo:
#EYF+=g++ -g -dead_strip -o foo glout/4_2_0_1/*.o -Linst/4_2_0_1/lib/ -Lbuild/4_2_0_1/data/out/ -lsicuuc -lsicui18n -licudt42l build/3_8_1/*/*.ao build/4_0_1/*/*.ao build/4_0_1/data/out/tmp/icudt40l_dat.o build/3_8_1/data/out/tmp/icudt38l_dat.o
# backup
#arch:
# cd .. ; tar cvfpj MI$$$$.tar.bz2 $(DIR)/Makefile $(DIR)/superconf.sh $(DIR)/glue $(DIR)/makefoo.sh $(DIR)/coldiff.cpp
$(OUT)/$(PLUGLIB)/provider_version.h: Makefile.local Makefile
@echo Generating $@ ..
@echo "/* Generated file. */" > $@
@echo "const char *provider_version[] = {" >> $@
@for ver in $(PROVIDER_AVAILABLE); do \
echo '"'`echo $$ver | cut -d. -f1-2 | tr -d .`'",' >> $@ ; \
done
@echo " }; " >> $@
@echo "#define PROVIDER_COUNT (sizeof(provider_version)/sizeof(provider_version[0]))" >> $@
@echo >> $@
#-- for the prototype

View File

@ -1,10 +1,31 @@
# Copyright (c) 2008-2009 IBM Corp. and Others. All Rights Reserved
#
# Copyright (C) 2008-2010 IBM Corporation and Others. All Rights Reserved
# local definitions can go in Makefile.local
# local definitions must go in Makefile.local
# example:
##
## These two are REQUIRED.
##
# The version of ICU you will build against, such as:
# EXAMPLE: 4.4.2
PROVIDER_TARGET=4.4.2
# The versions of ICU you want to have available in the plugin. Space separated. Don't include the PROVIDER_TARGET version.
# EXAMPLE: 3.8.1 4.2.0.1
PROVIDER_AVAILABLE=3.8.1 4.2.0.1
##
## following are OPTIONAL
##
## debug options
EXTRA_COMPILE_OPTS=-g
#EXTRA_COMPILE_OPTS=-g
## configure options
#EXTRA_CONFIGURE_OPTS=--with-library-suffix=srl

View File

@ -17,8 +17,8 @@
/* String to use. */
const UChar stuff[] = { 0x30BB, 0x0d4c, 0x53, 0x74, 0x75, 0x66, 0x66, 0x00 }; /* Stuff */
#define VERS_COUNT 3
const char *vers[VERS_COUNT] = { NULL, "42", "38" }; /* List of ICU versions to test */
#include "provider_version.h"
#define LOCALE_COUNT 4
const char *locale[LOCALE_COUNT] = { "fi", "en_US", "ja", "ml" }; /* List of locales to test */
@ -34,7 +34,7 @@ void setup(UErrorCode &status) {
int32_t count;
StringEnumeration *se = Collator::getAvailableLocales();
count = se->count(status);
fprintf(stderr, "# Collators now available: %d,\t%s\n", count, u_errorName(status));
fprintf(stderr, "# Collators now available: %d,\t%s - %d providers expected.\n", count, u_errorName(status), PROVIDER_COUNT);
}
int main(int /* argc*/ , const char * /*argv*/ []) {
@ -42,18 +42,21 @@ int main(int /* argc*/ , const char * /*argv*/ []) {
int diffs = 0;
setup(status);
if(U_FAILURE(status)) return 1;
int expected = PROVIDER_COUNT;
for(int l=0;l<LOCALE_COUNT;l++) {
printf("\n");
uint8_t oldBytes[200];
int32_t oldLen = -1;
for(int v=0;v<VERS_COUNT;v++) {
for(int v=0;v<=expected;v++) {
// Construct the locale ID
char locID[200];
strcpy(locID, locale[l]);
if(vers[v]!=NULL) { // NULL = no version
if((v!=expected)) { // -1 = no version
strcat(locID, "@provider=icu");
strcat(locID, vers[v]);
strcat(locID, provider_version[v]);
}
printf("%28s : ", locID);
@ -69,7 +72,7 @@ int main(int /* argc*/ , const char * /*argv*/ []) {
int32_t len = col->getSortKey(stuff, -1, bytes, 200);
for(int i=0;i<len;i++) {
if(v>0&&i<oldLen&&bytes[i]!=oldBytes[i]) {
if(i<oldLen&&bytes[i]!=oldBytes[i]) {
diffs++;
printf("*");
} else {

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 2009, International Business Machines
* Copyright (C) 2009-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -13,7 +13,6 @@
/* Get utypes.h from whatever ICU we are under */
#include <unicode/utypes.h>
//#define GLUE_SYM(x) glue ## x ## ICUGLUE_VER
#define GLUE_SYM_V(x, v) glue ## x ## v
#endif
#endif

View File

@ -0,0 +1,66 @@
#!/bin/cat
# Copyright (c) 2009-2010 IBM Corp. and Others. All Rights Reserved
# ICU Provider Feature. - $Id$
BUILDING:
1a. Download the ICU source (.tgz) you wish to TARGET (i.e. link your application against). This must be in the 4.4. series.
4.4, 4.4.1, and 4.4.2 have been tested. The latest available is recommended (4.4.2 as of this writing).
1b. Download one or more ICUs (.tgz) you wish to have AVAILABLE (via the provider interface). As of this writing, 4.2.0.1, 3.8.1, 3.6, 3.4.1, and 3.2.1 have been tested.
(Known issue: As of this writing, ICU 4.4+,4.5+ etc may NOT be an AVAILABLE locale (it may be a TARGET). )
Note that the MAJOR+MINOR version numbers must not conflict between the TARGET and AVAILABLE ICUs. Only one ICU of each major+minor is allowed.
So, only one 4.4.X, one 3.8.X, etc. This is due to ICU binary compatibility rules.
1c. Copy the ICUs (named as they were downloaded) into the ../../packages/ directory relative to this readme.
2a. Copy the file "Makefile-local.sample" into a new file "Makefile.local".
2b. Edit the Makefile.local to modify the PROVIDER_TARGET and PROVIDER_AVAILABLE settings.
3. Check the makefile settings by running 'make info', you should see output similar to the following:
ICU Provider Build
Targetting Provider against ICU 4.4.2 (4_4_2, major 44)
Available plugins: 3.8.1 4.2.0.1 (3_8_1 4_2_0_1)
Available keywords:
...@provider=icu38
...@provider=icu42
Plugin library will be libicuprov.44.so
Available ICU tarballs: icu4c-3_8_1-src.tgz icu4c-4_2_0_1-src.tgz icu4c-4_4_2-src.tgz
Available ICU versions: 3.8.1 4.2.0.1 4.4.2
The last two lines show which ICU .tgz files are available. If a version is not listed, make sure the filename is as above.
4. Now, you are ready to build and test:
make check
This will take quite a while as it has to build N copies of ICU.
When done, it should show a list of collation keys, and indicate that there were differences between ICU 3.8, 4.4, 4.2. You may need to modify coldiff.cpp if you are using a different set of ICU versions.
5. You can test in an 'installed' ICU (not the system install) with this command:
make install-check
DEPLOYING:
6. To install the plugin in your own ICU, copy out/icuplugins44.txt into your lib/icu, and out/lib/libicuprov.44.so into your lib/ directories where ICU is installed.
Note that running 'icuinfo' will tell you where the plugin file is expected to be located, and 'icuinfo -L' will debug any load issues.
USING:
Collators opened with an id such as that shown in 'make info', such as 'en_US@provider=icu38' will load, for example, an ICU 3.8 collator.

View File

@ -2,6 +2,13 @@
# Copyright (c) 2009-2010 IBM Corp. and Others. All Rights Reserved
#
NOTE:
NOTE: For information about the 'Provider' feature, see proj/provider/readme.txt
NOTE:
This directory contains pieces of the 'MultiIcu' feature, which contains
scripts for building multiple versions of ICU at the same time, and running
various pieces of code against it.