Commits

Anonymous committed 89c3fdb

On Solaris, enable the -KPIC option by default when compiling shared objects, and accomodate Sun Workshop by changing the prefix instead of the suffix. (Steve-o) Add the +Z option for compiling shared objects on HP-UX.

  • Participants
  • Parent commits 074f9eb

Comments (0)

Files changed (6)

   - Add the 'f90' and 'f95' tools to the list of Fortran compilers
     searched for by default.
 
+  - Add the +Z option by default when compiling shared objects on
+    HP-UX.
+
   From Chen Lee:
 
   - Handle Visual Studio project and solution files in Unicode.
 
   - Allow $JARCHDIR to be expanded to other construction variables.
 
+  From Steve-o:
+
+  - Add the -KPIC option by default when compiling shared objects on
+    Solaris.
+
+  - Change the default suffix for Solaris objects to .o, to conform to
+    Sun WorkShop's expectations.  Change the profix to so_ so they can
+    still be differentiated from static objects in the same directory.
+
   From Amir Szekely:
 
   - When calling the resource compiler on MinGW, add --include-dir and
 
             env = Environment(tools = ['default', 'f77'])
 
+    --  SOLARIS DEFAULT SHARED OBJECT PREFIXES AND SUFFIXES HAVE CHANGED
+
+        On Solaris, SCons now builds shared objects from C and C++ source
+        files with a default prefix of "so_" and a default suffix of ".o".
+        The previous default suffix of ".os" caused problems when trying
+        to use SCons with Sun WorkShop.
+
     --  CACHED Configure() RESULTS ARE STORED IN A DIFFERENT FILE
 
         The Configure() subsystem now stores its cached results in a

src/engine/SCons/Tool/hpc++.py

 
     if acc:
         env['CXX']        = acc or 'aCC'
+        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z')
         # determine version of aCC
         line = os.popen(acc + ' -V 2>&1').readline().rstrip()
         if string.find(line, 'aCC: HP ANSI C++') == 0:

src/engine/SCons/Tool/hpcc.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
+import SCons.Util
+
 import cc
 
 def generate(env):
     cc.generate(env)
 
     env['CXX']        = 'aCC'
+    env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS +Z')
 
 def exists(env):
     return env.Detect('aCC')

src/engine/SCons/Tool/sunc++.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
+import SCons.Util
+
 import os.path
 
 cplusplus = __import__('c++', globals(), locals(), [])
     env['CXX'] = cxx
     env['SHCXX'] = shcxx
     env['CXXVERSION'] = version
-    env['SHOBJSUFFIX'] = '.os'
+    env['SHCXXFLAGS']   = SCons.Util.CLVar('$CXXFLAGS -KPIC')
+    env['SHOBJPREFIX']  = 'so_'
+    env['SHOBJSUFFIX']  = '.o'
     
 def exists(env):
     path, cxx, shcxx, version = get_cppc(env)

src/engine/SCons/Tool/suncc.py

 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
+import SCons.Util
+
 import cc
 
 def generate(env):
     """
     cc.generate(env)
 
-    env['CXX']        = 'CC'
+    env['CXX']          = 'CC'
+    env['SHCCFLAGS']    = SCons.Util.CLVar('$CCFLAGS -KPIC')
+    env['SHOBJPREFIX']  = 'so_'
+    env['SHOBJSUFFIX']  = '.o'
 
 def exists(env):
     return env.Detect('CC')