diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 26 | ||||
-rw-r--r-- | src/RELEASE.txt | 30 | ||||
-rw-r--r-- | src/engine/SCons/Node/FS.py | 9 | ||||
-rw-r--r-- | src/engine/SCons/Script/Main.py | 18 | ||||
-rw-r--r-- | src/engine/SCons/Tool/intelc.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Tool/link.py | 15 | ||||
-rw-r--r-- | src/engine/SCons/Tool/msvs.py | 14 | ||||
-rw-r--r-- | src/engine/SCons/Tool/sunc++.py | 34 | ||||
-rw-r--r-- | src/engine/SCons/Warnings.py | 6 | ||||
-rw-r--r-- | src/script/scons.bat | 23 | ||||
-rw-r--r-- | src/setup.py | 17 |
11 files changed, 162 insertions, 34 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 17da625..4430191 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -8,6 +8,32 @@ +RELEASE 0.98.5 - Sat, 07 Jun 2008 08:20:35 -0700 + + From Benoit Belley: + + - Fix the Intel C++ compiler ABI specification for EMT64 processors. + + From David Cournapeau: + + - Issue a (suppressable) warning, not an error, when trying to link + C++ and Fortran object files into the same executable. + + From Steven Knight: + + - Update the scons.bat file so that it returns the real exit status + from SCons, even though it uses setlocal + endlocal. + + - Fix the --interactive post-build messages so it doesn't get stuck + mistakenly reporting failures after any individual build fails. + + - Fix calling File() as a File object method in some circumstances. + + - Fix setup.py installation on Mac OS X so SCons gets installed + under /usr/lcoal by default, not in the Mac OS X Python framework. + + + RELEASE 0.98.4 - Sat, 17 May 2008 22:14:46 -0700 From Benoit Belley: diff --git a/src/RELEASE.txt b/src/RELEASE.txt index 234c0ff..e5e383e 100644 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -20,11 +20,39 @@ more effectively, please sign up for the scons-users mailing list at: -RELEASE 0.98.4 - Sat, 17 May 2008 22:14:46 -0700 +RELEASE 0.98.5 - Sat, 07 Jun 2008 08:20:35 -0700 This is a release candidate for SCons 1.0. Please consult the CHANGES.txt file for a list of specific changes since last release. + Please note the following important changes since release 0.98.4: + + -- scons.bat NOW RETURNS THE REAL SCONS EXIT STATUS + + The scons.bat script shipped with SCons used to exit with + a status of 1 when it detected any failed (non-zero) exit + status from the underlying Python execution of SCons itself. + The scons.bat script now exits with the actual status + returned by SCons. + + -- SCONS NOW WARNS WHEN TRYING TO LINK C++ AND FORTRAN OBJECT FILES + + Some C++ toolchains do not understand Fortran runtimes and create + unpredictable executables when linking C++ and Fortran object + files together. SCons now issues a warning if you try to link + C++ and Fortran object files into the same executable: + + scons: warning: Using $CXX to link Fortran and C++ code together. + This may generate a buggy executable if the '/usr/bin/gcc' + compiler does not know how to deal with Fortran runtimes. + + The warning may be suppressed with either the --warning=no-link + or --warning=no-fortran-cxx-mix command line options, or by + adding either of the following lines to a SConscript file: + + SetOption('warn', 'no-link') + SetOption('warn', 'no-fortran-cxx-mix') + Please note the following important changes since release 0.98: -- SCONS NO LONGER SETS THE GNU TOOLCHAIN -fPIC FLAG IN $SHCXXFLAGS diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index b154e34..99ae822 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -2150,12 +2150,14 @@ class File(Base): def Entry(self, name): """Create an entry node named 'name' relative to the SConscript directory of this file.""" - return self.cwd.Entry(name) + cwd = self.cwd or self.fs._cwd + return cwd.Entry(name) def Dir(self, name, create=True): """Create a directory node named 'name' relative to the SConscript directory of this file.""" - return self.cwd.Dir(name, create) + cwd = self.cwd or self.fs._cwd + return cwd.Dir(name, create) def Dirs(self, pathlist): """Create a list of directories relative to the SConscript @@ -2165,7 +2167,8 @@ class File(Base): def File(self, name): """Create a file node named 'name' relative to the SConscript directory of this file.""" - return self.cwd.File(name) + cwd = self.cwd or self.fs._cwd + return cwd.File(name) #def generate_build_dict(self): # """Return an appropriate dictionary of values for building diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index 75d0117..ec00737 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -195,14 +195,17 @@ class BuildTask(SCons.Taskmaster.Task): def do_failed(self, status=2): _BuildFailures.append(self.exception[1]) global exit_status + global this_build_status if self.options.ignore_errors: SCons.Taskmaster.Task.executed(self) elif self.options.keep_going: SCons.Taskmaster.Task.fail_continue(self) exit_status = status + this_build_status = status else: SCons.Taskmaster.Task.fail_stop(self) exit_status = status + this_build_status = status def executed(self): t = self.targets[0] @@ -384,7 +387,9 @@ class QuestionTask(SCons.Taskmaster.Task): if self.targets[0].get_state() != SCons.Node.up_to_date or \ (self.top and not self.targets[0].exists()): global exit_status + global this_build_status exit_status = 1 + this_build_status = 1 self.tm.stop() def executed(self): @@ -428,7 +433,8 @@ print_stacktrace = 0 print_time = 0 sconscript_time = 0 cumulative_command_time = 0 -exit_status = 0 # exit status, assume success by default +exit_status = 0 # final exit status, assume success by default +this_build_status = 0 # "exit status" of an individual build num_jobs = None delayed_warnings = [] @@ -714,6 +720,7 @@ def version_string(label, module): def _main(parser): global exit_status + global this_build_status options = parser.values @@ -727,6 +734,7 @@ def _main(parser): default_warnings = [ SCons.Warnings.CorruptSConsignWarning, SCons.Warnings.DeprecatedWarning, SCons.Warnings.DuplicateEnvironmentWarning, + SCons.Warnings.LinkWarning, SCons.Warnings.MissingSConscriptWarning, SCons.Warnings.NoMD5ModuleWarning, SCons.Warnings.NoMetaclassSupportWarning, @@ -734,6 +742,7 @@ def _main(parser): SCons.Warnings.NoParallelSupportWarning, SCons.Warnings.MisleadingKeywordsWarning, SCons.Warnings.StackSizeWarning, ] + for warning in default_warnings: SCons.Warnings.enableWarningClass(warning) SCons.Warnings._warningOut = _scons_internal_warning @@ -974,6 +983,9 @@ def _main(parser): def _build_targets(fs, options, targets, target_top): + global this_build_status + this_build_status = 0 + progress_display.set_mode(not (options.no_progress or options.silent)) display.set_mode(not options.silent) SCons.Action.print_actions = not options.silent @@ -1143,9 +1155,11 @@ def _build_targets(fs, options, targets, target_top): if jobs.were_interrupted(): progress_display("scons: Build interrupted.") global exit_status + global this_build_status exit_status = 2 + this_build_status = 2 - if exit_status: + if this_build_status: progress_display("scons: " + failure_message) else: progress_display("scons: " + closing_message) diff --git a/src/engine/SCons/Tool/intelc.py b/src/engine/SCons/Tool/intelc.py index 020a6f7..d6f19c2 100644 --- a/src/engine/SCons/Tool/intelc.py +++ b/src/engine/SCons/Tool/intelc.py @@ -101,8 +101,8 @@ def check_abi(abi): valid_abis = {'ia32' : 'ia32', 'x86' : 'ia32', 'ia64' : 'ia64', - 'em64t' : 'ia32e', - 'amd64' : 'ia32e'} + 'em64t' : 'em64t', + 'amd64' : 'em64t'} if is_linux: valid_abis = {'ia32' : 'ia32', 'x86' : 'ia32', diff --git a/src/engine/SCons/Tool/link.py b/src/engine/SCons/Tool/link.py index 866df08..4522ba1 100644 --- a/src/engine/SCons/Tool/link.py +++ b/src/engine/SCons/Tool/link.py @@ -36,18 +36,27 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import SCons.Defaults import SCons.Tool import SCons.Util -import SCons.Errors +import SCons.Warnings from SCons.Tool.FortranCommon import isfortran cplusplus = __import__('c++', globals(), locals(), []) +issued_mixed_link_warning = False + def smart_link(source, target, env, for_signature): has_cplusplus = cplusplus.iscplusplus(source) has_fortran = isfortran(env, source) if has_cplusplus and has_fortran: - raise SCons.Errors.InternalError( - "Sorry, scons cannot yet link c++ and fortran code together.") + global issued_mixed_link_warning + if not issued_mixed_link_warning: + msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \ + "This may generate a buggy executable if the %s\n\t" + \ + "compiler does not know how to deal with Fortran runtimes." + SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning, + msg % repr(env.subst('$CXX'))) + issued_mixed_link_warning = True + return '$CXX' elif has_fortran: return '$FORTRAN' elif has_cplusplus: diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index ca1b5f6..e9d73da 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -1393,14 +1393,12 @@ def get_msvs_install_dirs(version = None, vs8suite = None): # since version numbers aren't really floats... aa = a[1:] bb = b[1:] - aal = aa.split('.') - bbl = bb.split('.') - c = int(bbl[0]) - int(aal[0]) - if c == 0: - c = int(bbl[1]) - int(aal[1]) - if c == 0: - c = int(bbl[2]) - int(aal[2]) - return c + aal = string.split(aa, '.') + bbl = string.split(bb, '.') + # sequence comparison in python is lexicographical + # which is exactly what we want. + # Note we sort backwards so the highest version is first. + return cmp(bbl,aal) installed_framework_versions.sort(versrt) diff --git a/src/engine/SCons/Tool/sunc++.py b/src/engine/SCons/Tool/sunc++.py index 36316cb..95b4516 100644 --- a/src/engine/SCons/Tool/sunc++.py +++ b/src/engine/SCons/Tool/sunc++.py @@ -42,21 +42,37 @@ cplusplus = __import__('c++', globals(), locals(), []) # use the package installer tool lslpp to figure out where cppc and what # version of it is installed def get_cppc(env): - cppcPath = env.get('CXX', None) + cxx = env.get('CXX', None) + if cxx: + cppcPath = os.path.dirname(cxx) + else: + cppcPath = None + cppcVersion = None pkginfo = env.subst('$PKGINFO') pkgchk = env.subst('$PKGCHK') - for package in ['SPROcpl']: - cmd = "%s -l %s 2>/dev/null | grep '^ *VERSION:'" % (pkginfo, package) - line = os.popen(cmd).readline() - if line: - cppcVersion = line.split()[-1] - cmd = "%s -l %s 2>/dev/null | grep '^Pathname:.*/bin/CC$' | grep -v '/SC[0-9]*\.[0-9]*/'" % (pkgchk, package) + def look_pkg_db(pkginfo=pkginfo, pkgchk=pkgchk): + version = None + path = None + for package in ['SPROcpl']: + cmd = "%s -l %s 2>/dev/null | grep '^ *VERSION:'" % (pkginfo, package) line = os.popen(cmd).readline() - cppcPath = os.path.dirname(line.split()[-1]) - break + if line: + version = line.split()[-1] + cmd = "%s -l %s 2>/dev/null | grep '^Pathname:.*/bin/CC$' | grep -v '/SC[0-9]*\.[0-9]*/'" % (pkgchk, package) + line = os.popen(cmd).readline() + if line: + path = os.path.dirname(line.split()[-1]) + break + + return path, version + + path, version = look_pkg_db() + if path and version: + cppcPath, cppcVersion = path, version + return (cppcPath, 'CC', 'CC', cppcVersion) def generate(env): diff --git a/src/engine/SCons/Warnings.py b/src/engine/SCons/Warnings.py index c9b8a26..5af9263 100644 --- a/src/engine/SCons/Warnings.py +++ b/src/engine/SCons/Warnings.py @@ -64,6 +64,9 @@ class DeprecatedTargetSignaturesWarning(DeprecatedWarning): class DuplicateEnvironmentWarning(Warning): pass +class LinkWarning(Warning): + pass + class MisleadingKeywordsWarning(Warning): pass @@ -91,6 +94,9 @@ class ReservedVariableWarning(Warning): class StackSizeWarning(Warning): pass +class FortranCxxMixWarning(LinkWarning): + pass + _warningAsException = 0 # The below is a list of 2-tuples. The first element is a class object. diff --git a/src/script/scons.bat b/src/script/scons.bat index 56443c8..f0ffa9a 100644 --- a/src/script/scons.bat +++ b/src/script/scons.bat @@ -1,20 +1,31 @@ @REM __COPYRIGHT__
@REM __FILE__ __REVISION__ __DATE__ __DEVELOPER__
@echo off
+set SCONS_ERRORLEVEL=
if "%OS%" == "Windows_NT" goto WinNT
-REM for 9x/Me you better not have more than 9 args
+
+@REM for 9x/Me you better not have more than 9 args
python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-__VERSION__'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9
@REM no way to set exit status of this script for 9x/Me
goto endscons
+
+@REM Credit where credit is due: we return the exit code despite our
+@REM use of setlocal+endlocal using a technique from Bear's Journal:
+@REM http://code-bear.com/bearlog/2007/06/01/getting-the-exit-code-from-a-batch-file-that-is-run-from-a-python-program/
+
:WinNT
setlocal
@REM ensure the script will be executed with the Python it was installed for
set path=%~dp0;%~dp0..;%path%
python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-__VERSION__'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %*
-if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endsconsnt
+endlocal & set SCONS_ERRORLEVEL=%ERRORLEVEL%
+
+if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto returncode
if errorlevel 9009 echo you do not have python in your PATH
-@REM color 00 causes this script to exit with non-zero exit status
-if errorlevel 1 color 00
-:endsconsnt
-endlocal
+goto endscons
+
+:returncode
+exit /B %SCONS_ERRORLEVEL%
+
:endscons
+call :returncode %SCONS_ERRORLEVEL%
diff --git a/src/setup.py b/src/setup.py index 5b2212c..b49a7af 100644 --- a/src/setup.py +++ b/src/setup.py @@ -210,9 +210,22 @@ def get_scons_prefix(libdir, is_win32): return os.path.join(drive + head) return libdir +def force_to_usr_local(self): + """ + A hack to decide if we need to "force" the installation directories + to be under /usr/local. This is because Mac Os X Tiger and + Leopard, by default, put the libraries and scripts in their own + directories under /Library or /System/Library. + """ + return (sys.platform[:6] == 'darwin' and + (self.install_dir[:9] == '/Library/' or + self.install_dir[:16] == '/System/Library/')) + class install_lib(_install_lib): def finalize_options(self): _install_lib.finalize_options(self) + if force_to_usr_local(self): + self.install_dir = '/usr/local/lib' args = self.distribution.script_args if not set_explicitly("lib", args): # They didn't explicitly specify the installation @@ -233,6 +246,8 @@ class install_lib(_install_lib): class install_scripts(_install_scripts): def finalize_options(self): _install_scripts.finalize_options(self) + if force_to_usr_local(self): + self.install_dir = '/usr/local/bin' self.build_dir = os.path.join('build', 'scripts') msg = "Installed SCons scripts into %s" % self.install_dir Installed.append(msg) @@ -332,6 +347,8 @@ class install_data(_install_data): _install_data.initialize_options(self) def finalize_options(self): _install_data.finalize_options(self) + if force_to_usr_local(self): + self.install_dir = '/usr/local' if Options.install_man: if is_win32: dir = 'Doc' |