]> granicus.if.org Git - icu/commitdiff
ICU-8535 Merge changes for MINGW build fix in branch to trunk and fix some other...
authorMichael Ow <mow@svn.icu-project.org>
Tue, 28 Jun 2011 21:07:36 +0000 (21:07 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Tue, 28 Jun 2011 21:07:36 +0000 (21:07 +0000)
X-SVN-Rev: 30247

icu4c/source/common/Makefile.in
icu4c/source/common/putil.cpp
icu4c/source/common/unicode/umachine.h
icu4c/source/tools/pkgdata/pkgdata.cpp

index f99a5db1d857beaa4d85ed16bacf28171f25c309..998a18922f842a206032904e56d2f2272a7967d4 100644 (file)
@@ -62,7 +62,7 @@ CPPFLAGS += -I$(top_builddir)/common
 endif
 CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/i18n $(LIBCPPFLAGS) $(CPPFLAGSICUUC)
 # we want DEFS here, because we want icucfg.h
-DEFS += -DU_COMMON_IMPLEMENTATION @DEFS@ 
+DEFS += -DU_COMMON_IMPLEMENTATION -DU_HAVE_ICUCFG 
 LDFLAGS += $(LDFLAGSICUUC)
 
 # for plugin configuration
index 978ab85fac28106242d623a4c81a16f80bac499e..5feca1b127286c44c7febaf7498e110d5e18e909 100644 (file)
@@ -77,7 +77,7 @@ Cleanly installed Solaris can use this #define.
 #include <float.h>
 
 /* include system headers */
-#ifdef U_WINDOWS
+#if defined(U_WINDOWS) || defined(__MINGW32__)
 #   define WIN32_LEAN_AND_MEAN
 #   define VC_EXTRALEAN
 #   define NOUSER
@@ -143,7 +143,7 @@ Cleanly installed Solaris can use this #define.
  * Simple things (presence of functions, etc) should just go in configure.in and be added to
  * icucfg.h via autoheader.
  */
-#if defined(HAVE_CONFIG_H)
+#if defined(U_HAVE_ICUCFG)
 #include "icucfg.h"
 #endif
 
@@ -176,7 +176,7 @@ static const BitPatternConversion gInf = { (int64_t) INT64_C(0x7FF0000000000000)
   functions).
   ---------------------------------------------------------------------------*/
 
-#if defined(U_WINDOWS) || defined(XP_MAC) || defined(OS400)
+#if defined(U_WINDOWS) || defined(XP_MAC) || defined(OS400) || defined(__MINGW32__)
 #   undef U_POSIX_LOCALE
 #else
 #   define U_POSIX_LOCALE    1
@@ -613,7 +613,7 @@ uprv_maximumPtr(void * base)
 U_CAPI void U_EXPORT2
 uprv_tzset()
 {
-#ifdef U_TZSET
+#if defined(U_TZSET) && !defined(__MINGW32__)
     U_TZSET();
 #else
     /* no initialization*/
@@ -1048,7 +1048,7 @@ uprv_tzname(int n)
 #endif
 
 #ifdef U_TZNAME
-#ifdef U_WINDOWS
+#if defined(U_WINDOWS) || defined(__MINGW32__)
     /* The return value is free'd in timezone.cpp on Windows because
      * the other code path returns a pointer to a heap location. */
     return uprv_strdup(U_TZNAME[n]);
@@ -1568,7 +1568,7 @@ The leftmost codepage (.xxx) wins.
 
     return posixID;
 
-#elif defined(U_WINDOWS)
+#elif defined(U_WINDOWS) || defined(__MINGW32__)
     UErrorCode status = U_ZERO_ERROR;
     LCID id = GetThreadLocale();
     const char* locID = uprv_convertToPosix(id, &status);
index a587883fb3cdb4384fa1dc5e782281c84a4bfc46..afd32b0e58c823dad059385bc81da2721bc6bfdf 100644 (file)
@@ -43,7 +43,7 @@
 
 #if defined(U_PALMOS)
 #   include "unicode/ppalmos.h"
-#elif /*!defined(__MINGW32__) && */(defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64))
+#elif !defined(__MINGW32__) && (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64))
 /*
  * platform.h is now also generated by MSVC Solution/Project files
  * from platform.win and should always be included unless you are
index 9819dd93fe689916082867ea9f406a9c83421198..cf37177878f1e25a2bcb75d91160ea1b469f1809 100644 (file)
@@ -850,7 +850,7 @@ static void createFileNames(UPKGOptions *o, const char mode, const char *version
         }
 
         if (version != NULL) {
-#ifdef U_CYGWIN
+#if defined(U_CYGWIN) && !defined(__MINGW32__)
             sprintf(libFileNames[LIB_FILE_CYGWIN], "cyg%s.%s",
                     libName,
                     pkgDataFlags[SO_EXT]);
@@ -1003,7 +1003,12 @@ static int32_t pkg_installLibrary(const char *installDir, const char *targetDir)
     }
 #endif
 
+#if defined (__MINGW32__)
+    /* On MINGW, symbolic links don't need to be created. */
+    return result;
+#else
     return pkg_createSymLinks(installDir, TRUE);
+#endif
 }
 
 static int32_t pkg_installCommonMode(const char *installDir, const char *fileName) {
@@ -1216,7 +1221,7 @@ static int32_t pkg_generateLibraryFile(const char *targetDir, const char mode, c
             }
             freeCmd = TRUE;
         }
-#ifdef U_CYGWIN
+#if defined(U_CYGWIN) && !defined(__MINGW32__)
         sprintf(cmd, "%s%s%s %s -o %s%s %s %s%s %s %s",
                 pkgDataFlags[GENLIB],
                 targetDir,
@@ -1692,7 +1697,7 @@ static UPKGOptions *pkg_checkFlag(UPKGOptions *o) {
             T_FileStream_close(f);
         }
     }
-#elif defined(U_CYGWIN)
+#elif defined(U_CYGWIN)  && !defined(__MINGW32__)
     /* Cygwin needs to change flag options. */
     char *flag = NULL;
     int32_t length = 0;