Skip to content

Commit a73227b

Browse files
committed
Upgrade waf to 1.5.10
1 parent 4ddfd8a commit a73227b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+623
-385
lines changed

tools/waf-light

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if 'PSYCOWAF' in os.environ:
3737
try:import psyco;psyco.full()
3838
except:pass
3939

40-
VERSION="1.5.9"
40+
VERSION="1.5.10"
4141
REVISION="x"
4242
INSTALL="x"
4343
C1='x'
@@ -75,8 +75,11 @@ def unpack_wafdir(dir):
7575
import shutil, tarfile
7676
try: shutil.rmtree(dir)
7777
except OSError: pass
78-
try: os.makedirs(join(dir, 'wafadmin', 'Tools'))
79-
except OSError: err("Cannot unpack waf lib into %s\nMove waf into a writeable directory" % dir)
78+
try:
79+
for x in ['Tools', '3rdparty']:
80+
os.makedirs(join(dir, 'wafadmin', x))
81+
except OSError:
82+
err("Cannot unpack waf lib into %s\nMove waf into a writeable directory" % dir)
8083

8184
os.chdir(dir)
8285
tmp = 't.tbz2'
@@ -94,7 +97,8 @@ def unpack_wafdir(dir):
9497
except OSError: pass
9598
err("Waf cannot be unpacked, check that bzip2 support is present")
9699

97-
os.chmod(join('wafadmin','Tools'), 493)
100+
for x in ['Tools', '3rdparty']:
101+
os.chmod(join('wafadmin',x), 493)
98102

99103
os.unlink(tmp)
100104

@@ -142,7 +146,8 @@ def find_lib():
142146
wafdir = find_lib()
143147
w = join(wafdir, 'wafadmin')
144148
t = join(w, 'Tools')
145-
sys.path = [w, t] + sys.path
149+
f = join(w, '3rdparty')
150+
sys.path = [w, t, f] + sys.path
146151

147152
import Scripting
148153
Scripting.prepare(t, cwd, VERSION, wafdir)

tools/wafadmin/3rdparty/fluid.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/python
2+
# encoding: utf-8
3+
# Grygoriy Fuchedzhy 2009
4+
5+
"""
6+
Compile fluid files (fltk graphic library). Use the 'fluid' feature in conjuction with the 'cxx' feature.
7+
"""
8+
9+
import Task
10+
from TaskGen import extension
11+
12+
Task.simple_task_type('fluid', '${FLUID} -c -o ${TGT[0].abspath(env)} -h ${TGT[1].abspath(env)} ${SRC}', 'BLUE', shell=False, ext_out='.cxx')
13+
14+
@extension('.fl')
15+
def fluid(self, node):
16+
"""add the .fl to the source list; the cxx file generated will be compiled when possible"""
17+
cpp = node.change_ext('.cpp')
18+
hpp = node.change_ext('.hpp')
19+
self.create_task('fluid', node, [cpp, hpp])
20+
21+
if 'cxx' in self.features:
22+
self.allnodes.append(cpp)
23+
24+
def detect(conf):
25+
fluid = conf.find_program('fluid', var='FLUID', mandatory=True)
26+
conf.check_cfg(path='fltk-config', package='', args='--cxxflags --ldflags', uselib_store='FLTK', mandatory=True)
27+

tools/wafadmin/Build.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ def f(*k, **kw):
5757
postpone = kw['postpone']
5858
del kw['postpone']
5959

