diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-05-21 15:15:09 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-05-21 15:15:09 +0300 |
commit | 9b285abfa3c46d7b751ce11bac5348a9e961c407 (patch) | |
tree | 97fd63d25449482ff575f818a0e21c2a424bf23c /bootstrap | |
parent | e05c23ef2cd57c83da5de591dbc3d7b38cb13b85 (diff) | |
download | pies-9b285abfa3c46d7b751ce11bac5348a9e961c407.tar.gz pies-9b285abfa3c46d7b751ce11bac5348a9e961c407.tar.bz2 |
More work on `silent rules' mode
* bootstrap (silent_rules_prog): Preserve leading
whitespace verbatim, when inserting the AM_V variables.
Suggested by Ralf Wildenhues.
Optionally insert the definitions of
AM_DEFAULT_VERBOSITY, AM_V_GEN and AM_V_at: useful for
po/Makefile.in.in
(silentize): New function.
(slurp): Call silentize
Call silentize on po/Makefile.in.in.
* doc/Makefile.am, etc/Makefile.am,
pies/Makefile.am, pmult/Makefile.am,
tests/Makefile.am, tests/etc/Makefile.am: Add silent rule markers.
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 51 |
1 files changed, 33 insertions, 18 deletions
@@ -427,50 +427,68 @@ version_controlled_file() { # 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 - +# defn = 1 - insert AM_V_GEN/AM_V_at definitions after the initail comment # Print comment lines /^[ \t]*#/ { print; next } +# Insert AM_V_ definitions, if required. +state == 0 && defn == 1 { + print "AM_DEFAULT_VERBOSITY=0" # FIXME + print "AM_V_GEN = $(am__v_GEN_$(V))" + print "am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))" + print "am__v_GEN_0 = @echo \" GEN \" $@;" + print "AM_V_at = $(am__v_at_$(V))" + print "am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))" + print "am__v_at_0 = @" + defn = 0 +} # 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 - } + if (!(match($1, /^@/) && !match($1, /.@$/))) + sub(/^\t[\t ]*/, "&$(AM_V_GEN)") + print 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 + if (!cont) + sub(/^\t[\t ]*/, "&$(AM_V_at)") + print cont = match($0, /\\$/) next } # Everything else is output verbatim -{ print }' +{ 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 +silentize() { + if test "$silent_rules" = yes; then + case $1 in + *.am) defn=0;; + *.in) defn=1;; + esac + awk -v defn=$defn "$silent_rules_prog" $1 > ${1}-t && + mv ${1}-t $1 + fi +} + slurp() { for dir in . `(cd $1 && find * -type d -print)`; do copied= sep= for file in `ls -a $1/$dir`; do case $file in @@ -486,16 +504,13 @@ slurp() { remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g" sed "$remove_intl" $1/$dir/$file | cmp -s - $dir/$gnulib_mk || { echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." && 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 + silentize $dir/$gnulib_mk elif { test "${2+set}" = set && test -r $2/$dir/$file; } || version_controlled_file $dir $file; then echo "$0: $dir/$file overrides $1/$dir/$file" else copied=$copied$sep$file; sep=$nl if test $file = gettext.m4; then @@ -648,13 +663,13 @@ if test $with_gettext = yes; then /^XGETTEXT_OPTIONS *=/{ s/$/ \\/ a\ '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+} } ' po/Makevars.template >po/Makevars - + silentize po/Makefile.in.in if test -d runtime-po; then # Similarly for runtime-po/Makevars, but not quite the same. rm -f runtime-po/Makevars sed ' /^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/ /^subdir *=.*/s/=.*/= runtime-po/ |