diff --git a/icu4c/source/common/unicode/pwin32.h b/icu4c/source/common/unicode/pwin32.h index 292e73a0efa..5d5003262e5 100644 --- a/icu4c/source/common/unicode/pwin32.h +++ b/icu4c/source/common/unicode/pwin32.h @@ -252,4 +252,7 @@ typedef unsigned int uint32_t; /* Programs used by ICU code */ /*===========================================================================*/ +#ifndef U_MAKE #define U_MAKE "nmake" +#define U_MAKE_IS_NMAKE 1 +#endif diff --git a/icu4c/source/config/mh-mingw b/icu4c/source/config/mh-mingw index 8ff362c815d..991090a7536 100644 --- a/icu4c/source/config/mh-mingw +++ b/icu4c/source/config/mh-mingw @@ -121,9 +121,8 @@ LDLIBRARYPATH_ENVVAR = PATH # The type of assembly to write for generating an object file GENCCODE_ASSEMBLY=-a gcc-cygwin -# These are needed to allow the pkgdata nmake files to work -PKGDATA_OPTS = -v -PKGDATA_INVOKE_OPTS = MAKEFLAGS= +# These are needed to allow the pkgdata GNU make files to work +CPPFLAGS +=-DU_MAKE=\"$(MAKE)\" ## End Cygwin/MinGW specific setup diff --git a/icu4c/source/tools/pkgdata/dllmode.c b/icu4c/source/tools/pkgdata/dllmode.c index fe68674691b..f3b70432388 100644 --- a/icu4c/source/tools/pkgdata/dllmode.c +++ b/icu4c/source/tools/pkgdata/dllmode.c @@ -21,7 +21,7 @@ #include "unicode/utypes.h" #include "unicode/putil.h" -#ifndef WIN32 +#ifndef U_MAKE_IS_NMAKE #include "cmemory.h" #include "cstring.h" #include "filestrm.h" @@ -285,5 +285,5 @@ void pkg_mode_dll(UPKGOptions *o, FileStream *makefile, UErrorCode *status) } -#endif /* #ifndef WIN32 */ +#endif /* #ifndef U_MAKE_IS_NMAKE */ diff --git a/icu4c/source/tools/pkgdata/make.c b/icu4c/source/tools/pkgdata/make.c index 82373401803..0d794ecca9d 100644 --- a/icu4c/source/tools/pkgdata/make.c +++ b/icu4c/source/tools/pkgdata/make.c @@ -26,7 +26,7 @@ #include "cstring.h" #include -#ifdef WIN32 +#ifdef U_MAKE_IS_NMAKE char linebuf[2048]; diff --git a/icu4c/source/tools/pkgdata/makefile.h b/icu4c/source/tools/pkgdata/makefile.h index 599ec94725b..0b1bbe9738d 100644 --- a/icu4c/source/tools/pkgdata/makefile.h +++ b/icu4c/source/tools/pkgdata/makefile.h @@ -41,9 +41,9 @@ pkg_mak_writeFooter(FileStream *f, const UPKGOptions *o); -#ifdef WIN32 +#ifdef U_MAKE_IS_NMAKE extern void pkg_mode_windows(UPKGOptions *o, FileStream *makefile, UErrorCode *status); -#else /*#ifdef WIN32*/ +#else /*#ifdef U_MAKE_IS_NMAKE*/ /** * Write stanzas for generating .o (and .c) files for each data file in 'o->filePaths'. * @param o Package options struct diff --git a/icu4c/source/tools/pkgdata/pkgdata.c b/icu4c/source/tools/pkgdata/pkgdata.c index d6e9cf18df1..041ebdbf7e6 100644 --- a/icu4c/source/tools/pkgdata/pkgdata.c +++ b/icu4c/source/tools/pkgdata/pkgdata.c @@ -59,17 +59,17 @@ 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 U_MAKE_IS_NMAKE { "dll", "library", pkg_mode_windows, "Generates one common data file and one shared library, .dll"}, { "common", "archive", pkg_mode_windows, "Generates just the common file, .dat"}, { "static", "static", pkg_mode_windows, "Generates one statically linked library, " LIB_PREFIX "" UDATA_LIB_SUFFIX } -#else /*#ifdef WIN32*/ +#else /*#ifdef U_MAKE_IS_NMAKE*/ #ifdef UDATA_SO_SUFFIX { "dll", "library", pkg_mode_dll, "Generates one shared library, " UDATA_SO_SUFFIX }, #endif { "common", "archive", pkg_mode_common, "Generates one common data file, .dat" }, { "static", "static", pkg_mode_static, "Generates one statically linked library, " LIB_PREFIX "" UDATA_LIB_SUFFIX } -#endif /*#ifdef WIN32*/ +#endif /*#ifdef U_MAKE_IS_NMAKE*/ }; static UOption options[]={ @@ -100,7 +100,7 @@ static UOption options[]={ const char options_help[][320]={ "Set the data name", -#ifdef WIN32 +#ifdef U_MAKE_IS_NMAKE "The directory where the ICU is located (e.g. which contains the bin directory)", #else "Specify options for the builder. (Autdetected if icu-config is available)", @@ -171,7 +171,7 @@ main(int argc, char* argv[]) { /* Try to fill in from icu-config or equivalent */ fillInMakefileFromICUConfig(&options[1]); } -#ifdef WIN32 +#ifdef U_MAKE_IS_NMAKE else { fprintf(stderr, "Warning: You are using the deprecated -O option\n" "\tYou can fix this warning by installing pkgdata, gencmn and genccode\n" @@ -287,7 +287,7 @@ main(int argc, char* argv[]) { } o.verbose = options[5].doesOccur; -#ifdef WIN32 /* format is R:pathtoICU or D:pathtoICU */ +#ifdef U_MAKE_IS_NMAKE /* format is R:pathtoICU or D:pathtoICU */ { char *pathstuff = (char *)options[1].value; if(options[1].value[uprv_strlen(options[1].value)-1] == '\\') { diff --git a/icu4c/source/tools/pkgdata/sttcmode.c b/icu4c/source/tools/pkgdata/sttcmode.c index a52a703cdac..5e3fd32fd42 100644 --- a/icu4c/source/tools/pkgdata/sttcmode.c +++ b/icu4c/source/tools/pkgdata/sttcmode.c @@ -105,7 +105,7 @@ void pkg_sttc_writeReadme(struct UPKGOptions_ *o, const char *libName, UErrorCod } -#ifndef WIN32 +#ifndef U_MAKE_IS_NMAKE #include "makefile.h" diff --git a/icu4c/source/tools/pkgdata/winmode.c b/icu4c/source/tools/pkgdata/winmode.c index fa650cedd33..11e922cabd2 100644 --- a/icu4c/source/tools/pkgdata/winmode.c +++ b/icu4c/source/tools/pkgdata/winmode.c @@ -18,7 +18,7 @@ #include "unicode/utypes.h" -#ifdef WIN32 +#ifdef U_MAKE_IS_NMAKE #include "unicode/putil.h" #include "cmemory.h"