diff --git a/mps/code/commpre9.nmk b/mps/code/commpre9.nmk
new file mode 100644
index 00000000000..ac382baa818
--- /dev/null
+++ b/mps/code/commpre9.nmk
@@ -0,0 +1,238 @@
+# commpre.nmk: FIRST COMMON FRAGMENT FOR PLATFORMS USING MV AND NMAKE
+#
+# $Id$
+# Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
+#
+# DESCRIPTION
+#
+# .description: This makefile fragment is included in more specific
+# makefiles for platforms which use the "mv" builder. This is
+# the first of two common makefile fragements (the other is commpost.nmk).
+# Alas, due to shortcomings in nmake, it is not possible to use only one
+# common fragment.
+#
+# %%PART: Add a new parameter for the files included in the part
+# Parameters:
+# PFM platform code, e.g. "nti3mv"
+# PFMDEFS /D options to define platforms preprocessor symbols
+# to the compiler. Eg "/DOS_NT /DARCH_386 /DBUILD_MVC"
+# MPM list of sources which make up the "mpm" part for this
+# platform. Each source is stripped of its .c extension
+# and surrounded in angle brackets (<>)
+# PLINTH as above for the "plinth" part
+# AMC as above for the "amc" part
+# AMS as above for the "ams" part
+# LO as above for the "lo" part
+# MRG as above for the "mrg" part
+# SW as above for the "sw" part
+# TESTLIB as above for the "testlib" part
+# NOISY if defined, causes command to be emitted
+#
+#
+# EDITING
+#
+# To add new targets. varieties, and parts:
+# Search for the string "%%TARGET", "%%VARIETY", or "%%PART" in this makefile
+# and follow the instructions. If you're adding a part, you'll have to change
+# the makefile for all the platforms which use this makefile to define the
+# source list for that part.
+#
+
+# CHECK PARAMETERS
+#
+#
+# %%PART: Add checks for the parameter with the sources for the new part.
+
+!IFNDEF PFM
+!ERROR commpre.nmk: PFM not defined
+!ENDIF
+!IFNDEF PFMDEFS
+!ERROR commpre.nmk: PFMDEFS not defined
+!ENDIF
+!IFNDEF MPM
+!ERROR commpre.nmk: MPM not defined
+!ENDIF
+!IFNDEF PLINTH
+!ERROR commpre.nmk: PLINTH not defined
+!ENDIF
+!IFNDEF LO
+!ERROR commpre.nmk: LO not defined
+!ENDIF
+!IFNDEF AMC
+!ERROR commpre.nmk: AMC not defined
+!ENDIF
+!IFNDEF AMS
+!ERROR commpre.nmk: AMS not defined
+!ENDIF
+!IFNDEF SW
+!ERROR commpre.nmk: SW not defined
+!ENDIF
+!IFNDEF TESTLIB
+!ERROR commpre.nmk: TESTLIB not defined
+!ENDIF
+
+
+# DECLARATIONS
+
+
+!IFDEF NOISY
+ECHO = rem
+!ELSE
+.SILENT:
+ECHO = echo
+!ENDIF
+
+
+# C FLAGS
+
+# /MD means compile for multi-threaded environment with separate C library DLL.
+# /MT means compile for multi-threaded environment.
+# /ML means compile for single-threaded environment.
+# A 'd' at the end means compile for debugging.
+
+!ifdef TARGET
+!if "$(TARGET)" == "mmsw.lib" || "$(TARGET)" == "epvmss.exe" || "$(TARGET)" == "replaysw.exe"
+CFLAGSTARGETPRE = /DCONFIG_PROD_EPCORE
+CFLAGSTARGETPOST =
+CRTFLAGSW = /MD
+CRTFLAGSH = /MDd
+CRTFLAGSC = /MDd
+LINKFLAGSWHITE = msvcrt.lib
+LINKFLAGSHOT = msvcrtd.lib
+LINKFLAGSCOOL = msvcrtd.lib
+
+!elseif "$(TARGET)" == "mmdw.lib"
+# /Oy- is actually 86-specific, but Dylan is only built for that platform
+CFLAGSTARGETPRE = /DCONFIG_PROD_DYLAN
+CFLAGSTARGETPOST = /Oy-
+CRTFLAGSW = /MT
+CRTFLAGSH = /MT
+CRTFLAGSC = /MT
+LINKFLAGSWHITE = libcmt.lib
+LINKFLAGSHOT = libcmt.lib
+LINKFLAGSCOOL = libcmt.lib
+
+!else
+CFLAGSTARGETPRE = /DCONFIG_PROD_MPS
+CFLAGSTARGETPOST =
+CRTFLAGSW = /MT
+CRTFLAGSH = /MT
+CRTFLAGSC = /MTd
+LINKFLAGSWHITE = libcmt.lib
+LINKFLAGSHOT = libcmt.lib
+LINKFLAGSCOOL = libcmtd.lib
+!endif
+!endif
+
+CFLAGSCOMMONPRE = /nologo /W4 /WX $(PFMDEFS) $(CFLAGSTARGETPRE)
+CFLAGSCOMMONPOST = $(CFLAGSTARGETPOST)
+
+# Flags for use in the variety combinations
+CFLAGSHOT = /O2 /DNDEBUG
+# We used to have /GZ here (stack probe).
+# Note that GZ is specific to version 12 of the cl tool. drj 2003-11-04
+# It is ignored on earlier versions of the cl tool.
+# /GZ here generates a dependency on the C library and when we are
+# building a DLL, mpsdy.dll, the linker step will fail (error LNK2001:
+# unresolved external symbol __chkesp). See
+# http://support.microsoft.com/kb/q191669/
+CFLAGSCOOL = /Od
+CFLAGSINTERNAL = /Zi
+CFLAGSEXTERNAL =
+
+# The combinations of variety
+# %%VARIETY: Define a macro containing the set of flags for the new variety.
+CFWE = /DCONFIG_VAR_WE $(CRTFLAGSW) $(CFLAGSHOT) $(CFLAGSEXTERNAL)
+CFWI = /DCONFIG_VAR_WI $(CRTFLAGSW) $(CFLAGSHOT) $(CFLAGSINTERNAL)
+CFHE = /DCONFIG_VAR_HE $(CRTFLAGSH) $(CFLAGSHOT) $(CFLAGSEXTERNAL)
+CFHI = /DCONFIG_VAR_HI $(CRTFLAGSH) $(CFLAGSHOT) $(CFLAGSINTERNAL)
+CFDI = /DCONFIG_VAR_DI $(CRTFLAGSH) $(CFLAGSHOT) $(CFLAGSINTERNAL)
+CFCE = /DCONFIG_VAR_CE $(CRTFLAGSC) $(CFLAGSCOOL) $(CFLAGSEXTERNAL)
+CFCI = /DCONFIG_VAR_CI $(CRTFLAGSC) $(CFLAGSCOOL) $(CFLAGSINTERNAL)
+CFTI = /DCONFIG_VAR_TI $(CRTFLAGSC) $(CFLAGSCOOL) $(CFLAGSINTERNAL)
+
+# Microsoft documentation is not very clear on the point of using both
+# optimization and debug information
+
+# LINKER FLAGS
+# %%VARIETY: define a macro containing the flags for the new variety
+LINKER = link
+LINKFLAGSCOMMON = /nologo
+LINKFLAGSINTERNAL =
+LINKFLAGSEXTERNAL = /RELEASE
+
+LFWE = $(LINKFLAGSWHITE) $(LINKFLAGSEXTERNAL)
+LFWI = $(LINKFLAGSWHITE) $(LINKFLAGSINTERNAL)
+LFHE = $(LINKFLAGSHOT) $(LINKFLAGSEXTERNAL)
+LFHI = $(LINKFLAGSHOT) $(LINKFLAGSINTERNAL)
+LFDI = $(LINKFLAGSHOT) $(LINKFLAGSINTERNAL)
+LFCE = $(LINKFLAGSCOOL) $(LINKFLAGSEXTERNAL)
+LFCI = $(LINKFLAGSCOOL) $(LINKFLAGSINTERNAL)
+LFTI = $(LINKFLAGSCOOL) $(LINKFLAGSINTERNAL)
+
+#LFCV = /PROFILE /DEBUG:full /DEBUGTYPE:cv
+
+# Library manager
+# %%VARIETY: define a macro containing the flags for the new variety
+LIBMAN = lib # can't call this LIB - it screws the environment
+LIBFLAGSCOMMON = /nologo
+LIBFLAGSWE =
+LIBFLAGSWI =
+LIBFLAGSHE =
+LIBFLAGSHI =
+LIBFLAGSDI =
+LIBFLAGSCE =
+LIBFLAGSCI =
+LIBFLAGSTI =
+#LIBFLAGSCV =
+
+# Browser database manager [not used at present]
+#BSC = bscmake
+#BSCFLAGS = /nologo /n
+
+
+# == Common definitions ==
+# %%PART: Add your part here, unless it's platform-specific
+# [It is not possible use a macro, like $(PFM), in a substitution,
+# hence all parts end up being platform-specific.]
+
+
+# C. COPYRIGHT AND LICENSE
+#
+# Copyright (C) 2001-2002 Ravenbrook Limited .
+# All rights reserved. This is an open source license. Contact
+# Ravenbrook for commercial licensing options.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# 3. Redistributions in any form must be accompanied by information on how
+# to obtain complete source code for this software and any accompanying
+# software that uses this software. The source code must either be
+# included in the distribution or be available for no more than the cost
+# of distribution plus a nominal fee, and must be freely redistributable
+# under reasonable conditions. For an executable file, complete source
+# code means the source code for all modules it contains. It does not
+# include source code for modules or files that typically accompany the
+# major components of the operating system on which the executable file
+# runs.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/mps/code/mpstd.h b/mps/code/mpstd.h
index 152bf819206..fb721e8bdda 100644
--- a/mps/code/mpstd.h
+++ b/mps/code/mpstd.h
@@ -16,6 +16,44 @@
#ifndef mpstd_h
#define mpstd_h
+/* DESIGN NOTES
+ * ------------
+ * [These should be moved to a proper buildsys design doc. RHSK]
+ *
+ * mpstd.h does two main things:
+ * 1. platform detection by looking at preprocessor symbols;
+ * 2. setting variables (eg. MPS_PF_STRING, MPS_WORD_WIDTH).
+ *
+ * Sometimes the platform is *already* known by the buildsystem:
+ * - the Global Graphics buildsystem always sets CONFIG_PF_*.
+ * - the Ravenbrook buildsystem knows the platform and may (but
+ * typically does not) set CONFIG_PF_*.
+ *
+ * Regardless of this, mpstd.h still attempts to detect the platform.
+ * (This is intentional). However if both CONFIG_PF_* and
+ * CONFIG_PF_STRING are set, then mpstd.h performs a third function:
+ * 3. checking that the detected platform corresponds to that
+ * specified by CONFIG_PF_*.
+ *
+ * Sometimes no MPS buildsystem is in use, so the platform *must*
+ * be detected. For example, when client software #includes mps.h,
+ * we want it to just work out of the box with whatever compiler is
+ * being used. In other words we do not require the client to define
+ * CONFIG_PF_*.
+ * (This is the case that justifes mpstd.h doing platform detection
+ * by looking at preprocessor symbols; otherwise we'd simply use
+ * CONFIG_PF_*).
+ *
+ * mpstd.h fails if it cannot detect the platform (even if CONFIG_PF_*
+ * is specified). This is intentional. mpstd.h does *not* allow
+ * CONFIG_PF_* to override the platform as detected from preprocessor
+ * symbols. This is intentional.
+ *
+ * References:
+ * GG buildsys use of CONFIG_PF_*:
+ *
+ */
+
/* Irix 5/6 man cc and man abi. We can't check for _ABIO32 (see
* os.i5), as we have to support Irix 5.2, which doesn't define it. We
@@ -25,9 +63,11 @@
* them. Alignment from testing.
*/
-#if defined(CONFIG_PF_I5M2CC) \
- || defined(__sgi) && defined(__unix) && defined(__mips) \
- && defined(_SYSTYPE_SVR4) && (_MIPS_FPSET == 16)
+#if defined(__sgi) && defined(__unix) && defined(__mips) \
+ && defined(_SYSTYPE_SVR4) && (_MIPS_FPSET == 16)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_I5M2CC)
+#error "specified CONFIG_PF_... inconsistent with detected i5m2cc"
+#endif
#define MPS_PF_I5M2CC
#define MPS_PF_STRING "i5m2cc"
#define MPS_OS_I5
@@ -40,9 +80,11 @@
/* See above. Alignment from testing. */
-#elif defined(CONFIG_PF_IAM4CC) \
- || defined(__sgi) && defined(__unix) && defined(__mips) \
- && defined(_SYSTYPE_SVR4) && defined(_ABIN32)
+#elif defined(__sgi) && defined(__unix) && defined(__mips) \
+ && defined(_SYSTYPE_SVR4) && defined(_ABIN32)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_IAM4CC)
+#error "specified CONFIG_PF_... inconsistent with detected iam4cc"
+#endif
#define MPS_PF_IAM4CC
#define MPS_PF_STRING "iam4cc"
#define MPS_OS_IA
@@ -55,8 +97,10 @@
/* winnt.h from MS VC 2.0 */
-#elif defined(CONFIG_PF_W3ALMV) \
- || defined(_MSC_VER) && defined(_WIN32) && defined(_M_ALPHA)
+#elif defined(_MSC_VER) && defined(_WIN32) && defined(_M_ALPHA)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_W3ALMV)
+#error "specified CONFIG_PF_... inconsistent with detected w3almv"
+#endif
#define MPS_PF_W3ALMV
#define MPS_PF_STRING "w3almv"
#define MPS_OS_W3
@@ -69,8 +113,10 @@
/* winnt.h from MS VC 2.0 */
-#elif defined(CONFIG_PF_W3PPMV) \
- || defined(_MSC_VER) && defined(_WIN32) && defined(_M_PPC)
+#elif defined(_MSC_VER) && defined(_WIN32) && defined(_M_PPC)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_W3PPMV)
+#error "specified CONFIG_PF_... inconsistent with detected w3ppmv"
+#endif
#define MPS_PF_W3PPMV
#define MPS_PF_STRING "w3ppmv"
#define MPS_OS_W3
@@ -81,6 +127,24 @@
#define MPS_WORD_SHIFT 5
#define MPS_PF_ALIGN 4
+/* w3i3m9 clone-platform, differs from w3i3mv only in MPS_PF_STRING
+ * and compiler options.
+ */
+
+#elif defined(_MSC_VER) && (_MSC_VER >= 1500) && defined(_WIN32) && defined(_M_IX86)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_W3I3M9)
+#error "specified CONFIG_PF_... inconsistent with detected w3i3m9"
+#endif
+#define MPS_PF_W3I3MV
+#define MPS_PF_STRING "w3i3m9"
+#define MPS_OS_W3
+#define MPS_ARCH_I3
+#define MPS_BUILD_MV
+#define MPS_T_WORD unsigned long
+#define MPS_WORD_WIDTH 32
+#define MPS_WORD_SHIFT 5
+#define MPS_PF_ALIGN 8
+
/* Visual C++ 2.0, Books Online, C/C++ Book, Preprocessor Reference,
* Chapter 1: The Preprocessor, Macros, Predefined Macros.
* Alignment of 4 would work, but the MS library uses 8 bytes for
@@ -88,8 +152,10 @@
* VC malloc is 16!
*/
-#elif defined(CONFIG_PF_W3I3MV) \
- || defined(_MSC_VER) && defined(_WIN32) && defined(_M_IX86)
+#elif defined(_MSC_VER) && defined(_WIN32) && defined(_M_IX86)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_W3I3MV)
+#error "specified CONFIG_PF_... inconsistent with detected w3i3mv"
+#endif
#define MPS_PF_W3I3MV
#define MPS_PF_STRING "w3i3mv"
#define MPS_OS_W3
@@ -104,8 +170,10 @@
* a way to determine the OS -- we assume MacOS 7.
*/
-#elif defined(CONFIG_PF_S760MW) \
- || (defined(__MWERKS__) && __MC68K__ == 1)
+#elif (defined(__MWERKS__) && __MC68K__ == 1)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_S760MW)
+#error "specified CONFIG_PF_... inconsistent with detected s760mw"
+#endif
#define MPS_PF_S760MW
#define MPS_PF_STRING "s760mw"
#define MPS_OS_S7
@@ -120,8 +188,10 @@
* a way to determine the OS -- we assume MacOS 7.
*/
-#elif defined(CONFIG_PF_S7PPMW) \
- || defined(__MWERKS__) && __POWERPC__ == 1
+#elif defined(__MWERKS__) && __POWERPC__ == 1
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_S7PPMW)
+#error "specified CONFIG_PF_... inconsistent with detected s7ppmw"
+#endif
#define MPS_PF_S7PPMW
#define MPS_PF_STRING "s7ppmw"
#define MPS_OS_S7
@@ -138,8 +208,10 @@
* which lets us determine the system version.
*/
-#elif defined(CONFIG_PF_S760AC) \
- || defined(m68k) && (defined (applec) || defined(__SC__))
+#elif defined(m68k) && (defined (applec) || defined(__SC__))
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_S760AC)
+#error "specified CONFIG_PF_... inconsistent with detected s760ac"
+#endif
#define MPS_PF_S760AC
#define MPS_PF_STRING "s760ac"
#define MPS_OS_S7
@@ -156,8 +228,10 @@
* which lets us determine the system version.
*/
-#elif defined(CONFIG_PF_S7PPAC) \
- || defined(__PPCC__) || (defined(__MRC__) && defined(__POWERPC))
+#elif defined(__PPCC__) || (defined(__MRC__) && defined(__POWERPC))
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_S7PPAC)
+#error "specified CONFIG_PF_... inconsistent with detected s7ppac"
+#endif
#define MPS_PF_S7PPAC
#define MPS_PF_STRING "s7ppac"
#define MPS_OS_S7
@@ -173,9 +247,11 @@
* ools/Preprocessor/Preprocessor.[ef].html>
*/
-#elif defined(CONFIG_PF_XCPPGC) \
- || defined(__APPLE__) && defined(__ppc__) && defined(__MACH__) \
- && defined(__GNUC__)
+#elif defined(__APPLE__) && defined(__ppc__) && defined(__MACH__) \
+ && defined(__GNUC__)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_XCPPGC)
+#error "specified CONFIG_PF_... inconsistent with detected xcppgc"
+#endif
#define MPS_PF_XCPPGC
#define MPS_PF_STRING "xcppgc"
#define MPS_OS_XC
@@ -191,9 +267,11 @@
* And above for xcppgc.
*/
-#elif defined(CONFIG_PF_XCI3GC) \
- || defined(__APPLE__) && defined(__i386__) && defined(__MACH__) \
- && defined(__GNUC__)
+#elif defined(__APPLE__) && defined(__i386__) && defined(__MACH__) \
+ && defined(__GNUC__)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_XCI3GC)
+#error "specified CONFIG_PF_... inconsistent with detected xci3gc"
+#endif
#define MPS_PF_XCI3GC
#define MPS_PF_STRING "xci3gc"
#define MPS_OS_XC
@@ -206,9 +284,11 @@
/* GCC 2.5.8, gcc -E -dM, (__SVR4 indicates Solaris) */
-#elif defined(CONFIG_PF_SUS8GC) \
- || defined(__sun__) && defined(__sparc__) && defined(__GNUC__) \
- && !defined(__svr4__)
+#elif defined(__sun__) && defined(__sparc__) && defined(__GNUC__) \
+ && !defined(__svr4__)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_SUS8GC)
+#error "specified CONFIG_PF_... inconsistent with detected sus8gc"
+#endif
#define MPS_PF_SUS8GC
#define MPS_PF_STRING "sus8gc"
#define MPS_OS_SU
@@ -221,9 +301,11 @@
/* LCC 3.4 (ish), man page */
-#elif defined(CONFIG_PF_SUS8LC) \
- || defined(sun) && defined(sparc) && defined(__LCC__) \
- && !defined(__svr4__)
+#elif defined(sun) && defined(sparc) && defined(__LCC__) \
+ && !defined(__svr4__)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_SUS8LC)
+#error "specified CONFIG_PF_... inconsistent with detected sus8lc"
+#endif
#define MPS_PF_SUS8LC
#define MPS_PF_STRING "sus8lc"
#define MPS_OS_SU
@@ -236,9 +318,11 @@
/* GCC 2.5.8, gcc -E -dM */
-#elif defined(CONFIG_PF_SOS8GC) \
- || defined(__sun__) && defined(__sparc__) && defined(__GNUC__) \
- && defined(__svr4__)
+#elif defined(__sun__) && defined(__sparc__) && defined(__GNUC__) \
+ && defined(__svr4__)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_SOS8GC)
+#error "specified CONFIG_PF_... inconsistent with detected sos8gc"
+#endif
#define MPS_PF_SOS8GC
#define MPS_PF_STRING "sos8gc"
#define MPS_OS_SO
@@ -254,9 +338,11 @@
* macros for that.
*/
-#elif defined(CONFIG_PF_SOS9SC) \
- || defined(__sun) && defined(__SUNPRO_C) && defined(__SVR4) \
- && defined(__sparc)
+#elif defined(__sun) && defined(__SUNPRO_C) && defined(__SVR4) \
+ && defined(__sparc)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_SOS9SC)
+#error "specified CONFIG_PF_... inconsistent with detected sos9sc"
+#endif
#define MPS_PF_SOS9SC
#define MPS_PF_STRING "sos9sc"
#define MPS_OS_SO
@@ -269,8 +355,10 @@
/* GCC 2.6.3, gcc -E -dM */
-#elif defined(CONFIG_PF_O1ALGC) \
- || defined(__osf__) && defined(__alpha__) && defined(__GNUC__)
+#elif defined(__osf__) && defined(__alpha__) && defined(__GNUC__)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_O1ALGC)
+#error "specified CONFIG_PF_... inconsistent with detected o1algc"
+#endif
#define MPS_PF_O1ALGC
#define MPS_PF_STRING "o1algc"
#define MPS_OS_O1
@@ -283,8 +371,10 @@
/* From the cc(1) man page */
-#elif defined(CONFIG_PF_O1ALCC) \
- || defined(__osf__) && defined(__alpha) && defined(__DECC)
+#elif defined(__osf__) && defined(__alpha) && defined(__DECC)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_O1ALCC)
+#error "specified CONFIG_PF_... inconsistent with detected o1alcc"
+#endif
#define MPS_PF_O1ALCC
#define MPS_PF_STRING "o1alcc"
#define MPS_OS_O1
@@ -300,8 +390,10 @@
* all 4.
*/
-#elif defined(CONFIG_PF_LII4GC) \
- || defined(__linux__) && defined(__i386__) && defined(__GNUC__)
+#elif defined(__linux__) && defined(__i386__) && defined(__GNUC__)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_LII4GC)
+#error "specified CONFIG_PF_... inconsistent with detected lii4gc"
+#endif
#define MPS_PF_LII4GC
#define MPS_PF_STRING "lii4gc"
#define MPS_OS_LI
@@ -314,8 +406,10 @@
/* GCC 2.7.2, gcc -E -dM */
-#elif defined(CONFIG_PF_LIPPGC) \
- || defined(__linux__) && defined(__PPC__) && defined(__GNUC__)
+#elif defined(__linux__) && defined(__PPC__) && defined(__GNUC__)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_LIPPGC)
+#error "specified CONFIG_PF_... inconsistent with detected lippgc"
+#endif
#define MPS_PF_LIPPGC
#define MPS_PF_STRING "lippgc"
#define MPS_OS_LI
@@ -329,8 +423,10 @@
/* GCC 2.95.3, gcc -E -dM
*/
-#elif defined(CONFIG_PF_FRI4GC) \
- || defined(__FreeBSD__) && defined (__i386__) && defined (__GNUC__)
+#elif defined(__FreeBSD__) && defined (__i386__) && defined (__GNUC__)
+#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_FRI4GC)
+#error "specified CONFIG_PF_... inconsistent with detected fri4gc"
+#endif
#define MPS_PF_FRI4GC
#define MPS_PF_STRING "fri4gc"
#define MPS_OS_FR
@@ -351,7 +447,7 @@
/* C. COPYRIGHT AND LICENSE
*
- * Copyright (C) 2001-2002 Ravenbrook Limited .
+ * Copyright (C) 2001-2002,2008 Ravenbrook Limited .
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*
diff --git a/mps/code/w3i3m9.nmk b/mps/code/w3i3m9.nmk
new file mode 100644
index 00000000000..f1ea0c0f557
--- /dev/null
+++ b/mps/code/w3i3m9.nmk
@@ -0,0 +1,371 @@
+# w3i3m9.nmk: WINDOWS (INTEL) NMAKE FILE -- VC9 CLONE
+#
+# $Id$
+# Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
+
+
+# This is a clone of w3i3mv, for experimenting with compiler & linker
+# options for VC9 (Visual C++ 9.0).
+# Differences:
+# - compiler & linker options, as set in this file;
+# - built in w3i3m9 directory (ie. separate from w3i3mv);
+# - MPS_PF_STRING is "w3i3m9".
+# Otherwise it is the same. In particular:
+# - it still defines "MPS_BUILD_MV";
+# - general MPS source is blind to the distinction.
+
+
+PFM = w3i3m9
+
+RAINBOWPATH = MSVISUAL\WIN32\I386
+DONGLELIB = $(RAINBOWPATH)\spromeps.lib
+
+# /Gs appears to be necessary to suppress stack checks. Stack checks
+# (if not suppressed) generate a dependency on the C library, __chkesp,
+# which causes the linker step to fail when building the DLL, mpsdy.dll.
+PFMDEFS = /DCONFIG_PF_STRING="w3i3m9" /DCONFIG_PF_W3I3M9 \
+ /DWIN32 /D_WINDOWS /Gs /I$(RAINBOWPATH)
+
+MPM = \
+ \
+ \
+ \
+ [ \
+ \
+ \
+
+SW = \
+ \
+ \
+ \
+ ][ \
+ \
+ \
+ \
+
+PLINTH =
+AMC =
+AMS =
+AWL =
+LO =
+SNC =
+DW =
+FMTTEST =
+POOLN =
+TESTLIB =
+
+
+!INCLUDE commpre9.nmk
+
+
+# Source to object file mappings and CFLAGS amalgamation
+# %%VARIETY %%PART: Add new macros which expand to the files included
+# in the part for each variety
+# %%VARIETY: Add a CFLAGS macro which expands to the flags that that variety
+# should use when compiling C. And a LINKFLAGS macro which expands to the
+# flags that the variety should use when building executables. And a LIBFLAGS
+# macro which expands to the flags that the variety should use when building
+# libraries
+
+!IF "$(VARIETY)" == "he"
+CFLAGS=$(CFLAGSCOMMONPRE) $(CFHE) $(CFLAGSCOMMONPOST)
+LINKFLAGS=$(LINKFLAGSCOMMON) $(LFHE)
+LIBFLAGS=$(LIBFLAGSCOMMON) $(LIBFLAGSHE)
+MPMOBJ0 = $(MPM:<=w3i3m9\he\)
+MPMOBJ = $(MPMOBJ0:>=.obj)
+PLINTHOBJ0 = $(PLINTH:<=w3i3m9\he\)
+PLINTHOBJ = $(PLINTHOBJ0:>=.obj)
+SWOBJ0 = $(SW:<=w3i3m9\he\)
+SWOBJ = $(SWOBJ0:>=.obj)
+AMSOBJ0 = $(AMS:<=w3i3m9\he\)
+AMSOBJ = $(AMSOBJ0:>=.obj)
+AMCOBJ0 = $(AMC:<=w3i3m9\he\)
+AMCOBJ = $(AMCOBJ0:>=.obj)
+AWLOBJ0 = $(AWL:<=w3i3m9\he\)
+AWLOBJ = $(AWLOBJ0:>=.obj)
+LOOBJ0 = $(LO:<=w3i3m9\he\)
+LOOBJ = $(LOOBJ0:>=.obj)
+SNCOBJ0 = $(SNC:<=w3i3m9\he\)
+SNCOBJ = $(SNCOBJ0:>=.obj)
+DWOBJ0 = $(DW:<=w3i3m9\he\)
+DWOBJ = $(DWOBJ0:>=.obj)
+FMTTESTOBJ0 = $(FMTTEST:<=w3i3m9\he\)
+FMTTESTOBJ = $(FMTTESTOBJ0:>=.obj)
+POOLNOBJ0 = $(POOLN:<=w3i3m9\he\)
+POOLNOBJ = $(POOLNOBJ0:>=.obj)
+TESTLIBOBJ0 = $(TESTLIB:<=w3i3m9\he\)
+TESTLIBOBJ = $(TESTLI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GS=$(LINKFLAGSCOMMON) $(LFCV)
+#LIBFLAGS=$(LIBFLAGSCOMMON) $(LIBFLAGSCV)
+#MPMOBJ0 = $(MPM:<=w3i3m9\cv\)
+#MPMOBJ = $(MPMOBJ0:>=.obj)
+#PLINTHOBJ0 = $(PLINTH:<=w3i3m9\cv\)
+#PLINTHOBJ = $(PLINTHOBJ0:>=.obj)
+#AMSOBJ0 = $(AMS:<=w3i3m9\cv\)
+#AMSOBJ = $(AMSOBJ0:>=.obj)
+#AMCOBJ0 = $(AMC:<=w3i3m9\cv\)
+#AMCOBJ = $(AMCOBJ0:>=.obj)
+#AWLOBJ0 = $(AWL:<=w3i3m9\cv\)
+#AWLOBJ = $(AWLOBJ0:>=.obj)
+#LOOBJ0 = $(LO:<=w3i3m9\cv\)
+#LOOBJ = $(LOOBJ0:>=.obj)
+#SNCOBJ0 = $(SNC:<=w3i3m9\cv\)
+#SNCOBJ = $(SNCOBJ0:>=.obj)
+#DWOBJ0 = $(DW:<=w3i3m9\cv\)
+#DWOBJ = $(DWOBJ0:>=.obj)
+#POOLNOBJ0 = $(POOLN:<=w3i3m9\cv\)
+#POOLNOBJ = $(POOLNOBJ0:>=.obj)
+#TESTLIBOBJ0 = $(TESTLIB:<=w3i3m9\cv\)
+#TESTLIBOBJ = $(TESTLIBOBJ0:>=.obj)
+
+!ENDIF
+
+
+!INCLUDE commpost.nmk
+
+
+# C. COPYRIGHT AND LICENSE
+#
+# Copyright (C) 2001-2002, 2008 Ravenbrook Limited .
+# All rights reserved. This is an open source license. Contact
+# Ravenbrook for commercial licensing options.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# 3. Redistributions in any form must be accompanied by information on how
+# to obtain complete source code for this software and any accompanying
+# software that uses this software. The source code must either be
+# included in the distribution or be available for no more than the cost
+# of distribution plus a nominal fee, and must be freely redistributable
+# under reasonable conditions. For an executable file, complete source
+# code means the source code for all modules it contains. It does not
+# include source code for modules or files that typically accompany the
+# major components of the operating system on which the executable file
+# runs.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/mps/code/w3i3mv.nmk b/mps/code/w3i3mv.nmk
index fc9509cd87b..9c3e6cee6b5 100644
--- a/mps/code/w3i3mv.nmk
+++ b/mps/code/w3i3mv.nmk
@@ -11,7 +11,8 @@ DONGLELIB = $(RAINBOWPATH)\spromeps.lib
# /Gs appears to be necessary to suppress stack checks. Stack checks
# (if not suppressed) generate a dependency on the C library, __chkesp,
# which causes the linker step to fail when building the DLL, mpsdy.dll.
-PFMDEFS = /DWIN32 /D_WINDOWS /Gs /I$(RAINBOWPATH)
+PFMDEFS = /DCONFIG_PF_STRING="w3i3mv" /DCONFIG_PF_W3I3MV \
+ /DWIN32 /D_WINDOWS /Gs /I$(RAINBOWPATH)
MPM = \
\
diff --git a/mps/code/xcppgc.gmk b/mps/code/xcppgc.gmk
index 47112a0522d..adab791f216 100644
--- a/mps/code/xcppgc.gmk
+++ b/mps/code/xcppgc.gmk
@@ -5,6 +5,8 @@
PFM = xcppgc
+PFMDEFS = -DCONFIG_PF_STRING="xcppgc" -DCONFIG_PF_XCPPGC
+
MPMPF = lockix.c than.c vmix.c \
protix.c protxcpp.c prmcan.c span.c
MPMS = ssxcpp.s
]