60+
# TODO waf 1.6 in theory there should be no reference to the TaskManager internals here
6061
if postpone:
6162
m = k[0].task_manager
63+
if not m.groups: m.add_group()
6264
m.groups[m.current_group].post_funs.append((fun, k, kw))
6365
kw['cwd'] = k[0].path
6466
else:
@@ -801,6 +803,9 @@ def install_files(self, path, files, env=None, chmod=O644, relative_trick=False,
801803
else:
802804
lst = Utils.to_list(files)
803805

806+
if not getattr(lst, '__iter__', False):
807+
lst = [lst]
808+
804809
destpath = self.get_install_path(path, env)
805810

806811
Utils.check_dir(destpath)

tools/wafadmin/Constants.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"""
1010

1111
# do not touch these three lines, they are updated automatically
12-
HEXVERSION = 0x10509
13-
WAFVERSION="1.5.9"
14-
WAFREVISION = "6626:6639M"
12+
HEXVERSION = 0x105010
13+
WAFVERSION="1.5.10"
14+
WAFREVISION = "6794M"
1515
ABI = 7
1616

1717
# permissions

tools/wafadmin/Environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def detach(self):
8686
else:
8787
keys = tbl.keys()
8888
for x in keys:
89-
tbl[x] = copy.copy(tbl[x])
89+
tbl[x] = copy.deepcopy(tbl[x])
9090
self.table = tbl
9191

9292
def get_flat(self, key):

tools/wafadmin/Logs.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# encoding: utf-8
33
# Thomas Nagy, 2005 (ita)
44

5+
import ansiterm
56
import os, re, logging, traceback, sys
67
from Constants import *
78

@@ -11,7 +12,7 @@
1112
colors_lst = {
1213
'USE' : True,
1314
'BOLD' :'\x1b[01;1m',
14-
'RED' :'\x1b[01;91m',
15+
'RED' :'\x1b[01;31m',
1516
'GREEN' :'\x1b[32m',
1617
'YELLOW':'\x1b[33m',
1718
'PINK' :'\x1b[35m',
@@ -31,9 +32,13 @@
3132

3233
import Utils
3334

34-
if not got_tty or sys.platform == 'win32' or 'NOCOLOR' in os.environ:
35+
if not got_tty or 'NOCOLOR' in os.environ:
3536
colors_lst['USE'] = False
3637

38+
# test
39+
#if sys.platform == 'win32':
40+
# colors_lst['USE'] = True
41+
3742
def get_color(cl):
3843
if not colors_lst['USE']: return ''
3944
return colors_lst.get(cl, '')

tools/wafadmin/Node.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
Node: filesystem structure, contains lists of nodes
77
88
IMPORTANT:
9-
1. Each file/folder is represented by exactly one node
9+
1. Each file/folder is represented by exactly one node.
1010
1111
2. Most would-be class properties are stored in Build: nodes to depend on, signature, flags, ..
12-
unused class members increase the .wafpickle file size sensibly with lots of objects
12+
unused class members increase the .wafpickle file size sensibly with lots of objects.
1313
14-
3. The build is launched from the top of the build dir (for example, in _build_/)
14+
3. The build is launched from the top of the build dir (for example, in _build_/).
1515
1616
4. Node should not be instantiated directly.
17-
Each instance of Build.BuildContext has a Node sublass.
17+
Each instance of Build.BuildContext has a Node subclass.
1818
(aka: 'Nodu', see BuildContext initializer)
1919
The BuildContext is referenced here as self.__class__.bld
2020
Its Node class is referenced here as self.__class__

tools/wafadmin/Scripting.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def prepare_impl(t, cwd, ver, wafdir):
2727
# now find the wscript file
2828
msg1 = 'Waf: Please run waf from a directory containing a file named "%s" or run distclean' % WSCRIPT_FILE
2929

30-
# in theory projects can be configured in a gcc manner:
30+
# in theory projects can be configured in an autotool-like manner:
3131
# mkdir build && cd build && ../waf configure && ../waf
3232
build_dir_override = None
3333
candidate = None
@@ -39,7 +39,7 @@ def prepare_impl(t, cwd, ver, wafdir):
3939
candidate = cwd
4040

4141
elif 'configure' in sys.argv and not WSCRIPT_BUILD_FILE in lst:
42-
# gcc-like configuration
42+
# autotool-like configuration
4343
calldir = os.path.abspath(os.path.dirname(sys.argv[0]))
4444
if WSCRIPT_FILE in os.listdir(calldir):
4545
candidate = calldir
@@ -60,7 +60,10 @@ def prepare_impl(t, cwd, ver, wafdir):
6060
break
6161
if Options.lockfile in dirlst:
6262
env = Environment.Environment()
63-
env.load(os.path.join(cwd, Options.lockfile))
63+
try:
64+
env.load(os.path.join(cwd, Options.lockfile))
65+
except:
66+
error('could not load %r' % Options.lockfile)
6467
try:
6568
os.stat(env['cwd'])
6669
except:

tools/wafadmin/Task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ def set_run_after(self, task):
569569

570570
def add_file_dependency(self, filename):
571571
"TODO user-provided file dependencies"
572-
node = self.generator.bld.current.find_resource(filename)
572+
node = self.generator.bld.path.find_resource(filename)
573573
self.deps_nodes.append(node)
574574

575575
def signature(self):

0 commit comments

Comments
 (0)