diff options
| author | Richard Brooksby | 2012-09-03 00:49:02 +0100 |
|---|---|---|
| committer | Richard Brooksby | 2012-09-03 00:49:02 +0100 |
| commit | 17977ef9c84ff8d5de6dc171591fd264426b4c23 (patch) | |
| tree | 6bcdcd7ea0d9725f4b184836d712ce40327e6037 /mps/code | |
| parent | 682bd80b85b2cdf3e6dc7922859ff6b6a0eac9ef (diff) | |
| download | emacs-17977ef9c84ff8d5de6dc171591fd264426b4c23.tar.gz emacs-17977ef9c84ff8d5de6dc171591fd264426b4c23.zip | |
Eliminating pfmdefs from makefiles by moving them to mpstd.h so that the mps can be built with a simpler compiler command.
Copied from Perforce
Change: 179180
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
| -rw-r--r-- | mps/code/comm.gmk | 2 | ||||
| -rw-r--r-- | mps/code/fri3gc.gmk | 5 | ||||
| -rw-r--r-- | mps/code/fri6gc.gmk | 5 | ||||
| -rw-r--r-- | mps/code/lii3gc.gmk | 5 | ||||
| -rw-r--r-- | mps/code/lii6gc.gmk | 5 | ||||
| -rw-r--r-- | mps/code/mps.c | 14 | ||||
| -rw-r--r-- | mps/code/mpstd.h | 36 |
7 files changed, 33 insertions, 39 deletions
diff --git a/mps/code/comm.gmk b/mps/code/comm.gmk index 5e606fc09b9..3e24487f3d3 100644 --- a/mps/code/comm.gmk +++ b/mps/code/comm.gmk | |||
| @@ -89,6 +89,8 @@ endif | |||
| 89 | # C FLAGS | 89 | # C FLAGS |
| 90 | 90 | ||
| 91 | # These flags are included in all compilations. | 91 | # These flags are included in all compilations. |
| 92 | # Avoid using PFMDEFS in platform makefiles, as they prevent the MPS being | ||
| 93 | # built with a simple command like "cc -c mps.c". | ||
| 92 | CFLAGSCOMMON = $(PFMDEFS) $(CFLAGSCOMPILER) | 94 | CFLAGSCOMMON = $(PFMDEFS) $(CFLAGSCOMPILER) |
| 93 | 95 | ||
| 94 | # %%VARIETY: Define a macro containing the set of flags for the new | 96 | # %%VARIETY: Define a macro containing the set of flags for the new |
diff --git a/mps/code/fri3gc.gmk b/mps/code/fri3gc.gmk index 2a79160c1e0..f2895c00404 100644 --- a/mps/code/fri3gc.gmk +++ b/mps/code/fri3gc.gmk | |||
| @@ -5,11 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | PFM = fri3gc | 6 | PFM = fri3gc |
| 7 | 7 | ||
| 8 | # FIXME: What is this for? Clues at | ||
| 9 | # http://www.kernel.org/doc/man-pages/online/pages/man7/feature_test_macros.7.html | ||
| 10 | # Discover whether it's still necessary and if so, document why. | ||
| 11 | PFMDEFS = -D_REENTRANT | ||
| 12 | |||
| 13 | MPMPF = lockix.c thix.c pthrdext.c vmix.c \ | 8 | MPMPF = lockix.c thix.c pthrdext.c vmix.c \ |
| 14 | protix.c protsgix.c prmcan.c prmci3fr.c ssixi3.c span.c | 9 | protix.c protsgix.c prmcan.c prmci3fr.c ssixi3.c span.c |
| 15 | 10 | ||
diff --git a/mps/code/fri6gc.gmk b/mps/code/fri6gc.gmk index de1102190e6..081e0cff43b 100644 --- a/mps/code/fri6gc.gmk +++ b/mps/code/fri6gc.gmk | |||
| @@ -5,11 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | PFM = fri6gc | 6 | PFM = fri6gc |
| 7 | 7 | ||
| 8 | # FIXME: What is this for? Clues at | ||
| 9 | # http://www.kernel.org/doc/man-pages/online/pages/man7/feature_test_macros.7.html | ||
| 10 | # Discover whether it's still necessary and if so, document why. | ||
| 11 | PFMDEFS = -D_REENTRANT | ||
| 12 | |||
| 13 | MPMPF = lockix.c thix.c pthrdext.c vmix.c \ | 8 | MPMPF = lockix.c thix.c pthrdext.c vmix.c \ |
| 14 | protix.c protsgix.c prmcan.c prmci6fr.c ssixi6.c span.c | 9 | protix.c protsgix.c prmcan.c prmci6fr.c ssixi6.c span.c |
| 15 | 10 | ||
diff --git a/mps/code/lii3gc.gmk b/mps/code/lii3gc.gmk index 148df6fed04..58176c0571f 100644 --- a/mps/code/lii3gc.gmk +++ b/mps/code/lii3gc.gmk | |||
| @@ -8,11 +8,6 @@ PFM = lii3gc | |||
| 8 | THREADSRC = lockli.c thix.c pthrdext.c | 8 | THREADSRC = lockli.c thix.c pthrdext.c |
| 9 | THREADLIB = -lpthread | 9 | THREADLIB = -lpthread |
| 10 | 10 | ||
| 11 | # _XOPEN_SOURCE is to get the modern POSIX signal handling | ||
| 12 | # _GNU_SOURCE is to get register numbers in prmci3li.c | ||
| 13 | # http://www.kernel.org/doc/man-pages/online/pages/man7/feature_test_macros.7.html | ||
| 14 | PFMDEFS = -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE | ||
| 15 | |||
| 16 | MPMPF = ${THREADSRC} vmix.c \ | 11 | MPMPF = ${THREADSRC} vmix.c \ |
| 17 | protix.c protli.c proti3.c prmci3li.c ssixi3.c span.c | 12 | protix.c protli.c proti3.c prmci3li.c ssixi3.c span.c |
| 18 | 13 | ||
diff --git a/mps/code/lii6gc.gmk b/mps/code/lii6gc.gmk index 9c47b0926fb..4c48923b082 100644 --- a/mps/code/lii6gc.gmk +++ b/mps/code/lii6gc.gmk | |||
| @@ -8,11 +8,6 @@ PFM = lii6gc | |||
| 8 | THREADSRC = lockli.c thix.c pthrdext.c | 8 | THREADSRC = lockli.c thix.c pthrdext.c |
| 9 | THREADLIB = -lpthread | 9 | THREADLIB = -lpthread |
| 10 | 10 | ||
| 11 | # _XOPEN_SOURCE is to get the modern POSIX signal handling | ||
| 12 | # _GNU_SOURCE is to get register numbers in prmci3li.c | ||
| 13 | # http://www.kernel.org/doc/man-pages/online/pages/man7/feature_test_macros.7.html | ||
| 14 | PFMDEFS = -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE | ||
| 15 | |||
| 16 | MPMPF = ${THREADSRC} vmix.c \ | 11 | MPMPF = ${THREADSRC} vmix.c \ |
| 17 | protix.c protli.c proti6.c prmci6li.c ssixi6.c span.c | 12 | protix.c protli.c proti6.c prmci6li.c ssixi6.c span.c |
| 18 | 13 | ||
diff --git a/mps/code/mps.c b/mps/code/mps.c index 34bec8c0c42..cf967507816 100644 --- a/mps/code/mps.c +++ b/mps/code/mps.c | |||
| @@ -18,6 +18,16 @@ | |||
| 18 | * which closely mirror those in the makefiles. | 18 | * which closely mirror those in the makefiles. |
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | |||
| 22 | /* Platform interface | ||
| 23 | * | ||
| 24 | * This must be included first as it defines symbols which affect system | ||
| 25 | * headers, such as _POSIX_C_SOURCE _REENTRANT etc. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #include "mpstd.h" | ||
| 29 | |||
| 30 | |||
| 21 | /* MPM Core */ | 31 | /* MPM Core */ |
| 22 | 32 | ||
| 23 | #include "mpsi.c" | 33 | #include "mpsi.c" |
| @@ -75,10 +85,6 @@ | |||
| 75 | #include "mpsliban.c" | 85 | #include "mpsliban.c" |
| 76 | #include "mpsioan.c" | 86 | #include "mpsioan.c" |
| 77 | 87 | ||
| 78 | /* Platform interface */ | ||
| 79 | |||
| 80 | #include "mpstd.h" | ||
| 81 | |||
| 82 | /* Mac OS X on 32-bit Intel built with Clang or GCC */ | 88 | /* Mac OS X on 32-bit Intel built with Clang or GCC */ |
| 83 | 89 | ||
| 84 | #if defined(MPS_PF_XCI3LL) || defined(MPS_PF_XCI3GC) | 90 | #if defined(MPS_PF_XCI3LL) || defined(MPS_PF_XCI3GC) |
diff --git a/mps/code/mpstd.h b/mps/code/mpstd.h index 10d3d2833a6..2f3f3f4d94b 100644 --- a/mps/code/mpstd.h +++ b/mps/code/mpstd.h | |||
| @@ -127,6 +127,7 @@ | |||
| 127 | #define MPS_WORD_SHIFT 5 | 127 | #define MPS_WORD_SHIFT 5 |
| 128 | #define MPS_PF_ALIGN 4 /* I'm just guessing. */ | 128 | #define MPS_PF_ALIGN 4 /* I'm just guessing. */ |
| 129 | 129 | ||
| 130 | |||
| 130 | /* Apple clang version 3.1, clang -E -dM */ | 131 | /* Apple clang version 3.1, clang -E -dM */ |
| 131 | 132 | ||
| 132 | #elif defined(__APPLE__) && defined(__i386__) && defined(__MACH__) \ | 133 | #elif defined(__APPLE__) && defined(__i386__) && defined(__MACH__) \ |
| @@ -145,6 +146,7 @@ | |||
| 145 | #define MPS_WORD_SHIFT 5 | 146 | #define MPS_WORD_SHIFT 5 |
| 146 | #define MPS_PF_ALIGN 4 /* I'm just guessing. */ | 147 | #define MPS_PF_ALIGN 4 /* I'm just guessing. */ |
| 147 | 148 | ||
| 149 | |||
| 148 | /* Apple clang version 3.1, clang -E -dM */ | 150 | /* Apple clang version 3.1, clang -E -dM */ |
| 149 | 151 | ||
| 150 | #elif defined(__APPLE__) && defined(__x86_64__) && defined(__MACH__) \ | 152 | #elif defined(__APPLE__) && defined(__x86_64__) && defined(__MACH__) \ |
| @@ -163,6 +165,7 @@ | |||
| 163 | #define MPS_WORD_SHIFT 6 | 165 | #define MPS_WORD_SHIFT 6 |
| 164 | #define MPS_PF_ALIGN 8 | 166 | #define MPS_PF_ALIGN 8 |
| 165 | 167 | ||
| 168 | |||
| 166 | /* GCC 2.6.3, gcc -E -dM | 169 | /* GCC 2.6.3, gcc -E -dM |
| 167 | * The actual granularity of GNU malloc is 8, but field alignments are | 170 | * The actual granularity of GNU malloc is 8, but field alignments are |
| 168 | * all 4. | 171 | * all 4. |
| @@ -183,6 +186,11 @@ | |||
| 183 | #define MPS_WORD_SHIFT 5 | 186 | #define MPS_WORD_SHIFT 5 |
| 184 | #define MPS_PF_ALIGN 4 | 187 | #define MPS_PF_ALIGN 4 |
| 185 | 188 | ||
| 189 | #define _REENTRANT /* FIXME: What for? */ | ||
| 190 | #define _XOPEN_SOURCE 500 /* to get POSIX signal handling */ | ||
| 191 | #define _GNU_SOURCE /* to get register numbers for prmci3li.c */ | ||
| 192 | |||
| 193 | |||
| 186 | /* GCC 4.6.3, gcc -E -dM */ | 194 | /* GCC 4.6.3, gcc -E -dM */ |
| 187 | 195 | ||
| 188 | #elif defined(__linux__) && defined(__x86_64) && defined(__GNUC__) | 196 | #elif defined(__linux__) && defined(__x86_64) && defined(__GNUC__) |
| @@ -200,22 +208,10 @@ | |||
| 200 | #define MPS_WORD_SHIFT 6 | 208 | #define MPS_WORD_SHIFT 6 |
| 201 | #define MPS_PF_ALIGN 8 | 209 | #define MPS_PF_ALIGN 8 |
| 202 | 210 | ||
| 203 | /* GCC 2.7.2, gcc -E -dM */ | 211 | #define _REENTRANT /* FIXME: What for? */ |
| 212 | #define _XOPEN_SOURCE 500 /* to get POSIX signal handling */ | ||
| 213 | #define _GNU_SOURCE /* to get register numbers for prmci3li.c */ | ||
| 204 | 214 | ||
| 205 | #elif defined(__linux__) && defined(__PPC__) && defined(__GNUC__) | ||
| 206 | #if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_LIPPGC) | ||
| 207 | #error "specified CONFIG_PF_... inconsistent with detected lippgc" | ||
| 208 | #endif | ||
| 209 | #define MPS_PF_LIPPGC | ||
| 210 | #define MPS_PF_STRING "lippgc" | ||
| 211 | #define MPS_OS_LI | ||
| 212 | #define MPS_ARCH_PP | ||
| 213 | #define MPS_BUILD_GC | ||
| 214 | #define MPS_T_WORD unsigned long | ||
| 215 | #define MPS_T_ULONGEST unsigned long | ||
| 216 | #define MPS_WORD_WIDTH 32 | ||
| 217 | #define MPS_WORD_SHIFT 5 | ||
| 218 | #define MPS_PF_ALIGN 8 /* @@@@ not tested */ | ||
| 219 | 215 | ||
| 220 | /* GCC 2.95.3, gcc -E -dM */ | 216 | /* GCC 2.95.3, gcc -E -dM */ |
| 221 | 217 | ||
| @@ -234,6 +230,11 @@ | |||
| 234 | #define MPS_WORD_SHIFT 5 | 230 | #define MPS_WORD_SHIFT 5 |
| 235 | #define MPS_PF_ALIGN 4 | 231 | #define MPS_PF_ALIGN 4 |
| 236 | 232 | ||
| 233 | /* FIXME: What is this for? Clues at <http://www.kernel.org/doc/man-pages/online/pages/man7/feature_test_macros.7.html> | ||
| 234 | Discover whether it's still necessary and if so, document why. */ | ||
| 235 | #define _REENTRANT | ||
| 236 | |||
| 237 | |||
| 237 | #elif defined(__FreeBSD__) && defined (__x86_64__) && defined (__GNUC__) | 238 | #elif defined(__FreeBSD__) && defined (__x86_64__) && defined (__GNUC__) |
| 238 | #if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_FRI6GC) | 239 | #if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_FRI6GC) |
| 239 | #error "specified CONFIG_PF_... inconsistent with detected fri6gc" | 240 | #error "specified CONFIG_PF_... inconsistent with detected fri6gc" |
| @@ -249,6 +250,11 @@ | |||
| 249 | #define MPS_WORD_SHIFT 6 | 250 | #define MPS_WORD_SHIFT 6 |
| 250 | #define MPS_PF_ALIGN 8 | 251 | #define MPS_PF_ALIGN 8 |
| 251 | 252 | ||
| 253 | /* FIXME: What is this for? Clues at <http://www.kernel.org/doc/man-pages/online/pages/man7/feature_test_macros.7.html> | ||
| 254 | Discover whether it's still necessary and if so, document why. */ | ||
| 255 | #define _REENTRANT | ||
| 256 | |||
| 257 | |||
| 252 | #else | 258 | #else |
| 253 | #error "Unable to detect target platform" | 259 | #error "Unable to detect target platform" |
| 254 | #endif | 260 | #endif |