ICU-7583 checkpoint before clean up and drop
X-SVN-Rev: 28690
This commit is contained in:
parent
2e1aee8d0a
commit
1d61380988
@ -22,10 +22,10 @@ BLD=$(C_BLD)
|
||||
INS=$(C_INS)
|
||||
SRC=$(C_SRC)
|
||||
|
||||
ALLICUS=$(ICUVERS:%=$(BLD)/%/$(S_BLD))
|
||||
IICUS=$(ICUVERS:%=$(INS)/%/$(S_INS))
|
||||
ALLICUS=$(ICUVERS:%=$(BLD)/%/$(S_BLD)) $(ICUVERS:%=$(BLD)/r%/$(S_BLD))
|
||||
IICUS=$(ICUVERS:%=$(INS)/%/$(S_INS)) $(ICUVERS:%=$(INS)/r%/$(S_INS))
|
||||
|
||||
APRECIOUS=$(ICUVERS:%=$(BLD)/%/$(S_SRC)) $(ICUVERS:%=$(BLD)/%/$(S_BLD)) $(ICUVERS:%=$(INS)/%/$(S_INS))
|
||||
APRECIOUS=$(ICUVERS:%=$(BLD)/%/$(S_SRC)) $(ICUVERS:%=$(BLD)/%/$(S_BLD)) $(ICUVERS:%=$(INS)/%/$(S_INS)) $(ICUVERS:%=$(BLD)/r%/$(S_BLD)) $(ICUVERS:%=$(INS)/r%/$(S_INS))
|
||||
|
||||
.PRECIOUS: $(APRECIOUS)
|
||||
|
||||
@ -41,6 +41,19 @@ $(INS)/%/$(S_INS): $(BLD)/%/$(S_BLD)
|
||||
( make $(MAKE_OPTS) -C $(BLD)/$*/icu/source 2>&1 all install | tee $(BLD)/$*/build.log ) || ( mv $(BLD)/$*/build.log $(BLD)/$*/build.err ; false )
|
||||
touch -c $@
|
||||
|
||||
$(INS)/r%/$(S_INS): $(BLD)/r%/$(S_BLD)
|
||||
@if [ -f $(BLD)/r$*/build.err ]; then echo '###' Error for $* stored in $(BLD)/r$*/build.err - remove if you want me to retry; false; fi
|
||||
( make $(MAKE_OPTS) -C $(BLD)/r$*/icu/source 2>&1 all install | tee $(BLD)/r$*/build.log ) || ( mv $(BLD)/r$*/build.log $(BLD)/r$*/build.err ; false )
|
||||
touch -c $@
|
||||
|
||||
$(BLD)/r%/$(S_SRC): $(ICUS)/icu4c-%-src.tgz
|
||||
-mv $(BLD)/r$* $(BLD)/r$*.old
|
||||
-( rm -rf ./$(BLD)/r$*.old& )
|
||||
mkdir -p $(BLD)/r$*
|
||||
( cd $(BLD)/r$* ; gunzip -d < $^ | tar xfp - )
|
||||
([ -f $(DOT)/patch/$* ] && patch -d $(BLD)/r$* -p1 < $(DOT)/patch/$*) || true
|
||||
touch -c $@
|
||||
|
||||
$(BLD)/%/$(S_SRC): $(ICUS)/icu4c-%-src.tgz
|
||||
-mv $(BLD)/$* $(BLD)/$*.old
|
||||
-( rm -rf ./$(BLD)/$*.old& )
|
||||
@ -49,12 +62,20 @@ $(BLD)/%/$(S_SRC): $(ICUS)/icu4c-%-src.tgz
|
||||
([ -f $(DOT)/patch/$* ] && patch -d $(BLD)/$* -p1 < $(DOT)/patch/$*) || true
|
||||
touch -c $@
|
||||
|
||||
|
||||
$(BLD)/r%/$(S_BLD): $(BLD)/r%/$(S_SRC)
|
||||
-mkdir -p $(INS)
|
||||
-chmod a+rx $(BLD)/r$*/icu/source/configure $(BLD)/r$*/icu/source/runConfigureICU
|
||||
( cd $(BLD)/r$*/icu/source ; `$(ICUCONF) "$(BLD)/r$*/icu/source" "$*"` --enable-renaming --enable-shared --disable-static --enable-release --disable-debug --prefix=$(INS)/r$* )
|
||||
touch -c $@
|
||||
|
||||
$(BLD)/%/$(S_BLD): $(BLD)/%/$(S_SRC)
|
||||
-mkdir -p $(INS)
|
||||
-chmod a+rx $(BLD)/$*/icu/source/configure $(BLD)/$*/icu/source/runConfigureICU
|
||||
( cd $(BLD)/$*/icu/source ; `$(ICUCONF) "$(BLD)/$*/icu/source" "$*"` --disable-renaming --enable-shared --disable-static --enable-release --disable-debug --prefix=$(INS)/$* )
|
||||
touch -c $@
|
||||
|
||||
|
||||
$(INS)/%/bin/$(TARGET): $(INS)/%/$(S_INS) $(SRCS)
|
||||
-rm -rf ./$(BLD)/$*/tmp
|
||||
mkdir ./$(BLD)/$*/tmp
|
||||
|
@ -1,8 +1,8 @@
|
||||
# Copyright (c) 2008-2009 IBM Corp. and Others. All Rights Reserved
|
||||
# Copyright (c) 2008-2010 IBM Corp. and Others. All Rights Reserved
|
||||
|
||||
include $(MULTICU_ROOT)/common/Makefile-multi.inc
|
||||
|
||||
C_GOOD:=$(shell [ -d $(C_INS) ] && (cd $(C_INS) ; ls -d */$(S_INS) | cut -d/ -f1))
|
||||
C_GOOD:=$(shell [ -d $(C_INS) ] && (cd $(C_INS) ; ls -d */$(S_INS) 2>/dev/null | cut -d/ -f1))
|
||||
|
||||
C_CLEAN_TARGET=$(C_GOOD:%=$(C_INS)/%/bin/$(TARGET))
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2009 IBM Corporation and Others, All Rights Reserved.
|
||||
# Copyright (C) 2010 IBM Corporation and Others, All Rights Reserved.
|
||||
#
|
||||
|
||||
## configuration
|
||||
@ -73,13 +73,13 @@ ICU_CONFIG_CXX=--cxx $(ICU_CONFIG_COMMON) --cxxflags
|
||||
ii: $(GLOUT_ICU)
|
||||
|
||||
# Don't delete these files
|
||||
.PRECIOUS: $(INST_ICU) $(BUILD_ICU) $(SRC_ICU) BUILD_ICU=$(ICU_TARBALLS_VERS:%=$(BUILD)/%/config.status)
|
||||
.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))
|
||||
|
||||
# cleanup
|
||||
clean:
|
||||
-rm -rf $(ALLDIRS)
|
||||
-mkdir $(ALLDIRS)
|
||||
|
||||
|
||||
# create all empty work dirs
|
||||
$(ALLDIRS):
|
||||
-mkdir -p $(@)
|
||||
@ -91,7 +91,7 @@ $(GLOUT)/%/obj-$(OK): $(GLOUT) glurens $(INST)/%/$(OK) $(BUILD)/%/config/$(ICU_
|
||||
# $(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
|
||||
# for each version.. build all OTHER FE files
|
||||
# for each version.. build all OTHER FE files
|
||||
for ver in $(ICU_TARBALLS_VERS) ; \
|
||||
do \
|
||||
echo building $$ver for $* ; \
|
||||
@ -103,10 +103,11 @@ $(GLOUT)/%/obj-$(OK): $(GLOUT) glurens $(INST)/%/$(OK) $(BUILD)/%/config/$(ICU_
|
||||
echo " GLUE_VER( $$ver ) " >> $(GLOUT)/$*/include/icuglue/glver.h; \
|
||||
fi \
|
||||
done
|
||||
# build 'this version' FE files
|
||||
# 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)
|
||||
# build 'this version' BE files (disabled for now)
|
||||
# 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)
|
||||
touch $@
|
||||
@ -120,8 +121,31 @@ PROVIDER=provider
|
||||
LIBPROVIDER=lib$(PROVIDER).a
|
||||
|
||||
libs: $(ICU_TARBALLS_VERS:%=$(OUT)/%/lib/$(LIBPROVIDER))
|
||||
|
||||
PLUGVERS=4_4_1
|
||||
#GLOUT_ICU=$(ICU_TARBALLS_VERS:%=$(GLOUT)/%/$(OK))
|
||||
|
||||
aplug:
|
||||
echo $(OUT)/$(PLUGVERS)/lib/plug.dylib:
|
||||
|
||||
plugs: $(PLUGVERS:%=$(OUT)/%/lib/plug.dylib)
|
||||
|
||||
TESTPROG=coldiff
|
||||
|
||||
testprog: $(PLUGVERS:%=$(OUT)/%/bin/$(TESTPROG))
|
||||
|
||||
test-check: testprog
|
||||
ICU_PLUGINS=. DYLD_LIBRARY_PATH=$(C_INS)/r4_4_1/lib out/4_4_1/bin/coldiff
|
||||
|
||||
# $(shell $(BUILD)/$*/config/$(ICU_CONFIG) $(ICU_CONFIG_CXX))
|
||||
|
||||
$(OUT)/%/bin/$(TESTPROG): $(TESTPROG).cpp
|
||||
-mkdir $(OUT)/$*/bin
|
||||
g++ -I$(C_INS)/r$*/include -o $@ $^ -L$(C_INS)/r$*/lib -licuuc -licui18n -licudata
|
||||
|
||||
#$(GLOUT)/$%/obj-$(OK)
|
||||
$(OUT)/%/lib/plug.dylib:
|
||||
g++ -dynamiclib -exported_symbols_list export.txt -dynamic -o $@ $(GLOUT)/$*/*.o $(BUILD)/3_8_1/[ci]*/*.ao $(BUILD)/3_8_1/data/out/tmp/*.o $(BUILD)/4_2_0_1/[ci]*/*.ao $(BUILD)/4_2_0_1/data/out/tmp/*.o -L$(C_INS)/r$*/lib -licuuc -licui18n -licudata
|
||||
|
||||
$(OUT)/%/lib/$(LIBPROVIDER): $(GLOUT)/%/obj-$(OK)
|
||||
-mkdir -p $(OUT)/$*/lib
|
||||
echo copy includes
|
||||
|
85
tools/multi/proj/provider/coldiff.cpp
Normal file
85
tools/multi/proj/provider/coldiff.cpp
Normal file
@ -0,0 +1,85 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009-2010, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <unicode/coll.h>
|
||||
#include <unicode/uclean.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
/* 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 */
|
||||
|
||||
#define LOCALE_COUNT 4
|
||||
const char *locale[LOCALE_COUNT] = { "fi", "en_US", "ja", "ml" }; /* List of locales to test */
|
||||
|
||||
/**
|
||||
* Set up ICU, print # of available collators
|
||||
*/
|
||||
void setup(UErrorCode &status) {
|
||||
u_init(&status);
|
||||
|
||||
fprintf(stderr, "ICU %s init: %s\n", U_ICU_VERSION, u_errorName(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));
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
setup(status);
|
||||
if(U_FAILURE(status)) return 1;
|
||||
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++) {
|
||||
|
||||
// Construct the locale ID
|
||||
char locID[200];
|
||||
strcpy(locID, locale[l]);
|
||||
if(vers[v]!=NULL) { // NULL = no version
|
||||
strcat(locID, "@provider=ICU");
|
||||
strcat(locID, vers[v]);
|
||||
}
|
||||
|
||||
printf("%28s : ", locID);
|
||||
|
||||
UErrorCode subStatus = U_ZERO_ERROR;
|
||||
uint8_t bytes[200];
|
||||
|
||||
Collator *col = Collator::createInstance(Locale(locID),subStatus);
|
||||
if(U_FAILURE(subStatus)) {
|
||||
printf("ERR: %s\n", u_errorName(subStatus));
|
||||
continue;
|
||||
}
|
||||
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]) {
|
||||
printf("*");
|
||||
} else {
|
||||
printf(" ");
|
||||
}
|
||||
printf("%02X", (0xFF&bytes[i]));
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
delete col;
|
||||
|
||||
oldLen = len;
|
||||
memcpy(oldBytes, bytes, len);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009, International Business Machines
|
||||
* Copyright (C) 2009-2010, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
@ -96,6 +96,12 @@ static UCollationStrength _getUCollationStrength(
|
||||
/* code for some version */
|
||||
#include <icuglue/gluren.h>
|
||||
|
||||
/**
|
||||
uclean.h
|
||||
*/
|
||||
U_STABLE void U_EXPORT2
|
||||
OICU_u_init(UErrorCode *status);
|
||||
|
||||
/**
|
||||
ucol.h
|
||||
*/
|
||||
@ -188,10 +194,13 @@ GLUE_SYM ( Collator ) :: create (const Locale &loc, const char *ver) {
|
||||
UOBJECT_DEFINE_RTTI_IMPLEMENTATION( GLUE_SYM( Collator ) )
|
||||
|
||||
Collator* GLUE_SYM ( Collator ) :: clone() const {
|
||||
UErrorCode status;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " clone %p -> " , this);
|
||||
UCollator *clc = OICU_ucol_safeClone( _this, NULL, 0, &status);
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " .. safeclone %s _this %p-> %p " , u_errorName(status), _this, clc);
|
||||
if(U_FAILURE(status)||clc==NULL) return NULL;
|
||||
Collator *c = new GLUE_SYM( Collator ) ( clc );
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " .. wrap(%p) -> %p\n", clc, c);
|
||||
// c->setLocales(getLocale(ULOC_REQUESTED_LOCALE,status),getLocale(ULOC_VALID_LOCALE,status),getLocale(ULOC_ACTUAL_LOCALE,status));
|
||||
|
||||
// if(U_FAILURE(status)) {
|
||||
@ -310,7 +319,13 @@ int32_t GLUE_SYM ( Collator ) :: getSortKey(const UChar*s, int32_t l, uint8_t*d,
|
||||
|
||||
|
||||
int32_t GLUE_SYM ( Collator ) :: appendAvailable(UnicodeString* strs, int32_t i, int32_t count) {
|
||||
for(int j=0;j<OICU_ucol_countAvailable();j++) {
|
||||
int avail = OICU_ucol_countAvailable();
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
OICU_u_init(&status);
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " avail %d - init %s\n", avail, u_errorName(status));
|
||||
#endif
|
||||
for(int j=0;j<avail;j++) {
|
||||
// strs[i+j].append("zu_zg_wang@provider=ICU");
|
||||
strs[i+j].append(OICU_ucol_getAvailable(j));
|
||||
strs[i+j].append("@provider=ICU");
|
||||
@ -321,7 +336,7 @@ int32_t GLUE_SYM ( Collator ) :: getSortKey(const UChar*s, int32_t l, uint8_t*d,
|
||||
char foo[999];
|
||||
const UChar *ss = strs[i+j].getTerminatedBuffer();
|
||||
u_austrcpy(foo, ss);
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " appending [%d+%d=%d] <<%s>>\n", i, j, i+j, foo);
|
||||
// fprintf(stderr, "VCF " ICUGLUE_VER_STR " appending [%d+%d=%d] <<%s>>\n", i, j, i+j, foo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -342,8 +357,8 @@ static
|
||||
|
||||
class VersionCollatorFactory : public CollatorFactory {
|
||||
public:
|
||||
virtual Collator *createCollator(const Locale &loc);
|
||||
virtual const UnicodeString *getSupportedIDs(int32_t &count, UErrorCode &status);
|
||||
virtual Collator *createCollator(const Locale &loc);
|
||||
virtual const UnicodeString *getSupportedIDs(int32_t &count, UErrorCode &status);
|
||||
virtual void* getDynamicClassID() const;
|
||||
static void* getStaticClassID() ;
|
||||
};
|
||||
@ -375,7 +390,7 @@ Collator *VersionCollatorFactory::createCollator(const Locale &loc) {
|
||||
#if defined(GLUE_VER)
|
||||
#undef GLUE_VER
|
||||
#endif
|
||||
#define GLUE_VER(x) /*printf("%c/%c|%c/%c\n", icuver[0],(#x)[0],icuver[1],(#x)[2]);*/ if(icuver[0]== (#x)[0] && icuver[1]==(#x)[2]) { return glue ## Collator ## x :: create(loc, icuver); }
|
||||
#define GLUE_VER(x) /*printf("%c/%c|%c/%c\n", icuver[0],(#x)[0],icuver[1],(#x)[2]);*/ if(icuver[0]== (#x)[0] && icuver[1]==(#x)[2]) { Collator *c = glue ## Collator ## x :: create(loc, icuver); fprintf(stderr, "VCF::CC %s -> %p\n", loc.getName(), c); return c; }
|
||||
#include "icuglue/glver.h"
|
||||
#if 1
|
||||
fprintf(stderr, "VCF:CC %s failed\n", loc.getName());
|
||||
@ -405,6 +420,11 @@ printf("VCF: count=%d\n", count);
|
||||
UnicodeString *strs = new UnicodeString[count];
|
||||
int32_t i = 0;
|
||||
|
||||
// #if (U_ICU_VERSION_MAJOR_NUM==4) && (U_ICU_VERSION_MINOR_NUM==4)
|
||||
// glueCollator38::appendAvailable(strs,i,count);
|
||||
// glueCollator42::appendAvailable(strs,i,count);
|
||||
// #endif
|
||||
|
||||
#if defined(GLUE_VER)
|
||||
#undef GLUE_VER
|
||||
#endif
|
||||
@ -425,10 +445,45 @@ return gLocales;
|
||||
#if 1
|
||||
#include <stdio.h>
|
||||
|
||||
#include <unicode/uversion.h>
|
||||
|
||||
static URegistryKey rk = NULL;
|
||||
|
||||
void coll_provider_register(UErrorCode &status) {
|
||||
URegistryKey rk = Collator::registerFactory(new VersionCollatorFactory(), status);
|
||||
rk = Collator::registerFactory(new VersionCollatorFactory(), status);
|
||||
}
|
||||
|
||||
void coll_provider_unregister(UErrorCode &status) {
|
||||
Collator::unregister(rk, status);
|
||||
}
|
||||
|
||||
#if (U_ICU_VERSION_MAJOR_NUM > 4) || ((U_ICU_VERSION_MAJOR_NUM==4)&&(U_ICU_VERSION_MINOR_NUM>3))
|
||||
/* Plugin */
|
||||
#include "unicode/icuplug.h"
|
||||
|
||||
U_CAPI UPlugTokenReturn U_EXPORT2 coll_provider_plugin (UPlugData *data, UPlugReason reason, UErrorCode *status);
|
||||
|
||||
U_CAPI UPlugTokenReturn U_EXPORT2 coll_provider_plugin (UPlugData *data, UPlugReason reason, UErrorCode *status)
|
||||
{
|
||||
switch(reason) {
|
||||
case UPLUG_REASON_QUERY:
|
||||
uplug_setPlugName(data, "Collation Provider Plugin");
|
||||
uplug_setPlugLevel(data, UPLUG_LEVEL_HIGH);
|
||||
break;
|
||||
case UPLUG_REASON_LOAD:
|
||||
coll_provider_register(*status);
|
||||
break;
|
||||
case UPLUG_REASON_UNLOAD:
|
||||
coll_provider_unregister(*status);
|
||||
break;
|
||||
default:
|
||||
break; /* not handled */
|
||||
}
|
||||
return UPLUG_TOKEN;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
void main(int argc, const char *argv[]) {
|
||||
puts("hello");
|
||||
|
Loading…
Reference in New Issue
Block a user