1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
#! /bin/sh /usr/share/dpatch/dpatch-run
## 603-trim-build-output.dpatch by <kmccarty@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Trim compiler flags from build output to reduce size of logs on buildds.
@DPATCH@
diff -urNad cernlib-2005.05.09/src/config/fortran.rules /tmp/dpep.NZAyHH/cernlib-2005.05.09/src/config/fortran.rules
--- cernlib-2005.05.09~/src/config/fortran.rules 1997-05-30 12:25:18.000000000 -0400
+++ cernlib-2005.05.09/src/config/fortran.rules 2005-06-09 16:36:43.413985115 -0400
@@ -137,6 +137,22 @@
#endif
/*
+ * PrettyPrintCmd - Execute the compiler command, but remove all -flags
+ * from the printout, in order to reduce the size of build logs.
+ * -- Kevin McCarty, for Debian. */
+#ifndef PrettyPrintCmd
+#define PrettyPrintCmd(command)@( set -e ; \ @@\
+ PRETTYCMD="`echo 'command' | sed -e 's/Null$qParameter//g' \ @@\
+ -e 's/[[:space:]]-[^[:space:]]*/ /g' \ @@\
+ -e 's/[[:space:]][^[:space:]]*\.o[[:space:]]/ /g' \ @@\
+ -e 's/[[:space:]][^[:space:]]*\.o$$//g' \ @@\
+ -e 's,/[^[:space:]]*/,,g' \ @@\
+ -e 's/[[:space:]][[:space:]]*/ /g'`" ; \ @@\
+ echo $$PRETTYCMD ; EXIT="" ; \ @@\
+ command > /dev/null || EXIT=$$? ; [ -n "$$EXIT" ] && \ @@\
+ echo Failing c$qommand: 'command' || true; exit $$EXIT )
+#endif
+/*
* FortranLinkRule - link a fortran program
*/
#ifndef FortranLinkRule
@@ -291,15 +307,15 @@
#ifndef ObjectFortranCompile
#if FortranDoesCpp
#ifdef SGIArchitecture
-#define ObjectFortranCompile(options) RemoveFile($@) @@\
+#define ObjectFortranCompile(options) @RemoveFile($@) @@\
sed -e "/^#[ ]*else/s/else/elif 1/" $< > s_$(<F) @@\
RunFortranCompile(options $(FORTRANOPTIONS) $(FORTRANALLDEFINES),s_$(<F))
#else
-#define ObjectFortranCompile(options) RemoveFile($@) @@\
+#define ObjectFortranCompile(options) @RemoveFile($@) @@\
RunFortranCompile(options $(FORTRANOPTIONS) $(FORTRANALLDEFINES),$<)
#endif
#else
-#define ObjectFortranCompile(options) RemoveFile($@) @@\
+#define ObjectFortranCompile(options) @RemoveFile($@) @@\
MakeFortranSource($<,$(<F:.Fsuf=.fsuf)) @@\
ifneq ($(MAKEFORTRANSOURCEONLY),yes) @@\
RunFortranCompile(options $(FORTRANOPTIONS),$(<F:.Fsuf=.fsuf)) @@\
@@ -313,10 +329,10 @@
#ifndef RunFortranCompile
#ifndef FortranCannotRedirectObject
#define RunFortranCompile(options,source)\
- $(FC) -c options -o $@ source
+ PrettyPrintCmd($(FC) -c options -o $@ source)
#else
#define RunFortranCompile(options,source)\
- $(FC) -c options source && mv $(@F) $@
+ PrettyPrintCmd($(FC) -c options source) && mv $(@F) $@
#endif
#endif
@@ -375,8 +391,8 @@
#endif
#ifndef LibObjCompile
-#define LibObjCompile(dir,options) RemoveFile($@) @@\
- $(CC) -c options $(CCOPTIONS) $(ALLDEFINES) $< -o $@
+#define LibObjCompile(dir,options) @RemoveFile($@) @@\
+ PrettyPrintCmd($(CC) -c options $(CCOPTIONS) $(ALLDEFINES) $< -o $@)
#endif
@@ -421,7 +437,7 @@
#define MakeDepend(dir,flags)\
-@if [ ! -d dir ] ; then mkdir dir; fi @@\
@ $(TOUCH) $@.tmp @@\
- $(DEPEND) -f$@.tmp -p dir/ -- flags $< @@\
+ PrettyPrintCmd($(DEPEND) -f$@.tmp -p dir/ -- flags $<) 2> /dev/null @@\
@ sed 's=$*\.o=& $@=g' $@.tmp > $@ @@\
@ RemoveFiles($@.tmp $@.tmp.bak)
#endif
|