From 3cb493b88f7430aacd00f2f8e9761a587eea51b4 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Mon, 16 Aug 2004 14:43:56 +0000 Subject: [PATCH] Have the default ParseConfig() function add -pthread to both and . (Gary Oberbrunner) git-svn-id: http://scons.tigris.org/svn/scons/trunk@1030 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- doc/man/scons.1 | 7 +++++++ src/CHANGES.txt | 3 +++ src/engine/SCons/Environment.py | 3 +++ src/engine/SCons/EnvironmentTests.py | 6 +++--- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/doc/man/scons.1 b/doc/man/scons.1 index f9138a73..c4335a83 100644 --- a/doc/man/scons.1 +++ b/doc/man/scons.1 @@ -3038,6 +3038,13 @@ and .B CCFLAGS variables, respectively. +A returned +.B -pthread +option gets added to both the +.B CCFLAGS +and +.B LINKFLAGS +variables. '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .TP diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 766fbc87..6b6fdeae 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -217,6 +217,9 @@ RELEASE 0.96 - XXX - Add a section describing File and Directory Nodes and some of their attributes and methods. + - Have ParseConfig() add a returned -pthread flag to both $CCFLAGS + and $LINKFLAGS. + From Simon Perkins: - Fix a bug introduced in building shared libraries under MinGW. diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index fc4dba05..32fa1e63 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -749,6 +749,9 @@ class Base: dict['LINKFLAGS'].append(arg) elif arg[:4] == '-Wp,': dict['CPPFLAGS'].append(arg) + elif arg == '-pthread': + dict['CCFLAGS'].append(arg) + dict['LINKFLAGS'].append(arg) else: dict['CCFLAGS'].append(arg) apply(env.Append, (), dict) diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index e8f3cd84..810f3077 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -1335,7 +1335,7 @@ class EnvironmentTestCase(unittest.TestCase): def read(self): return "-I/usr/include/fum -Ibar -X\n" + \ "-L/usr/fax -Lfoo -lxxx " + \ - "-Wa,-as -Wl,-link -Wp,-cpp abc" + "-Wa,-as -Wl,-link -Wp,-cpp abc -pthread" return fake_file() try: os.popen = my_popen @@ -1347,8 +1347,8 @@ class EnvironmentTestCase(unittest.TestCase): assert env['CPPFLAGS'] == ['', '-Wp,-cpp'], env['CPPFLAGS'] assert env['LIBPATH'] == ['list', '/usr/fax', 'foo'], env['LIBPATH'] assert env['LIBS'] == ['xxx'], env['LIBS'] - assert env['LINKFLAGS'] == ['', '-Wl,-link'], env['LINKFLAGS'] - assert env['CCFLAGS'] == ['', '-X'], env['CCFLAGS'] + assert env['LINKFLAGS'] == ['', '-Wl,-link', '-pthread'], env['LINKFLAGS'] + assert env['CCFLAGS'] == ['', '-X', '-pthread'], env['CCFLAGS'] finally: os.popen = orig_popen -- 2.26.2