mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-1568 static mode on Win32
X-SVN-Rev: 8043
This commit is contained in:
parent
7e0a131963
commit
83df0975fd
6 changed files with 89 additions and 18 deletions
|
@ -42,6 +42,9 @@ RESFILES=resfiles.mk
|
|||
ICUDATA=$(ICUP)\data
|
||||
|
||||
DLL_OUTPUT=.\$(CFG)
|
||||
# set the following to 'static' or 'dll' depending
|
||||
PKGMODE=static
|
||||
|
||||
|
||||
ICD=$(ICUDATA)^\
|
||||
DATA_PATH=$(ICUP)\data^\
|
||||
|
@ -76,18 +79,23 @@ PATH = $(PATH);$(ICUP)\bin
|
|||
RB_FILES = $(RESSRC:.txt=.res)
|
||||
|
||||
# This target should build all the data files
|
||||
ALL : GODATA "$(DLL_OUTPUT)\$(RESNAME).dll" GOBACK #$(RESNAME).dat
|
||||
@echo All targets are up to date
|
||||
!IF "$(PKGMODE)" == "dll"
|
||||
OUTPUT = "$(DLL_OUTPUT)\$(RESNAME).dll"
|
||||
!ELSE
|
||||
OUTPUT = "$(DLL_OUTPUT)\$(RESNAME).lib"
|
||||
!ENDIF
|
||||
|
||||
#invoke pkgdata
|
||||
"$(DLL_OUTPUT)\$(RESNAME).dll" : $(RB_FILES) $(RESFILES)
|
||||
@echo Building $(RESNAME)
|
||||
@"$(ICUTOOLS)\pkgdata" -v -m dll -c -p $(RESNAME) -O "$(PKGOPT)" -d "$(DLL_OUTPUT)" -s "$(RESDIR)" <<pkgdatain.txt
|
||||
ALL : GODATA $(OUTPUT) GOBACK #$(RESNAME).dat
|
||||
@echo All targets are up to date (mode $(PKGMODE))
|
||||
|
||||
|
||||
# invoke pkgdata - static
|
||||
"$(DLL_OUTPUT)\$(RESNAME).lib" : $(RB_FILES) $(RESFILES)
|
||||
@echo Building $(RESNAME).lib
|
||||
@"$(ICUTOOLS)\pkgdata" -v -m static -c -p $(RESNAME) -O "$(PKGOPT)" -d "$(DLL_OUTPUT)" -s "$(RESDIR)" <<pkgdatain.txt
|
||||
$(RB_FILES:.res =.res
|
||||
)
|
||||
<<KEEP
|
||||
@echo Copying "$(DLL_OUTPUT)\$(RESNAME).dll to $(ICUP)\bin
|
||||
@copy "$(DLL_OUTPUT)\$(RESNAME).dll" $(ICUP)\bin
|
||||
|
||||
# utility to send us to the right dir
|
||||
GODATA :
|
||||
|
@ -101,7 +109,7 @@ GOBACK :
|
|||
CLEAN :
|
||||
@cd "$(RESDIR)"
|
||||
-@erase "*.cnv"
|
||||
-@erase "*.res"
|
||||
-@erase "*.res"f
|
||||
-@erase "cnvalias*.*"
|
||||
-@erase "icudata.*"
|
||||
-@erase "*.obj"
|
||||
|
|
|
@ -42,7 +42,7 @@ RSC=rc.exe
|
|||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\icu\include" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\icu\include" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "UCONVMSG_STATIC" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
@ -50,7 +50,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 icuuc.lib icuin.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\icu\lib"
|
||||
# ADD LINK32 icuuc.lib icuin.lib uconvmsg.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\lib" /libpath:"Release"
|
||||
# Begin Custom Build
|
||||
InputPath=.\Release\uconv.exe
|
||||
InputName=uconv
|
||||
|
@ -75,7 +75,7 @@ SOURCE="$(InputPath)"
|
|||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\icu\include" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\icu\include" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "UCONVMSG_STATIC" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
@ -83,7 +83,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 icuuc.lib icuin.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\icu\lib"
|
||||
# ADD LINK32 icuucd.lib icuind.lib uconvmsg.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\lib" /libpath:"Debug"
|
||||
# Begin Custom Build
|
||||
InputPath=.\Debug\uconv.exe
|
||||
InputName=uconv
|
||||
|
|
|
@ -100,6 +100,10 @@ U_CAPI UResourceBundle *u_wmsg_setPath(const char *path, UErrorCode *err)
|
|||
{
|
||||
UResourceBundle *b = NULL;
|
||||
b = ures_open(path, NULL, err);
|
||||
if(U_FAILURE(*err))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
gPath = uprv_strdup(path);
|
||||
gBundle = b;
|
||||
|
|
|
@ -46,7 +46,8 @@ static struct
|
|||
{ "files", 0, pkg_mode_files, "Uses raw data files (no effect). Installation copies all files to the target location." },
|
||||
#ifdef WIN32
|
||||
{ "dll", "library", pkg_mode_windows, "Generates one common data file and one shared library, <package>.dll"},
|
||||
{ "common", "archive", pkg_mode_windows, "Generates just the common file, <package>.dat"}
|
||||
{ "common", "archive", pkg_mode_windows, "Generates just the common file, <package>.dat"},
|
||||
{ "static", "static", pkg_mode_windows, "Generates one statically linked library, " LIB_PREFIX "<package>" UDATA_LIB_SUFFIX }
|
||||
#else /*#ifdef WIN32*/
|
||||
#ifdef UDATA_SO_SUFFIX
|
||||
{ "dll", "library", pkg_mode_dll, "Generates one shared library, <package>" UDATA_SO_SUFFIX },
|
||||
|
|
|
@ -121,6 +121,10 @@ SOURCE=.\pkgtypes.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\sttcmode.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\winmode.c
|
||||
# End Source File
|
||||
# End Group
|
||||
|
|
|
@ -64,6 +64,7 @@ void pkg_mode_windows(UPKGOptions *o, FileStream *makefile, UErrorCode *status)
|
|||
char tmp2[1024];
|
||||
const char *separator = o->icuroot[uprv_strlen(o->icuroot)-1]=='\\'?"":"\\";
|
||||
UBool isDll = (UBool)(uprv_strcmp(o->mode, "dll") == 0);
|
||||
UBool isStatic = (UBool)(uprv_strcmp(o->mode, "static") == 0);
|
||||
|
||||
if(U_FAILURE(*status)) {
|
||||
return;
|
||||
|
@ -113,6 +114,60 @@ void pkg_mode_windows(UPKGOptions *o, FileStream *makefile, UErrorCode *status)
|
|||
"!ENDIF\n\n");
|
||||
|
||||
|
||||
uprv_strcpy(tmp, UDATA_CMN_PREFIX);
|
||||
uprv_strcat(tmp, o->shortName);
|
||||
uprv_strcat(tmp, UDATA_CMN_INTERMEDIATE_SUFFIX);
|
||||
uprv_strcat(tmp, OBJ_SUFFIX);
|
||||
|
||||
sprintf(tmp2, "# intermediate obj file:\nCMNOBJTARGET=%s\n\n", tmp);
|
||||
T_FileStream_writeLine(makefile, tmp2);
|
||||
}
|
||||
else if (isStatic)
|
||||
{
|
||||
uprv_strcpy(tmp, LIB_PREFIX);
|
||||
uprv_strcat(tmp, o->shortName);
|
||||
uprv_strcat(tmp, UDATA_LIB_SUFFIX);
|
||||
|
||||
pkg_sttc_writeReadme(o, tmp, status);
|
||||
fprintf(stdout, "HEY! wrote to readme. -> %s\n", u_errorName(*status));
|
||||
|
||||
if(U_FAILURE(*status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(o->nooutput || o->verbose) {
|
||||
fprintf(stdout, "# Output %s file: %s%s%s\n", UDATA_SO_SUFFIX, o->targetDir, U_FILE_SEP_STRING, tmp);
|
||||
}
|
||||
|
||||
if(o->nooutput) {
|
||||
*status = U_ZERO_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
sprintf(tmp2, "# LIB file to make:\nDLLTARGET=%s\n\n", tmp);
|
||||
T_FileStream_writeLine(makefile, tmp2);
|
||||
|
||||
sprintf(tmp2,
|
||||
"LINK32 = LIB.exe\n"
|
||||
"LINK32_FLAGS = /nologo /out:\"$(TARGETDIR)\\$(DLLTARGET)\" /EXPORT:\"%s\"\n",
|
||||
o->shortName
|
||||
);
|
||||
T_FileStream_writeLine(makefile, tmp2);
|
||||
|
||||
sprintf(tmp2,
|
||||
"GENCCODE = $(ICUROOT)%sbin\\genccode.exe\n", separator);
|
||||
T_FileStream_writeLine(makefile, tmp2);
|
||||
|
||||
T_FileStream_writeLine(makefile, "\n"
|
||||
"# Windows specific LIB version information.\n"
|
||||
"!IF EXISTS(\".\\icudata.res\")\n"
|
||||
"DATA_VER_INFO=\".\\icudata.res\"\n"
|
||||
"!ELSE\n"
|
||||
"DATA_VER_INFO=\n"
|
||||
"!ENDIF\n\n");
|
||||
|
||||
|
||||
uprv_strcpy(tmp, UDATA_CMN_PREFIX);
|
||||
uprv_strcat(tmp, o->shortName);
|
||||
uprv_strcat(tmp, UDATA_CMN_INTERMEDIATE_SUFFIX);
|
||||
|
@ -140,12 +195,12 @@ void pkg_mode_windows(UPKGOptions *o, FileStream *makefile, UErrorCode *status)
|
|||
T_FileStream_writeLine(makefile, tmp2);
|
||||
|
||||
|
||||
if(isDll) {
|
||||
if(isDll || isStatic) {
|
||||
sprintf(tmp, "all: \"$(TARGETDIR)\\$(DLLTARGET)\"\n\n");
|
||||
T_FileStream_writeLine(makefile, tmp);
|
||||
|
||||
sprintf(tmp, "\"$(TARGETDIR)\\$(DLLTARGET)\": \"$(TARGETDIR)\\$(CMNOBJTARGET)\"\n"
|
||||
"\t@$(LINK32) $(LINK32_FLAGS) \"$(TARGETDIR)\\$(CMNOBJTARGET)\" $(DATA_VER_INFO)\n\n");
|
||||
"\t$(LINK32) $(LINK32_FLAGS) \"$(TARGETDIR)\\$(CMNOBJTARGET)\" $(DATA_VER_INFO)\n\n");
|
||||
T_FileStream_writeLine(makefile, tmp);
|
||||
sprintf(tmp, "\"$(TARGETDIR)\\$(CMNOBJTARGET)\": \"$(TARGETDIR)\\$(CMNTARGET)\"\n"
|
||||
"\t@\"$(GENCCODE)\" $(GENCOPTIONS) -e $(ENTRYPOINT) -o -d \"$(TARGETDIR)\" \"$(TARGETDIR)\\$(CMNTARGET)\"\n\n");
|
||||
|
@ -157,8 +212,7 @@ void pkg_mode_windows(UPKGOptions *o, FileStream *makefile, UErrorCode *status)
|
|||
"\t-@erase \"$(TARGETDIR)\\$(CMNOBJTARGET)\"\n"
|
||||
"\t-@erase \"$(TARGETDIR)\\$(CMNTARGET)\"\n\n");
|
||||
T_FileStream_writeLine(makefile, tmp2);
|
||||
} else {
|
||||
|
||||
} else { /* common */
|
||||
sprintf(tmp, "all: \"$(TARGETDIR)\\$(CMNTARGET)\"\n\n");
|
||||
T_FileStream_writeLine(makefile, tmp);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue