8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 09:20:39 +01:00

MinGW port of ICU

This commit is contained in:
aafemt 2005-06-15 05:31:47 +00:00
parent 4cb51490dc
commit 060a7b1a6d
21 changed files with 6635 additions and 2660 deletions

View File

@ -157,7 +157,7 @@ case "$target" in
EDITLINE_FLG=N
RAW_DEVICES_FLG=N
SHRLIB_EXT=dll
ICU_PLATFORM=Cygwin
ICU_PLATFORM=MinGW
;;
*)

View File

@ -31,6 +31,7 @@ alpha*-*-linux-gnu)
else
icu_cv_host_frag=mh-cygwin-msvc
fi ;;
*-*-mingw*) icu_cv_host_frag=mh-mingw ;;
*-*-*bsd*) icu_cv_host_frag=mh-bsd-gcc ;;
*-*-aix*)
if test "$GCC" = yes; then

View File

@ -1251,7 +1251,7 @@ uprv_tzname(int n)
}
#endif
#ifdef U_TZNAME
#if U_TZNAME+1 != 1
return U_TZNAME[n];
#else
return "";

View File

@ -274,7 +274,7 @@ public:
* boundaries have been returned.
* @stable ICU 2.0
*/
#ifdef U_CYGWIN
#if defined(U_CYGWIN) || defined(U_MINGW)
static U_COMMON_API const int32_t DONE;
#else
static const int32_t DONE;

View File

@ -259,7 +259,7 @@ typedef unsigned int uint32_t;
#define U_EXPORT2
/* cygwin needs to export/import data */
#ifdef U_CYGWIN
#if defined(U_CYGWIN) || defined(U_MINGW)
#define U_IMPORT __declspec(dllimport)
#else
#define U_IMPORT

View File

@ -320,7 +320,7 @@ U_INTERNAL const char* U_EXPORT2 uprv_getDefaultLocaleID(void);
# define U_FILE_SEP_STRING ":"
# define U_FILE_ALT_SEP_STRING ":"
# define U_PATH_SEP_STRING ";"
#elif defined(WIN32) || defined(OS2)
#elif defined(_MSC_VER) || defined(OS2)
# define U_FILE_SEP_CHAR '\\'
# define U_FILE_ALT_SEP_CHAR '/'
# define U_PATH_SEP_CHAR ';'

View File

@ -41,7 +41,7 @@
/* which are contained in the platform-specific file platform.h */
/*==========================================================================*/
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
#if (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)) && defined(_MSC_VER)
# include "unicode/pwin32.h"
#elif defined(__OS400__)
# include "unicode/pos400.h"

View File

@ -282,7 +282,7 @@ public:
* Minimum value that can be stored in a UnicodeSet.
* @stable ICU 2.4
*/
#ifdef U_CYGWIN
#if defined(U_CYGWIN) || defined(U_MINGW)
static U_COMMON_API const UChar32 MIN_VALUE;
#else
static const UChar32 MIN_VALUE;
@ -292,7 +292,7 @@ public:
* Maximum value that can be stored in a UnicodeSet.
* @stable ICU 2.4
*/
#ifdef U_CYGWIN
#if defined(U_CYGWIN) || defined(U_MINGW)
static U_COMMON_API const UChar32 MAX_VALUE;
#else
static const UChar32 MAX_VALUE;

View File

