summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2014-08-09 17:53:22 (GMT)
committerRussel Winder <russel@winder.org.uk>2014-08-09 17:53:22 (GMT)
commit22f309a6bfcc2621fc7011813adbb14efa4559c5 (patch)
tree61e10cf8079f383863e8bdf44c1559a688e415c2 /src
parent032c4d44d99c4ea306f2541cafa9150e57024c21 (diff)
parent1e7356e2a4f660c6f1cd42b92aec0c47233c1a2d (diff)
downloadSCons-22f309a6bfcc2621fc7011813adbb14efa4559c5.zip
SCons-22f309a6bfcc2621fc7011813adbb14efa4559c5.tar.gz
SCons-22f309a6bfcc2621fc7011813adbb14efa4559c5.tar.bz2
Merge heads.
Diffstat (limited to 'src')
-rw-r--r--src/Announce.txt2
-rw-r--r--src/CHANGES.txt15
-rw-r--r--src/engine/SCons/Defaults.py27
-rw-r--r--src/engine/SCons/Environment.py40
-rw-r--r--src/engine/SCons/EnvironmentTests.py5
-rw-r--r--src/engine/SCons/SConf.py15
-rw-r--r--src/engine/SCons/Tool/JavaCommon.py4
-rw-r--r--src/engine/SCons/Tool/dmd.py2
-rw-r--r--src/engine/SCons/Tool/docbook/docs/manual.xml2
-rw-r--r--src/engine/SCons/Tool/gdc.py2
-rw-r--r--src/engine/SCons/Tool/ldc.py2
-rw-r--r--src/engine/SCons/Tool/packaging/rpm.py2
12 files changed, 89 insertions, 29 deletions
diff --git a/src/Announce.txt b/src/Announce.txt
index 38e517f..83fe421 100644
--- a/src/Announce.txt
+++ b/src/Announce.txt
@@ -19,7 +19,7 @@ effectively, please go to http://scons.org/lists.php#users to sign up for
the scons-users mailing list.
-RELEASE 2.3.2
+RELEASE 2.3.2.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
Please consult the RELEASE.txt file for a summary of changes since the last
release and consult the CHANGES.txt file for complete a list of changes
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 4821e40..c8c1fbf 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -6,6 +6,21 @@
RELEASE 2.3.2.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
+ From Manuel Francisco Naranjo:
+ - Added a default for the BUILDERS environment variable,
+ to prevent not defined exception on a Clone().
+
+ From Andrew Featherstone:
+ - Added description of CheckTypeSize method (#1991).
+ - Fixed handling of CPPDEFINE var in Append()
+ for several list-dict combinations (#2900).
+
+ From William Blevins:
+ - Added test for Java derived-source dependency tree generation.
+ - Added Copy Action symlink soft-copy support (#2395).
+
+RELEASE 2.3.2
+
From veon on bitbucket:
- Fixed handling of nested ifs in CPP scanner PreProcessor class.
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index 563e5a8..3f60bc0 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -181,20 +181,37 @@ def chmod_strfunc(dest, mode):
Chmod = ActionFactory(chmod_func, chmod_strfunc)
-def copy_func(dest, src):
+def copy_func(dest, src, symlinks=True):
+ """
+ If symlinks (is true), then a symbolic link will be
+ shallow copied and recreated as a symbolic link; otherwise, copying
+ a symbolic link will be equivalent to copying the symbolic link's
+ final target regardless of symbolic link depth.
+ """
+
+ dest = str(dest)
+ src = str(src)
+
SCons.Node.FS.invalidate_node_memos(dest)
if SCons.Util.is_List(src) and os.path.isdir(dest):
for file in src:
shutil.copy2(file, dest)
return 0
+ elif os.path.islink(src):
+ linkto = os.readlink(src)
+ if symlinks:
+ return os.symlink(linkto, dest)
+ else:
+ return copy_func(dest, linkto, symlinks)
elif os.path.isfile(src):
return shutil.copy2(src, dest)
else:
- return shutil.copytree(src, dest, 1)
+ return shutil.copytree(src, dest, symlinks)
-Copy = ActionFactory(copy_func,
- lambda dest, src: 'Copy("%s", "%s")' % (dest, src),
- convert=str)
+Copy = ActionFactory(
+ copy_func,
+ lambda dest, src, symlinks=True: 'Copy("%s", "%s")' % (dest, src)
+)
def delete_func(dest, must_exist=0):
SCons.Node.FS.invalidate_node_memos(dest)
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index d178f49..62d6809 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -1206,7 +1206,13 @@ class Base(SubstitutionEnvironment):
# based on what we think the value looks like.
if SCons.Util.is_List(val):
if key == 'CPPDEFINES':
- orig = orig.items()
+ tmp = []
+ for (k, v) in orig.iteritems():
+ if v is not None:
+ tmp.append((k, v))
+ else:
+ tmp.append((k,))
+ orig = tmp
orig += val
self._dict[key] = orig
else:
@@ -1286,8 +1292,15 @@ class Base(SubstitutionEnvironment):
else:
tmp.append((i,))
val = tmp
+ # Construct a list of (key, value) tuples.
if SCons.Util.is_Dict(dk):
- dk = dk.items()
+ tmp = []
+ for (k, v) in dk.iteritems():
+ if v is not None:
+ tmp.append((k, v))
+ else:
+ tmp.append((k,))
+ dk = tmp
elif SCons.Util.is_String(dk):
dk = [(dk,)]
else:
@@ -1327,8 +1340,15 @@ class Base(SubstitutionEnvironment):
else:
tmp.append((i,))
dk = tmp
+ # Construct a list of (key, value) tuples.
if SCons.Util.is_Dict(val):
- val = val.items()
+ tmp = []
+ for (k, v) in val.iteritems():
+ if v is not None:
+ tmp.append((k, v))
+ else:
+ tmp.append((k,))
+ val = tmp
elif SCons.Util.is_String(val):
val = [(val,)]
if delete_existing:
@@ -1351,7 +1371,13 @@ class Base(SubstitutionEnvironment):
if SCons.Util.is_String(dk):
dk = [dk]
elif SCons.Util.is_Dict(dk):
- dk = dk.items()
+ tmp = []
+ for (k, v) in dk.iteritems():
+ if v is not None:
+ tmp.append((k, v))
+ else:
+ tmp.append((k,))
+ dk = tmp
if SCons.Util.is_String(val):
if val in dk:
val = []
@@ -1378,10 +1404,8 @@ class Base(SubstitutionEnvironment):
(like a function). There are no references to any mutable
objects in the original Environment.
"""
- try:
- builders = self._dict['BUILDERS']
- except KeyError:
- pass
+
+ builders = self._dict.get('BUILDERS', {})
clone = copy.copy(self)
# BUILDERS is not safe to do a simple copy
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index 5235342..b9ef3f2 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -1892,6 +1892,11 @@ def generate(env):
env = env.Clone(KEY_THAT_I_WANT=6, tools=[my_tool])
assert env['KEY_THAT_I_WANT'] == real_value[0], env['KEY_THAT_I_WANT']
+ # test for pull request #150
+ env = self.TestEnvironment()
+ env._dict.pop('BUILDERS')
+ assert env.has_key('BUILDERS') is False
+ env2 = env.Clone()
def test_Copy(self):
"""Test copying using the old env.Copy() method"""
diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py
index dd93269..d6a70ec 100644
--- a/src/engine/SCons/SConf.py
+++ b/src/engine/SCons/SConf.py
@@ -2,14 +2,13 @@
Autoconf-like configuration support.
-In other words, this package allows to run series of tests to detect
-capabilities of current system and generate config files (header files
-in C/C++) that turn on system-specific options and optimizations.
-
-For example, it is possible to detect if optional libraries are present
-on current system and generate config that makes compiler include them.
-C compilers do not have ability to catch ImportError if some library is
-not found, so these checks should be done externally.
+In other words, SConf allows to run tests on the build machine to detect
+capabilities of system and do some things based on result: generate config
+files, header files for C/C++, update variables in environment.
+
+Tests on the build system can detect if compiler sees header files, if
+libraries are installed, if some command line options are supported etc.
+
"""
#
diff --git a/src/engine/SCons/Tool/JavaCommon.py b/src/engine/SCons/Tool/JavaCommon.py
index 6dd6051..8b13f9f 100644
--- a/src/engine/SCons/Tool/JavaCommon.py
+++ b/src/engine/SCons/Tool/JavaCommon.py
@@ -65,7 +65,7 @@ if java_parsing:
def __init__(self, version=default_java_version):
if not version in ('1.1', '1.2', '1.3','1.4', '1.5', '1.6', '1.7',
- '5', '6'):
+ '1.8', '5', '6'):
msg = "Java version %s not supported" % version
raise NotImplementedError(msg)
@@ -171,7 +171,7 @@ if java_parsing:
if self.version in ('1.1', '1.2', '1.3', '1.4'):
clazz = self.listClasses[0]
self.listOutputs.append('%s$%d' % (clazz, self.nextAnon))
- elif self.version in ('1.5', '1.6', '1.7', '5', '6'):
+ elif self.version in ('1.5', '1.6', '1.7', '1.8', '5', '6'):
self.stackAnonClassBrackets.append(self.brackets)
className = []
className.extend(self.listClasses)
diff --git a/src/engine/SCons/Tool/dmd.py b/src/engine/SCons/Tool/dmd.py
index 437720f..082d5c3 100644
--- a/src/engine/SCons/Tool/dmd.py
+++ b/src/engine/SCons/Tool/dmd.py
@@ -126,7 +126,7 @@ def generate(env):
env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr'
- env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '')
+ env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '')
#env['_DLIBFLAGS'] = '$( ${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)} $)'
diff --git a/src/engine/SCons/Tool/docbook/docs/manual.xml b/src/engine/SCons/Tool/docbook/docs/manual.xml
index 60e94bc..c129753 100644
--- a/src/engine/SCons/Tool/docbook/docs/manual.xml
+++ b/src/engine/SCons/Tool/docbook/docs/manual.xml
@@ -263,7 +263,7 @@ with large input files may occur. There will definitely arise the need for
adding features, or a variable. Let us know if you can think of a nice
improvement or have worked on a bugfix/patch with success. Enter your issues at the
Launchpad bug tracker for the Docbook Tool, or write to the User General Discussion
-list of SCons at <literal>scons-users@tigris.org</literal>.
+list of SCons at <literal>scons-users@scons.org</literal>.
</para>
</section>
diff --git a/src/engine/SCons/Tool/gdc.py b/src/engine/SCons/Tool/gdc.py
index fb8fea8..1178b85 100644
--- a/src/engine/SCons/Tool/gdc.py
+++ b/src/engine/SCons/Tool/gdc.py
@@ -100,7 +100,7 @@ def generate(env):
env['SHDLINKCOM'] = '$DLINK -o $TARGET $DLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr'
- env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLINKLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '')
+ env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLINKLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '')
env['_DLIBFLAGS'] = '$( ${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)} $)'
diff --git a/src/engine/SCons/Tool/ldc.py b/src/engine/SCons/Tool/ldc.py
index 13844e8..6b215e2 100644
--- a/src/engine/SCons/Tool/ldc.py
+++ b/src/engine/SCons/Tool/ldc.py
@@ -115,7 +115,7 @@ def generate(env):
env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr'
- env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '')
+ env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '')
#env['_DLIBFLAGS'] = '$( ${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)} $)'
diff --git a/src/engine/SCons/Tool/packaging/rpm.py b/src/engine/SCons/Tool/packaging/rpm.py
index 07857d1..2bc3063 100644
--- a/src/engine/SCons/Tool/packaging/rpm.py
+++ b/src/engine/SCons/Tool/packaging/rpm.py
@@ -182,7 +182,7 @@ def build_specfile_sections(spec):
spec['X_RPM_PREP'] = '[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"' + '\n%setup -q'
if 'X_RPM_BUILD' not in spec:
- spec['X_RPM_BUILD'] = 'mkdir "$RPM_BUILD_ROOT"'
+ spec['X_RPM_BUILD'] = '[ ! -e "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && mkdir "$RPM_BUILD_ROOT"'
if 'X_RPM_INSTALL' not in spec:
spec['X_RPM_INSTALL'] = 'scons --install-sandbox="$RPM_BUILD_ROOT" "$RPM_BUILD_ROOT"'