On Tue, 8 Mar 2005, Leopold Toetsch via RT wrote:

Andy Dougherty <[EMAIL PROTECTED]> wrote:

> This patch adds code to config/auto/hints/solaris.pl

Doesn't apply. Please attach it and resend.

$ patch -p1 --dry-run -l < 34366.txt
patching file config/auto/gcc.pl
patching file config/init/hints/solaris.pl
Hunk #1 FAILED at 6.
Hunk #2 FAILED at 21.
2 out of 2 hunks FAILED -- ...

Oh, rats. Pine didn't use to mess up the spaces that way. Patch attached this time. Sorry about that.

--
    Andy Dougherty              [EMAIL PROTECTED]
diff -r -u parrot-current/config/auto/gcc.pl parrot-andy/config/auto/gcc.pl
--- parrot-current/config/auto/gcc.pl   Sun Nov 14 19:00:11 2004
+++ parrot-andy/config/auto/gcc.pl      Mon Mar  7 15:52:04 2005
@@ -35,14 +35,22 @@
   my($gccversion, $warns, $ccwarn);
   $ccwarn=Configure::Data->get('ccwarn');
 
+  # Set gccversion to undef.  This will also trigger any hints-file
+  # callbacks that depend on knowing whether or not we're using gcc.
+
+  # This key should always exist unless the program couldn't be run,
+  # which should have been caught by the 'die' above.
   unless (exists $gnuc{__GNUC__}) {
+    Configure::Data->set(gccversion => undef);
     return;
   }
+  
   my $major = $gnuc{__GNUC__};
   my $minor = $gnuc{__GNUC_MINOR__};
   unless (defined $major) {
     print " (no) " if $_[1];
     $Configure::Step::result = 'no';
+    Configure::Data->set(gccversion => undef);
     return;
   }
   if ($major =~ tr/0-9//c) {
diff -r -u parrot-current/config/init/hints/solaris.pl 
parrot-andy/config/init/hints/solaris.pl
--- parrot-current/config/init/hints/solaris.pl Wed Feb  2 11:00:06 2005
+++ parrot-andy/config/init/hints/solaris.pl    Mon Mar  7 15:52:22 2005
@@ -6,12 +6,13 @@
     $libs .= ' -lpthread';
 }
 if ( $libs !~ /-lrt\b/ ) {
-    $libs .= ' -lrt';
+    $libs .= ' -lrt';      # Needed for sched_yield.
 }
 Configure::Data->set(
     libs => $libs,
 );
 
+################################################################
 my $link = Configure::Data->get('link');
 # Going to assume Sun's compiler
 # In which case we need to link with the C++ compiler (CC) rather than the
@@ -20,14 +21,39 @@
 Configure::Data->set('link', $link);
 
 # if it turns out we're using gcc, then we need to make sure we're linking
-# with g++, not gcc.  We can't make this decision until later, because the
-# gcc test hasn't been run yet.
-my $solaris_cb = sub {
+# with g++, not gcc.  We can't make this decision until the gccversion test
+# has been run.
+my $solaris_link_cb = sub {
   my ($key, $gccversion) = @_;
   if ($gccversion) {
     Configure::Data->set('link', 'g++');
-    Configure::Data->deltrigger("gccversion", "solaris_hints");
+    Configure::Data->deltrigger("gccversion", "solaris_link");
   }
 };
+Configure::Data->settrigger("gccversion", "solaris_link", $solaris_link_cb);
 
-Configure::Data->settrigger("gccversion", "solaris_hints", $solaris_cb);
+################################################################
+# Parrot usually aims for IEEE-754 compliance.
+# For Solaris 8/Sun Workshop Pro 4, both
+#    atan2( 0.0, -0.0) and atan2(-0.0, -0.0)
+# return 0, when they should return +PI and -PI respectively.
+# For Sun's compilers, fix this with the -xlibmieee flag.
+# I don't know of an equivalent flag for gcc.
+# (Alternatively, and more generally, perhahs we should run an
+# ieee-conformance test and then call back into a hints-file trigger
+# to set platform-specific flags.
+#      A. Dougherty  7 March 2005
+# We don't know which compiler we're using till after the gccversion test.
+my $solaris_ieee_cb = sub {
+    my ($key, $gccversion) = @_;
+    if ($gccversion) {
+       # Don't know how to do this for gcc.
+    }
+    else {
+       my $linkflags = Configure::Data->get('linkflags');
+       Configure::Data->add(' ', 'linkflags', '-xlibmieee')
+               unless $linkflags =~ /-xlibmieee/;
+    }
+    Configure::Data->deltrigger("gccversion", "solaris_ieee");
+};
+Configure::Data->settrigger("gccversion", "solaris_ieee", $solaris_ieee_cb);

Reply via email to