summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-01-18 14:32:51 (GMT)
committerSteven Knight <knight@baldmt.com>2003-01-18 14:32:51 (GMT)
commite7311129d841fe777bfe2d83c46033f34dac4709 (patch)
treea24fdcf4d185371398684f758fc74a3a856181fc /src
parent9174c12d92d6a32c087bd5b891022ef5dc6f426f (diff)
downloadSCons-e7311129d841fe777bfe2d83c46033f34dac4709.zip
SCons-e7311129d841fe777bfe2d83c46033f34dac4709.tar.gz
SCons-e7311129d841fe777bfe2d83c46033f34dac4709.tar.bz2
Make shared/static objects less irritating. (Anthony Roach)
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt8
-rw-r--r--src/RELEASE.txt47
-rw-r--r--src/engine/SCons/Defaults.py12
-rw-r--r--src/engine/SCons/Tool/gcc.py3
-rw-r--r--src/engine/SCons/Tool/mingw.py2
-rw-r--r--src/engine/SCons/Tool/msvc.py1
6 files changed, 31 insertions, 42 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index eeaaf94..ace0803 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -15,6 +15,14 @@ RELEASE 0.11 - XXX
- Allow Python function Actions to specify a list of construction
variables that should be included in the Action's signature.
+ From Anthony Roach:
+
+ - Use a different static object suffix (.os) when using gcc so shared
+ and static objects can exist side-by-side in the same directory.
+
+ - Allow the same object files on Win32 to be linked into either
+ shared or static libraries.
+
RELEASE 0.10 - Thu, 16 Jan 2003 04:11:46 -0600
diff --git a/src/RELEASE.txt b/src/RELEASE.txt
index 6319b2e..5a4b5d0 100644
--- a/src/RELEASE.txt
+++ b/src/RELEASE.txt
@@ -25,6 +25,18 @@ RELEASE 0.10 - Thu, 16 Jan 2003 04:11:46 -0600
This is the tenth alpha release of SCons. Please consult the
CHANGES.txt file for a list of specific changes since last release.
+ Please note the following important changes since release 0.10:
+
+ - The default suffix for shared object files when using gcc has now
+ been changed to '.os'. This makes library builds more convenient
+ by allowing both static (compiled without -fPIC) and shared object
+ files (compiled with -fPIC) to exist side-by-side. If you want to
+ preserve the old behavior of using .o files for shared objects,
+ you must now explicitly reset the SHOBJSUFFIX value in your
+ construction environment as follows:
+
+ env = Environment(SHOBJSUFFIX = '.o')
+
Please note the following important changes since release 0.09:
- The Scanner interface has been changed to make it easier to
@@ -67,41 +79,6 @@ RELEASE 0.10 - Thu, 16 Jan 2003 04:11:46 -0600
- SCons now prints a description of Python functions that are
invoked to build a target.
- Please note the following important changes since release 0.08:
-
- - The SetCommandHandler() function has been superceded
- by the SPAWN, SHELL and ESCAPE construction variables.
-
- - SCons now exits with an error message if any source files or
- implicit dependency files for a target do not exist and have
- no Builder. SCons used to ignore these files, so builds that
- formally succeeded despite the absence of a scanned file will now
- fail unless the -k (keep going on error) flag is used.
-
- - The specification of the name for the 'lib' tool (the Microsoft
- library archiver) has now been changed to 'mslib'. If you
- previously used the Tool() method to fetch the 'lib' tool
- explicitly, you will need to change the name in the call to
- 'mslib':
-
- env = Environment(tools = [ Tool('mslib') ])
-
- - In order to make it clear what SCons is doing when, SCons now
- prints explicit messages:
-
- scons: Reading SConscript files ...
- scons: done reading SConscript files.
- scons: Building targets ...
- scons: done building targets.
-
- These message might interfere with scripts that examine SCons
- output. These messages may be suppressed with the new -Q option.
-
- - User defined build arguments passed into builder calls are no
- longer given to emitters, generators, and function actions as
- keyword arguments, but are instead passed as construction
- variables.
-
SCons is developed with an extensive regression test suite, and a
rigorous development methodology for continually improving that suite.
Because of this, SCons is of sufficient quality that you can use it
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index 364798c..461d770 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -102,12 +102,12 @@ class SharedFlagChecker:
for tgt in target:
tgt.attributes.shared = self.shared
- for src in source:
- if hasattr(src.attributes, 'shared'):
- if self.shared and not src.attributes.shared:
- raise SCons.Errors.UserError, "Source file: %s is static and is not compatible with shared target: %s" % (src, target[0])
- elif not self.shared and src.attributes.shared:
- raise SCons.Errors.UserError, "Source file: %s is shared and is not compatible with static target: %s" % (src, target[0])
+ same = env.subst('$STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME')
+ if same == '0' or same == '' or same == 'False':
+ for src in source:
+ if hasattr(src.attributes, 'shared'):
+ if self.shared and not src.attributes.shared:
+ raise SCons.Errors.UserError, "Source file: %s is static and is not compatible with shared target: %s" % (src, target[0])
SharedCheck = SCons.Action.Action(SharedFlagChecker(1, 0), None)
StaticCheck = SCons.Action.Action(SharedFlagChecker(0, 0), None)
diff --git a/src/engine/SCons/Tool/gcc.py b/src/engine/SCons/Tool/gcc.py
index 8649707..677c322 100644
--- a/src/engine/SCons/Tool/gcc.py
+++ b/src/engine/SCons/Tool/gcc.py
@@ -59,9 +59,10 @@ def generate(env, platform):
env['SHCC'] = '$CC'
env['SHCCFLAGS'] = '$CCFLAGS -fPIC'
env['SHCCCOM'] = '$SHCC $SHCCFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES'
-
+ env['SHOBJSUFFIX'] = '.os'
env['INCPREFIX'] = '-I'
env['INCSUFFIX'] = ''
+ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0
env['CFILESUFFIX'] = '.c'
diff --git a/src/engine/SCons/Tool/mingw.py b/src/engine/SCons/Tool/mingw.py
index d381910..2e2a2a5 100644
--- a/src/engine/SCons/Tool/mingw.py
+++ b/src/engine/SCons/Tool/mingw.py
@@ -128,6 +128,8 @@ def generate(env, platform):
env['AS'] = 'as'
env['WIN32DEFPREFIX'] = ''
env['WIN32DEFSUFFIX'] = '.def'
+ env['SHOBJSUFFIX'] = '.o'
+ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
env['RC'] = 'windres'
env['RCFLAGS'] = ''
diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py
index cc4411d..533d84e 100644
--- a/src/engine/SCons/Tool/msvc.py
+++ b/src/engine/SCons/Tool/msvc.py
@@ -270,6 +270,7 @@ def generate(env, platform):
env['INCPREFIX'] = '/I'
env['INCSUFFIX'] = ''
env['OBJEMITTER'] = object_emitter
+ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
env['RC'] = 'rc'
env['RCFLAGS'] = ''