aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-05-21 11:56:59 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-05-21 11:56:59 +0300
commite05c23ef2cd57c83da5de591dbc3d7b38cb13b85 (patch)
treebbd7ca06a35fd4a0e00ed47d92fa86c5a05463c9 /bootstrap
parent557bbc589958d1c91e5c5bb84881f5198f3b5921 (diff)
downloadpies-e05c23ef2cd57c83da5de591dbc3d7b38cb13b85.tar.gz
pies-e05c23ef2cd57c83da5de591dbc3d7b38cb13b85.tar.bz2
Switch to `silent rules' mode
* bootstrap (slurp): Convert gnulib Makefile.am to support silent rules. * configure.ac (AM_INIT_AUTOMAKE): Add silent-rules. Enable silent rules by default. * gacopyz/Makefile.am, mfd/Makefile.am: Add silent rules markers.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap49
1 files changed, 49 insertions, 0 deletions
diff --git a/bootstrap b/bootstrap
index a93ee90..750dc3c 100755
--- a/bootstrap
+++ b/bootstrap
@@ -423,6 +423,51 @@ version_controlled_file() {
test $found = yes
}
+# AWK program to convert a Makefile(.am) file rules to Automake 1.11
+# silent mode.
+silent_rules_prog='
+# state = 0 - outside rules
+# state = 1 - first line inside a rule
+# state = 2 - subsequent lines inside a rule
+# cont = 1 - this line is a continuation of the previous one
+
+# Print comment lines
+/^[ \t]*#/ { print; next }
+# Start of a rule
+/^[^ \t].*:/ { print; state = 1; cont = 0; next }
+# First action within the rule
+state == 1 && /^\t/ {
+ # Print silent rules without changes. The second match
+ # is necessary to handle @VAR@ substitutions.
+ if (match($1, /^@/) && !match($1, /@$/))
+ print
+ else {
+ sub(/^\t[\t ]*/,"")
+ print "\t$(AM_V_GEN)" $0
+ }
+ cont = match($0, /\\$/)
+ state = 2
+ next
+}
+# All non-continuation lines within the rule are prefixed
+# with $(AM_V_at).
+state == 2 && /^\t/ && NF > 0 {
+ if (!cont) {
+ sub(/^\t[\t ]*/,"")
+ print "\t$(AM_V_at)" $0
+ } else
+ print
+ cont = match($0, /\\$/)
+ next
+}
+# Everything else is output verbatim
+{ print }'
+
+silent_rules=yes
+grep 'AM_SILENT_RULES' configure.ac > /dev/null ||
+ grep '^[ ]*AM_INIT_AUTOMAKE([^)][^)]*silent-rules' configure.ac > /dev/null ||
+ silent_rules=no
+
slurp() {
for dir in . `(cd $1 && find * -type d -print)`; do
copied=
@@ -444,6 +489,10 @@ slurp() {
rm -f $dir/$gnulib_mk &&
sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk
}
+ if test "$silent_rules" = yes; then
+ awk "$silent_rules_prog" $dir/$gnulib_mk > $dir/${gnulib_mk}-t &&
+ mv $dir/${gnulib_mk}-t $dir/${gnulib_mk}
+ fi
elif { test "${2+set}" = set && test -r $2/$dir/$file; } ||
version_controlled_file $dir $file; then
echo "$0: $dir/$file overrides $1/$dir/$file"

Return to:

Send suggestions and report system problems to the System administrator.