There has been a long standing bug which prevented Sage building on Solaris if 
the Sun compiler was installed.

http://trac.sagemath.org/sage_trac/ticket/6595

I'm not sure how well the Sage server is working or not, so I thought I'd 
attach 
this small patch. Could some kind people please test it?

I've tested it on Solaris, so it does not really need much testing there, 
though 
of course, one can't really test things too much. But on other platforms it 
would be really helpful if it could be tested.

If I've got it right, it should have no effect whatsoever to anyone unless your 
system falls into one of these two categories.

1) You use AIX, HP-UX, IRIX, Solaris or Tru64
2) You use Sun Studio on Linux.

Both are quite rare, so hopefully it wont change anything for anyone else.

It is a patch against the Sage library (in the sage-4.3.spkg in the directory 
c_lib).

Dave

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
--- SConstruct.orig	Thu Dec 24 09:37:51 2009
+++ SConstruct	Sun Dec 27 06:41:08 2009
@@ -41,8 +41,44 @@
 # autotools.  However, for this build we know that we are in a 
 # SAGE local filesystem.  Once we have SAGE_LOCAL imported, we 
 # know where everything is.
-env = Environment(ENV = os.environ)
 
+# Native tools are supposedly used by default on SCons, 
+# Though this was only happening with the C++ compiler, not the 
+# C compiler on Solaris. But we MUST ensure
+# that gcc and g++ are used if environment variables CC and CXX 
+# are set to GNU tools. 
+
+# This was a particular issue on Solaris
+# http://trac.sagemath.org/sage_trac/ticket/6595
+# but will no doubt affect other proprietary Unix systems
+# This forces the GNU tools on AIX, HP-UX, Tru64 and IRIX.
+# The Sun tools on Solaris or Linux if the variable CXX points 
+# to a Sun compiler 'CC' 
+
+# See this email: http://markmail.org/message/4atmrof2gc2dgavj?q=scons+cxx
+# Tested on Solaris, AIX and HP-UX. Untested on Tru64 and IRIX.
+# Linux with Sun Studio is also untested. 
+
+if os.uname()[0] == 'AIX' and os.environ['CXX'].endswith('g++'):
+   env = Environment(tools=['gcc','g++','gnulink'], ENV = os.environ)
+elif os.uname()[0] == 'HP-UX' and os.environ['CXX'].endswith('g++'):
+   env = Environment(tools=['gcc','g++','gnulink'], ENV = os.environ)
+elif os.uname()[0] == 'IRIX' and os.environ['CXX'].endswith('g++'):
+   env = Environment(tools=['gcc','g++','gnulink'], ENV = os.environ)
+elif os.uname()[0] == 'IRIX64' and os.environ['CXX'].endswith('g++'):
+   env = Environment(tools=['gcc','g++','gnulink'], ENV = os.environ)
+elif os.uname()[0] == 'SunOS' and os.environ['CXX'].endswith('g++'):
+   env = Environment(tools=['gcc','g++','gnulink'], ENV = os.environ)
+elif os.uname()[0] == 'Tru64' and os.environ['CXX'].endswith('g++'):
+   env = Environment(tools=['gcc','g++','gnulink'], ENV = os.environ)
+# Non-GNU compilers follow. Linux with Sun Studio has not been tested. 
+elif os.uname()[0] == 'SunOS' and os.environ['CXX'].endswith('CC'):
+   env = Environment(tools=['suncc','sunc++','sunlink'], ENV = os.environ)
+elif os.uname()[0] == 'Linux' and os.environ['CXX'].endswith('CC'):
+   env = Environment(tools=['suncc','sunc++','sunlink'], ENV = os.environ)
+else:
+   env = Environment(ENV = os.environ)
+
 # By default, SCons hashes the source file contents to determine 
 # if rebuilds are necessary. If you like the old way better, 
 # uncomment this to use timestamps.

Reply via email to