Patchwork libgo patch committed: Don't force rebuild if sysinfo.go doesn't change

login
register
mail settings
Submitter Ian Taylor
Date Jan. 27, 2011, 11:25 p.m.
Message ID <mcrk4hqnd3o.fsf@google.com>
Download mbox | patch
Permalink /patch/80755/
State New
Headers show

Comments

Ian Taylor - Jan. 27, 2011, 11:25 p.m.
This libgo patch avoids rebuilding everything if mksysinfo.sh changes
but the generated file sysinfo.go does not.  Bootstrapped on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

Patch

diff -r efda472768df libgo/Makefile.am
--- a/libgo/Makefile.am	Thu Jan 27 14:48:41 2011 -0800
+++ b/libgo/Makefile.am	Thu Jan 27 15:23:07 2011 -0800
@@ -2464,8 +2464,12 @@ 
 	$(CHECK)
 .PHONY: testing/script/check
 
-sysinfo.go: $(srcdir)/mksysinfo.sh config.h
+sysinfo.go: s-sysinfo; @true
+s-sysinfo: $(srcdir)/mksysinfo.sh config.h
 	CC="$(CC)" $(SHELL) $(srcdir)/mksysinfo.sh
+	$(SHELL) $(srcdir)/../move-if-change tmp-sysinfo.go sysinfo.go
+	$(STAMP) $@
+
 syscalls/libsyscall.a: $(go_syscall_files) $(go_syscall_c_files) sync.gox
 	rm -f syscall.gox syscalls/libsyscall.a
 	test -d syscalls || $(MKDIR_P) syscalls
diff -r efda472768df libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh	Thu Jan 27 14:48:41 2011 -0800
+++ b/libgo/mksysinfo.sh	Thu Jan 27 15:23:07 2011 -0800
@@ -21,8 +21,6 @@ 
 
 set -e
 
-rm -f sysinfo.go
-
 rm -f sysinfo.c
 cat > sysinfo.c <<EOF
 #include "config.h"
@@ -388,5 +386,4 @@ 
       -e 's/msg_flags/Flags/' \
     >> ${OUT}
 
-mv -f ${OUT} sysinfo.go
 exit $?