[Gd-chatter] r11675 - in trunk/gwydion: d2c/compiler d2c/compiler/Macintosh d2c/compiler/base tools/shared-misc

agent at gwydiondylan.org agent at gwydiondylan.org
Fri Feb 15 03:34:44 CET 2008


Author: agent
Date: Fri Feb 15 03:34:43 2008
New Revision: 11675

Modified:
   trunk/gwydion/d2c/compiler/Macintosh/cw-base-exports.dylan
   trunk/gwydion/d2c/compiler/Macintosh/gwydion.dylan
   trunk/gwydion/d2c/compiler/base/base-exports.dylan
   trunk/gwydion/d2c/compiler/base/platform.dylan
   trunk/gwydion/d2c/compiler/platforms.descr
   trunk/gwydion/tools/shared-misc/gen-makefile.in
Log:
Bug: 7368
Made _POSIX_C_SOURCE platform-specific via platforms.descr.


Modified: trunk/gwydion/d2c/compiler/Macintosh/cw-base-exports.dylan
==============================================================================
--- trunk/gwydion/d2c/compiler/Macintosh/cw-base-exports.dylan	(original)
+++ trunk/gwydion/d2c/compiler/Macintosh/cw-base-exports.dylan	Fri Feb 15 03:34:43 2008
@@ -401,6 +401,7 @@
     default-c-compiler-flags,
     default-c-compiler-debug-flags,
     default-c-compiler-profile-flags,
+    default-c-platform-defines,
     assembler-command,
     link-library-command,
     randomize-library-command,

Modified: trunk/gwydion/d2c/compiler/Macintosh/gwydion.dylan
==============================================================================
--- trunk/gwydion/d2c/compiler/Macintosh/gwydion.dylan	(original)
+++ trunk/gwydion/d2c/compiler/Macintosh/gwydion.dylan	Fri Feb 15 03:34:43 2008
@@ -81,7 +81,8 @@
 		compile-c-command:,						"",
 		default-c-compiler-flags:,				"",
 		default-c-compiler-debug-flags:,		"",
-		default-c-compiler-profile-flags:,	"",
+		default-c-compiler-profile-flags:,	    "",
+		default-c-platform-defines:,            "",
 		assembler-command:,						"",
 		link-library-command:,					"",
 		link-executable-command:,				"",

Modified: trunk/gwydion/d2c/compiler/base/base-exports.dylan
==============================================================================
--- trunk/gwydion/d2c/compiler/base/base-exports.dylan	(original)
+++ trunk/gwydion/d2c/compiler/base/base-exports.dylan	Fri Feb 15 03:34:43 2008
@@ -413,6 +413,7 @@
     default-c-compiler-flags,
     default-c-compiler-debug-flags,
     default-c-compiler-profile-flags,
+    default-c-platform-defines,
     assembler-command,
     link-library-command,
     randomize-library-command,

Modified: trunk/gwydion/d2c/compiler/base/platform.dylan
==============================================================================
--- trunk/gwydion/d2c/compiler/base/platform.dylan	(original)
+++ trunk/gwydion/d2c/compiler/base/platform.dylan	Fri Feb 15 03:34:43 2008
@@ -144,6 +144,8 @@
     required-init-keyword: #"default-c-compiler-debug-flags";
   constant /* exported */ slot default-c-compiler-profile-flags :: <byte-string>,
     required-init-keyword: #"default-c-compiler-profile-flags";
+  constant /* exported */ slot default-c-platform-defines :: false-or(<byte-string>),
+    init-value: #f, init-keyword: #"default-c-platform-defines";
   constant /* exported */ slot assembler-command :: <byte-string>,
     required-init-keyword: #"assembler-command";
   constant /* exported */ slot link-library-command :: <byte-string>,