@ -451,7 +451,7 @@ typedef void* UClassID;
* some Linux/Unix compilers have problems with defining global new/delete.
* On Windows, WIN32 is defined, and it is _MSC_Ver>=1200 for MSVC 6.0 and higher.
*/
#if defined(XP_CPLUSPLUS) && defined(WIN32) && (_MSC_Ver>=1200) && (defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_USTDIO_IMPLEMENTATION))
#if defined(XP_CPLUSPLUS) && defined(_MSC_Ver) && (_MSC_Ver>=1200) && (defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_USTDIO_IMPLEMENTATION))
/**
* Global operator new, defined only inside ICU4C, must not be used.

91
extern/icu/source/config/mh-mingw vendored Normal file
View File

@ -0,0 +1,91 @@
## -*-makefile-*-
## MinGW-specific setup
## Copyright (c) 1999-2004, International Business Machines Corporation and
## others. All Rights Reserved.
## Commands to generate dependency files
GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
## Flags for position independent code
SHAREDLIBCFLAGS =
SHAREDLIBCXXFLAGS =
SHAREDLIBCPPFLAGS = -DPIC
## Additional flags when building libraries and with threads
LIBCPPFLAGS = -D_REENTRANT
THREADSCPPFLAGS = -D_REENTRANT
## Compiler switch to embed a runtime search path
LD_RPATH=
LD_RPATH_PRE = -Wl,-rpath,
## Compiler switch to embed a library name
# The initial tab in the next line is to prevent icu-config from reading it.
LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
#SH# # We can't depend on MIDDLE_SO_TARGET being set.
#SH# LD_SONAME=
## Shared object suffix
SO = dll
LIBICU = $(ICUPREFIX)
## Non-shared intermediate object suffix
STATIC_O = a
## Compilation rules
%.$(STATIC_O): $(srcdir)/%.c
$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
%.o: $(srcdir)/%.c
$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
%.$(STATIC_O): $(srcdir)/%.cpp
$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
%.o: $(srcdir)/%.cpp
$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
## Dependency rules
%.d: $(srcdir)/%.c
@echo "generating dependency information for $<"
@$(SHELL) -ec '$(GEN_DEPS.c) $< \
| sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
[ -s $@ ] || rm -f $@'
%.d: $(srcdir)/%.cpp
@echo "generating dependency information for $<"
@$(SHELL) -ec '$(GEN_DEPS.cc) $< \
| sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
[ -s $@ ] || rm -f $@'
## Versioned target for a shared library.
## Since symbolic links don't work the same way on Windows,
## we only use the version major number.
#FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
FINAL_SO_TARGET=$(SO_TARGET)
MIDDLE_SO_TARGET=$(SO_TARGET)
## Versioned libraries rules
#%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
# $(RM) $@ && ln -s ${<F} $@
%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
## Bind internal references
# LDflags that pkgdata will use
BIR_LDFLAGS= -Wl,-Bsymbolic
# CPPflags for genccode/gencmn
BIR_CPPFLAGS= -DU_HAVE_BIND_INTERNAL_REFERENCES
# Dependencies [i.e. map files] for the final library
BIR_DEPS=
## Path
LDLIBRARYPATH_ENVVAR = PATH
## End MinGW-specific setup

File diff suppressed because it is too large Load Diff

View File

@ -865,7 +865,8 @@ case "${host}" in
*-*-aix*) platform=U_AIX ;;
*-*-hpux*) platform=U_HPUX ;;
*-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
*-*-cygwin*|*-*-mingw*) platform=U_CYGWIN ;;
*-*-cygwin*) platform=U_CYGWIN ;;
*-*-mingw*) platform=U_MINGW ;;
*-*ibm-openedition*|*-*-os390*) platform=OS390
ICUDATA_CHAR="e" ;;
*-*-os400*) platform=OS400

View File

@ -308,7 +308,7 @@ $(OUTTMPDIR)/$(COLLATION_TREE)/$(INDEX_NAME).txt: $(SRCLISTDEPS)
echo "// Warning this file is automatically generated" > $@; \
echo "$(INDEX_NAME) {" >> $@; \
echo " InstalledLocales {" >> $@; \
for file in $(INSTALLED_COL_FILES); do \
for file in "$(INSTALLED_COL_FILES)"; do \
echo " $$file {\"\"}" >> $@; \
done; \
echo " }" >> $@; \
@ -334,7 +334,7 @@ $(OUTTMPDIR)/$(INDEX_NAME).txt: $(SRCLISTDEPS)
echo "// Warning this file is automatically generated" > $@; \
echo "$(INDEX_NAME) {" >> $@; \
echo " InstalledLocales {" >> $@; \
for file in $(INSTALLED_RB_FILES); do \
for file in "$(INSTALLED_RB_FILES)"; do \
echo " $$file {\"\"}" >> $@; \
done; \
echo " }" >> $@; \

View File

@ -38,6 +38,7 @@ The following names can be supplied as the argument for platform:
BeOS Use the GNU C++ compiler on BeOS
Cygwin Use the GNU C++ compiler on Cygwin
Cygwin/MSVC Use the Microsoft Visual C++ compiler on Cygwin
MinGW Use GNU C++ compiler on Windows
FreeBSD Use the GNU C++ compiler on Free BSD
HP-UX11ACC Use the Advanced C++ compiler on HP-UX 11
HP-UX11CC Use HP's C++ compiler on HP-UX 11
@ -269,6 +270,12 @@ case $platform in
DEBUG_CFLAGS=
DEBUG_CXXFLAGS=
;;
MinGW)
THE_OS="Windows"
THE_COMP="the GNU C++"
RELEASE_CFLAGS='-O3'
RELEASE_CXXFLAGS='-O3'
;;
MacOSX)
THE_OS="MacOS X (Darwin)"
THE_COMP="the GNU C++"

View File

@ -20,7 +20,7 @@
#include <stdlib.h>
#include "unicode/utypes.h"
#ifndef WIN32
#ifndef _MSC_VER
#include "cmemory.h"
#include "cstring.h"
#include "filestrm.h"

View File

@ -25,7 +25,7 @@
#include "cstring.h"
#include <stdio.h>
#ifdef WIN32
#ifdef _MSC_VER
char linebuf[2048];

View File

@ -41,7 +41,7 @@ pkg_mak_writeFooter(FileStream *f, const UPKGOptions *o);
#ifdef WIN32
#ifdef _MSC_VER
extern void pkg_mode_windows(UPKGOptions *o, FileStream *makefile, UErrorCode *status);
#else /*#ifdef WIN32*/
/**

View File

@ -59,7 +59,7 @@ static struct
} modes[] =
{
{ "files", 0, pkg_mode_files, "Uses raw data files (no effect). Installation copies all files to the target location." },
#ifdef WIN32
#ifdef _MSC_VER
{ "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"},
{ "static", "static", pkg_mode_windows, "Generates one statically linked library, " LIB_PREFIX "<package>" UDATA_LIB_SUFFIX }
@ -101,7 +101,7 @@ static UOption options[]={
const char options_help[][320]={
"Set the data name",
#ifdef WIN32
#ifdef _MSC_VER
"The directory where the ICU is located (e.g. <ICUROOT> which contains the bin directory)",
#else
"Specify options for the builder. (Autdetected if icu-config is available)",
@ -173,7 +173,7 @@ main(int argc, char* argv[]) {
/* Try to fill in from icu-config or equivalent */
fillInMakefileFromICUConfig(&options[1]);
}
#ifdef WIN32
#ifdef _MSC_VER
else {
fprintf(stderr, "Warning: You are using the deprecated -O option\n"
"\tYou can fix this warning by installing pkgdata, gencmn and genccode\n"
@ -295,7 +295,7 @@ main(int argc, char* argv[]) {
}
o.verbose = options[5].doesOccur;
#ifdef WIN32 /* format is R:pathtoICU or D:pathtoICU */
#ifdef _MSC_VER /* format is R:pathtoICU or D:pathtoICU */
{
char *pathstuff = (char *)options[1].value;
if(options[1].value[uprv_strlen(options[1].value)-1] == '\\') {
@ -440,7 +440,7 @@ static int executeMakefile(const UPKGOptions *o)
}
/*getcwd(pwd, 1024);*/
#ifdef WIN32
#ifdef _MSC_VER
sprintf(cmd, "%s %s%s -f \"%s\" %s %s %s %s",
make,
o->install ? "INSTALLTO=" : "",
@ -697,7 +697,7 @@ static void fillInMakefileFromICUConfig(UOption *option)
option->doesOccur = TRUE;
#else /* ! U_HAVE_POPEN */
#ifdef WIN32
#ifdef _MSC_VER
char pathbuffer[_MAX_PATH] = {0};
char *fullEXEpath = NULL;
char *pathstuff = NULL;

View File

@ -141,11 +141,7 @@ typedef struct UPKGOptions_
/* set up common defines for library naming */
#ifdef WIN32
# ifndef UDATA_SO_SUFFIX
# define UDATA_SO_SUFFIX ".DLL"
# endif
# define LIB_PREFIX ""
#ifdef _MSC_VER
# define LIB_STATIC_PREFIX ""
# define OBJ_SUFFIX ".obj"
# define UDATA_LIB_SUFFIX ".LIB"
@ -163,6 +159,17 @@ typedef struct UPKGOptions_
# define UDATA_LIB_SUFFIX ".a"
#endif
#ifdef WIN32
#ifdef LIB_PREFIX
#undef LIB_PREFIX
#endif
#define LIB_PREFIX ""
#ifdef UDATA_SO_SUFFIX
#undef UDATA_SO_SUFFIX
#endif
#define UDATA_SO_SUFFIX ".DLL"
#endif
#define ASM_SUFFIX ".s"

View File

@ -104,7 +104,7 @@ void pkg_sttc_writeReadme(struct UPKGOptions_ *o, const char *libName, UErrorCod
}
#ifndef WIN32
#ifndef _MSC_VER
#include "makefile.h"

View File

@ -18,7 +18,7 @@
#include "unicode/utypes.h"
#ifdef WIN32
#ifdef _MSC_VER
#include "unicode/putil.h"
#include "cmemory.h"