diff options
Diffstat (limited to 'mps/code/mpstd.h')
| -rw-r--r-- | mps/code/mpstd.h | 45 |
1 files changed, 8 insertions, 37 deletions
diff --git a/mps/code/mpstd.h b/mps/code/mpstd.h index 61a20d3cbf2..8298e98be26 100644 --- a/mps/code/mpstd.h +++ b/mps/code/mpstd.h | |||
| @@ -9,51 +9,22 @@ | |||
| 9 | * documentation, or, in the case of GCC, from the compiler itself. | 9 | * documentation, or, in the case of GCC, from the compiler itself. |
| 10 | * References to the documentation appear above each detection line. | 10 | * References to the documentation appear above each detection line. |
| 11 | * | 11 | * |
| 12 | * For more details on how this file fits into the MPS build system, | ||
| 13 | * and an explanation of all the MPS_* defines, see design.config.pf | ||
| 14 | * "MPS Configuration" <../design/config.txt> | ||
| 15 | * | ||
| 12 | * .macos.ppc.align: MacOS / PowerPC requires 8 bytes alignment (in | 16 | * .macos.ppc.align: MacOS / PowerPC requires 8 bytes alignment (in |
| 13 | * general). See "Mac OS Runtime Architecture", table 4-2. | 17 | * general). See "Mac OS Runtime Architecture", table 4-2. |
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef mpstd_h | ||
| 17 | #define mpstd_h | ||
| 18 | |||
| 19 | /* DESIGN NOTES | ||
| 20 | * ------------ | ||
| 21 | * [These should be moved to a proper buildsys design doc. RHSK] | ||
| 22 | * | ||
| 23 | * mpstd.h does two main things: | ||
| 24 | * 1. platform detection by looking at preprocessor symbols; | ||
| 25 | * 2. setting variables (eg. MPS_PF_STRING, MPS_WORD_WIDTH). | ||
| 26 | * | ||
| 27 | * Sometimes the platform is *already* known by the buildsystem: | ||
| 28 | * - the Global Graphics buildsystem always sets CONFIG_PF_*. | ||
| 29 | * - the Ravenbrook buildsystem knows the platform and may (but | ||
| 30 | * typically does not) set CONFIG_PF_*. | ||
| 31 | * | ||
| 32 | * Regardless of this, mpstd.h still attempts to detect the platform. | ||
| 33 | * (This is intentional). However if both CONFIG_PF_* and | ||
| 34 | * CONFIG_PF_STRING are set, then mpstd.h performs a third function: | ||
| 35 | * 3. checking that the detected platform corresponds to that | ||
| 36 | * specified by CONFIG_PF_*. | ||
| 37 | * | ||
| 38 | * Sometimes no MPS buildsystem is in use, so the platform *must* | ||
| 39 | * be detected. For example, when client software #includes mps.h, | ||
| 40 | * we want it to just work out of the box with whatever compiler is | ||
| 41 | * being used. In other words we do not require the client to define | ||
| 42 | * CONFIG_PF_*. | ||
| 43 | * (This is the case that justifies mpstd.h doing platform detection | ||
| 44 | * by looking at preprocessor symbols; otherwise we'd simply use | ||
| 45 | * CONFIG_PF_*). | ||
| 46 | * | 18 | * |
| 47 | * mpstd.h fails if it cannot detect the platform (even if CONFIG_PF_* | 19 | * mpstd.h fails if it cannot detect the platform (even if CONFIG_PF_* |
| 48 | * is specified). This is intentional. mpstd.h does *not* allow | 20 | * is specified). This is intentional. mpstd.h does *not* allow |
| 49 | * CONFIG_PF_* to override the platform as detected from preprocessor | 21 | * CONFIG_PF_* to override the platform as detected from preprocessor |
| 50 | * symbols. This is intentional. | 22 | * symbols. This is intentional. [This needs justifying. RB 2013-05-11] |
| 51 | * | ||
| 52 | * References: | ||
| 53 | * GG buildsys use of CONFIG_PF_*: | ||
| 54 | * <http://info.ravenbrook.com/mail/2005/03/01/15-45-17/0.txt> | ||
| 55 | */ | 23 | */ |
| 56 | 24 | ||
| 25 | #ifndef mpstd_h | ||
| 26 | #define mpstd_h | ||
| 27 | |||
| 57 | 28 | ||
| 58 | /* Visual C++ 2.0, Books Online, C/C++ Book, Preprocessor Reference, | 29 | /* Visual C++ 2.0, Books Online, C/C++ Book, Preprocessor Reference, |
| 59 | * Chapter 1: The Preprocessor, Macros, Predefined Macros. | 30 | * Chapter 1: The Preprocessor, Macros, Predefined Macros. |