@@ -266,6 +268,7 @@
 *valid-properties*[#"default-c-compiler-flags"] := #t;
 *valid-properties*[#"default-c-compiler-debug-flags"] := #t;
 *valid-properties*[#"default-c-compiler-profile-flags"] := #t;
+*valid-properties*[#"default-c-platform-defines"] := #f;
 *valid-properties*[#"assembler-command"] := #t;
 *valid-properties*[#"link-library-command"] := #t;
 *valid-properties*[#"link-executable-command"] := #t;

Modified: trunk/gwydion/d2c/compiler/platforms.descr
==============================================================================
--- trunk/gwydion/d2c/compiler/platforms.descr	(original)
+++ trunk/gwydion/d2c/compiler/platforms.descr	Fri Feb 15 03:34:43 2008
@@ -1,5 +1,6 @@
-// A description of all target platforms we support. We use this in d2c as well as in the build scripts.
-// Remember, blank lines separate the platforms.
+// A description of all target platforms we support. We use this in d2c
+// as well as in the build scripts. Remember, blank lines separate the
+// platforms.
 
 // A target description is a description of the target-environment we
 // are compiling for.  This includes information such as what files
@@ -38,10 +39,10 @@
 // target.
 //
 // default-features: Conditional compilation features that are defined
-// on this platform.  When overriding an inheritted default-features,
+// on this platform.  When overriding an inherited default-features,
 // remember that you are giving an entirely new value to default
 // features, *not* merely adding to the list of default-features you
-// inheritted.
+// inherited.
 
 
 // CPU ARCHITECTURE entries:
@@ -101,7 +102,6 @@
 minimum-long-double-float-exponent:	-1021
 maximum-long-double-float-exponent:	1024
 
-
 // PowerPC
 platform-name:			ppc
 inherit-from:			32-bit ieee-754
@@ -345,6 +345,10 @@
 //
 // Optional flags: (All defaults are #f)
 //
+// default-c-platform-defines: A string providing various platform-specific
+// define flags such as you might find listed in sys/cdefs.h. Applied to the
+// C preprocessor, C compiler, Melange, and D2C.
+//
 
 // GNU Compiler Collection with libtool
 platform-name:			gcc
@@ -432,6 +436,7 @@
 default-c-compiler-flags:		-I. -I%s -O2 -fomit-frame-pointer -no-cpp-precomp -Wno-long-double
 default-c-compiler-debug-flags:		-I. -I%s -g -O -fno-inline-functions -no-cpp-precomp -Wno-long-double
 default-c-compiler-profile-flags:	-I. -I%s -pg -g -O -fno-inline-functions -no-cpp-precomp -Wno-long-double
+default-c-platform-defines:             -D_POSIX_C_SOURCE
 link-executable-flags:			$(GC_LIBS) -multiply_defined suppress
 double-alignment:		4
 long-long-alignment:		4
@@ -447,8 +452,9 @@
 platform-name:                 intel-darwin-gcc
 inherit-from:                  gcc darwin x86
 default-c-compiler-flags:      -I. -I%s -O2 -no-cpp-precomp -Wno-long-double
-default-c-compiler-debug-flags:        -I. -I%s -g -O -fno-inline-functions -no-cpp-precomp -Wno-long-double
-default-c-compiler-profile-flags:      -I. -I%s -pg -g -O -fno-inline-functions -no-cpp-precomp -Wno-long-double
+default-c-compiler-debug-flags:         -I. -I%s -g -O -fno-inline-functions -no-cpp-precomp -Wno-long-double
+default-c-compiler-profile-flags:       -I. -I%s -pg -g -O -fno-inline-functions -no-cpp-precomp -Wno-long-double
+default-c-platform-defines:             -D_POSIX_C_SOURCE
 link-executable-flags:          $(GC_LIBS) -multiply_defined suppress         
 long-long-alignment:           4
 long-double-size:              16

Modified: trunk/gwydion/tools/shared-misc/gen-makefile.in
==============================================================================
--- trunk/gwydion/tools/shared-misc/gen-makefile.in	(original)
+++ trunk/gwydion/tools/shared-misc/gen-makefile.in	Fri Feb 15 03:34:43 2008
@@ -183,6 +183,7 @@
     $D2CFLAGS = '-L$(DYLANDIR)/lib/dylan';
     $CFLAGS = '';
     $CPPFLAGS = '-I$(DYLANDIR)/include';
+    $CDEFFLAGS = '';
     $MELANGE = 'melange' . $dot_exe;
     $PARSERGEN = 'parsergen' . $dot_exe;
     $gen_makefile = 'gen-makefile';
@@ -494,6 +495,7 @@
             $CFLAGS .= " $target_platform{'default_c_compiler_flags'}";
         }
         $CFLAGS =~ s/-I%s//;
+        $CDEFFLAGS .= " $target_platform{'default_c_platform_defines'}";
 
 	if ($use_previous_melange) {
 	    $MELANGE = $PREVIOUS_MELANGE;
@@ -501,9 +503,9 @@
 
         print <<EOF;
 D2C = $D2C
-D2CFLAGS = $D2CFLAGS -D_POSIX_C_SOURCE
-CFLAGS = $CFLAGS -D_POSIX_C_SOURCE
-CPPFLAGS = $CPPFLAGS $debug_platform_name -D_POSIX_C_SOURCE
+D2CFLAGS = $D2CFLAGS $CDEFFLAGS
+CFLAGS = $CFLAGS $CDEFFLAGS
+CPPFLAGS = $CPPFLAGS $debug_platform_name $CDEFFLAGS
 COPTS = $COPTS
 MELANGE = $MELANGE
 PARSERGEN = $PARSERGEN



More information about the chatter mailing list