From 86a4e1bc211610fc1053c70821cfc30c48e13abb Mon Sep 17 00:00:00 2001 From: stevenknight Date: Wed, 24 Aug 2005 17:33:37 +0000 Subject: [PATCH] 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. git-svn-id: http://scons.tigris.org/svn/scons/trunk@1342 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 12 ++++++++++++ src/RELEASE.txt | 7 +++++++ src/engine/SCons/Tool/hpc++.py | 1 + src/engine/SCons/Tool/hpcc.py | 3 +++ src/engine/SCons/Tool/sunc++.py | 6 +++++- src/engine/SCons/Tool/suncc.py | 7 ++++++- 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index e568b312..4846e441 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -318,6 +318,9 @@ RELEASE 0.97 - XXX - 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. @@ -607,6 +610,15 @@ RELEASE 0.97 - XXX - 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 diff --git a/src/RELEASE.txt b/src/RELEASE.txt index 47287489..e8bc3fdc 100644 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -157,6 +157,13 @@ RELEASE 0.97 - XXX 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 diff --git a/src/engine/SCons/Tool/hpc++.py b/src/engine/SCons/Tool/hpc++.py index 3276412d..8c4b4ddb 100644 --- a/src/engine/SCons/Tool/hpc++.py +++ b/src/engine/SCons/Tool/hpc++.py @@ -64,6 +64,7 @@ def generate(env): 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: diff --git a/src/engine/SCons/Tool/hpcc.py b/src/engine/SCons/Tool/hpcc.py index f4ff80c0..15f23dc7 100644 --- a/src/engine/SCons/Tool/hpcc.py +++ b/src/engine/SCons/Tool/hpcc.py @@ -32,6 +32,8 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import SCons.Util + import cc def generate(env): @@ -39,6 +41,7 @@ def generate(env): cc.generate(env) env['CXX'] = 'aCC' + env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS +Z') def exists(env): return env.Detect('aCC') diff --git a/src/engine/SCons/Tool/sunc++.py b/src/engine/SCons/Tool/sunc++.py index 22d01dbc..91c0f6cb 100644 --- a/src/engine/SCons/Tool/sunc++.py +++ b/src/engine/SCons/Tool/sunc++.py @@ -33,6 +33,8 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import SCons.Util + import os.path cplusplus = __import__('c++', globals(), locals(), []) @@ -66,7 +68,9 @@ def generate(env): 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) diff --git a/src/engine/SCons/Tool/suncc.py b/src/engine/SCons/Tool/suncc.py index e851cd1a..35d2aca1 100644 --- a/src/engine/SCons/Tool/suncc.py +++ b/src/engine/SCons/Tool/suncc.py @@ -32,6 +32,8 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import SCons.Util + import cc def generate(env): @@ -41,7 +43,10 @@ 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') -- 2.26.2