Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: 5dd8c543ab
...
compare: gcc_defines
  • 4 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
3  MANIFEST
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Fri Oct 22 02:09:27 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Tue Nov 2 03:04:33 2010 UT
#
# See below for documentation on the format of this file.
#
@@ -171,6 +171,7 @@ compilers/tge/TGE/Rule.pir [tge]
compilers/tge/TGE/Tree.pir [tge]
compilers/tge/tgc.pir [tge]
config/auto/arch.pm []
+config/auto/arch/test_rtems.in []
config/auto/attributes.pm []
config/auto/attributes/test_c.in []
config/auto/backtrace.pm []
View
21 config/auto/arch.pm
@@ -95,6 +95,13 @@ sub runstep {
$cpuarch =~ s/i[456]86/i386/i;
$cpuarch =~ s/x86_64/amd64/i;
+ # At this point, we check for __rtems__. If the probe returns
+ # successfully, we'll set osname => 'rtems' regardless of what we have
+ # determined so far. We will let our setting for cpuarch stand. This
+ # will mean that _get_platform() will be set to 'generic'.
+ my $rtems_result = _probe_for_rtems($conf);
+ $osname = 'rtems' if $rtems_result;
+
$conf->data->set(
cpuarch => $cpuarch,
osname => $osname
@@ -134,6 +141,20 @@ sub _report_verbose {
return 1;
}
+sub _probe_for_rtems {
+ my $conf = shift;
+ $conf->cc_gen("config/auto/arch/test_rtems.in");
+ eval { $conf->cc_build(); };
+ my $result = 0;
+ if (!$@) {
+ if ($conf->cc_run_capture() =~ /rtems/) {
+ $result++;
+ }
+ }
+ $conf->cc_clean();
+ return $result;
+}
+
1;
# Local Variables:
View
28 config/auto/arch/test_rtems.in
@@ -0,0 +1,28 @@
+/*
+Copyright (C) 2002-2009, Parrot Foundation.
+$Id$
+
+Determine whether we're on RTEMS (Real-Time Executive for Multiprocessor
+Systems). See: http://www.rtems.com/.
+
+*/
+
+#include <stdlib.h>
+
+int
+main(int argc, char **argv)
+{
+#ifdef __rtems__
+ printf("__rtems__ => %s,\n", __rtems__);
+ return EXIT_SUCCESS;
+#else
+ return EXIT_FAILURE;
+#endif
+}
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
View
13 config/auto/gcc.pm
@@ -7,7 +7,8 @@ config/auto/gcc.pm - GNU C Compiler
=head1 DESCRIPTION
-Determines whether the C compiler is actually C<gcc>.
+Determines whether the C compiler is actually C<gcc>. If so, sets
+C<gccdefines*> attributes.
=cut
@@ -33,6 +34,16 @@ sub runstep {
my ( $self, $conf ) = @_;
my $gnucref = _probe_for_gcc($conf);
my $rv = $self->_evaluate_gcc($conf, $gnucref);
+
+ if (defined( $conf->data->get('gccversion') ) ) {
+ my @gccdefines = `gcc -x c -E -dM /dev/null`;
+ chomp @gccdefines;
+ foreach my $def (@gccdefines) {
+ my @data = split /\s+/, $def, 3;
+ $conf->data->set("gccdefines$data[1]" => $data[2]);
+ }
+ }
+
return $rv;
}

No commit comments for this range

Something went wrong with that request. Please try again.