[hackers] [wmii] Speedup build somewhat. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Tue, 27 Jul 2010 18:46:00 +0000 (UTC)

changeset: 2771:dc0e9ccda24f
user: Kris Maglione <kris_AT_suckless.org>
date: Tue Jul 27 14:28:04 2010 -0400
files: cmd/wmii/mouse.c mk/hdr.mk util/compile
description:
Speedup build somewhat.

diff -r 8b5f415a90fb -r dc0e9ccda24f cmd/wmii/mouse.c
--- a/cmd/wmii/mouse.c Wed Jul 21 10:08:01 2010 -0400
+++ b/cmd/wmii/mouse.c Tue Jul 27 14:28:04 2010 -0400
@@ -63,13 +63,9 @@
 
 void
 destroyconstraintwin(Window *w) {
- Window *w2;
 
- if(w->aux) {
- w2 = w->aux;
- sethandler(w2, nil);
- destroywindow(w2);
- }
+ if(w->aux)
+ destroywindow(w->aux);
         destroywindow(w);
 }
 
diff -r 8b5f415a90fb -r dc0e9ccda24f mk/hdr.mk
--- a/mk/hdr.mk Wed Jul 21 10:08:01 2010 -0400
+++ b/mk/hdr.mk Tue Jul 27 14:28:04 2010 -0400
@@ -22,6 +22,11 @@
 
 EXCFLAGS = $(INCLUDES) -D_XOPEN_SOURCE=600
 
+# Try to avoid bash if possible. It slows the build considerably.
+SHELL := $(shell which /bin/dash 2>/dev/null || echo /bin/sh)
+SHELL != which /bin/dash 2>/dev/null || echo /bin/sh
+.SHELL: name=sh path=$(SHELL)
+
 COMPILE_FLAGS = $(EXCFLAGS) $(CFLAGS)
 COMPILE = $(SHELL) $(ROOT)/util/compile "$(CC)" "$(PACKAGES)" "$(COMPILE_FLAGS)"
 COMPILEPIC = $(SHELL) $(ROOT)/util/compile "$(CC)" "$(PACKAGES)" "$(COMPILE_FLAGS) $(SOCFLAGS)"
diff -r 8b5f415a90fb -r dc0e9ccda24f util/compile
--- a/util/compile Wed Jul 21 10:08:01 2010 -0400
+++ b/util/compile Tue Jul 27 14:28:04 2010 -0400
@@ -8,11 +8,10 @@
 
 outfile="$1"; shift
 bin="$(echo $0 | sed 's,/[^/]*$,,')"
+xtmp=/tmp/cc.$$.$USER.out
 
 # Derived from Russ Cox's 9c in plan9port.
 
-xtmp=/tmp/cc.$$.$USER.out
-
 echo CC $($bin/cleanname ${BASE}$outfile)
 [ -n "$noisycc" ] && echo $CC -o $outfile $CFLAGS $@
 eval '$CC -o $outfile '"$CFLAGS"' $@ >$xtmp 2>&1'
@@ -50,7 +49,16 @@
                 nl=0
                 maxl=6
         }
+ /: (error|note): .?Each undeclared identifier|: error: for each function it appears|is dangerous, better use|is almost always misused|: In function |: At top level:|support .long long.|use of C99 long long|ISO C forbids conversion|warning:.*warn_unused_result/ {
+ next
+ }
+ $1 == "warning:" {
+ t = $2 " " $1
+ sub(/^[^ ]+ [^ ]+ /, "")
+ $0 = t " " $0
+ }
         {
+ sub(/\[/, ": [", $1)
                 if(nl == maxl)
                         shift()
                 l[++nl] = $0
@@ -62,12 +70,8 @@
 }
 
 cat $xtmp | sed "s,^$re,$base&,g; s,\([[:space:]]\)$re,\1$base\2,g" |
- egrep -iv ': (error|note): .?Each undeclared identifier|: error: for each function it appears|is dangerous, better use|is almost always misused|: In function |: At top level:|support .long long.|use of C99 long long|ISO C forbids conversion|warning:.*warn_unused_result' |
         sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' |
- awk '$1 == "warning:"{t=$2" "$1; sub(/^[^ ]+ [^ ]+ /, ""); $0 = t" "$0}; //' |
- awk '{sub(/\[/, ": [", $1); print}' |
- undup 1>&2
-
+ undup >&2
 rm -f $xtmp
 exit $status
 
Received on Tue Jul 27 2010 - 20:46:00 CEST

This archive was generated by hypermail 2.2.0 : Tue Jul 27 2010 - 20:48:03 CEST