summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-29 08:30:29 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:15 +1000
commit3d4c99207dc21346e39ea3d6950be91bf0560598 (patch)
treed5f6f5796b331ecc436e9f7b2f643ab2dcc20e85 /buildtools/wafsamba
parentc6e73cb3b601dbbe737a7692e53c6fb9c72dff7b (diff)
downloadsamba-3d4c99207dc21346e39ea3d6950be91bf0560598.tar.gz
samba-3d4c99207dc21346e39ea3d6950be91bf0560598.tar.bz2
samba-3d4c99207dc21346e39ea3d6950be91bf0560598.zip
build: use 'Compiling foo.c' and 'Linking foo' like old build system
When -p is not used, display compilation messages similarly to the old build system, but with a progress indicator
Diffstat (limited to 'buildtools/wafsamba')
-rw-r--r--buildtools/wafsamba/wafsamba.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 9db21a466d..afe900befd 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -751,3 +751,22 @@ def PKG_CONFIG_FILES(bld, pc_files):
target=f)
INSTALL_FILES(bld, dest, f, flat=True, destname=base)
Build.BuildContext.PKG_CONFIG_FILES = PKG_CONFIG_FILES
+
+
+# override the display of the compilation and linking messages
+def progress(self):
+ return "[%d/%d]" % (self.position[0], self.position[1])
+
+def cc_display(self):
+ if Options.options.progress_bar != 0:
+ return Task.Task.display(self)
+ fname = self.inputs[0].bldpath(self.env)[3:]
+ return "%s Compiling %s\n" % (progress(self), fname)
+Task.TaskBase.classes['cc'].display = cc_display
+
+def link_display(self):
+ if Options.options.progress_bar != 0:
+ return Task.Task.display(self)
+ fname = self.outputs[0].bldpath(self.env)
+ return "%s Linking %s\n" % (progress(self), fname)
+Task.TaskBase.classes['cc_link'].display = link_display