diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-05-21 11:56:59 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-05-21 11:56:59 +0300 |
commit | e05c23ef2cd57c83da5de591dbc3d7b38cb13b85 (patch) | |
tree | bbd7ca06a35fd4a0e00ed47d92fa86c5a05463c9 /bootstrap | |
parent | 557bbc589958d1c91e5c5bb84881f5198f3b5921 (diff) | |
download | pies-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-x | bootstrap | 49 |
1 files changed, 49 insertions, 0 deletions
@@ -423,6 +423,51 @@ version_controlled_file() { | |||
423 | test $found = yes | 423 | test $found = yes |
424 | } | 424 | } |
425 | 425 | ||
426 | # AWK program to convert a Makefile(.am) file rules to Automake 1.11 | ||
427 | # silent mode. | ||
428 | silent_rules_prog=' | ||
429 | # state = 0 - outside rules | ||
430 | # state = 1 - first line inside a rule | ||
431 | # state = 2 - subsequent lines inside a rule | ||
432 | # cont = 1 - this line is a continuation of the previous one | ||
433 | |||
434 | # Print comment lines | ||
435 | /^[ \t]*#/ { print; next } | ||
436 | # Start of a rule | ||
437 | /^[^ \t].*:/ { print; state = 1; cont = 0; next } | ||
438 | # First action within the rule | ||
439 | state == 1 && /^\t/ { | ||
440 | # Print silent rules without changes. The second match | ||
441 | # is necessary to handle @VAR@ substitutions. | ||
442 | if (match($1, /^@/) && !match($1, /@$/)) | ||
443 | |||
444 | else { | ||
445 | sub(/^\t[\t ]*/,"") | ||
446 | print "\t$(AM_V_GEN)" $0 | ||
447 | } | ||
448 | cont = match($0, /\\$/) | ||
449 | state = 2 | ||
450 | next | ||
451 | } | ||
452 | # All non-continuation lines within the rule are prefixed | ||
453 | # with $(AM_V_at). | ||
454 | state == 2 && /^\t/ && NF > 0 { | ||
455 | if (!cont) { | ||
456 | sub(/^\t[\t ]*/,"") | ||
457 | print "\t$(AM_V_at)" $0 | ||
458 | } else | ||
459 | |||
460 | cont = match($0, /\\$/) | ||
461 | next | ||
462 | } | ||
463 | # Everything else is output verbatim | ||
464 | { print }' | ||
465 | |||
466 | silent_rules=yes | ||
467 | grep 'AM_SILENT_RULES' configure.ac > /dev/null || | ||
468 | grep '^[ ]*AM_INIT_AUTOMAKE([^)][^)]*silent-rules' configure.ac > /dev/null || | ||
469 | silent_rules=no | ||
470 | |||
426 | slurp() { | 471 | slurp() { |
427 | for dir in . `(cd $1 && find * -type d -print)`; do | 472 | for dir in . `(cd $1 && find * -type d -print)`; do |
428 | copied= | 473 | copied= |
@@ -444,6 +489,10 @@ slurp() { | |||
444 | rm -f $dir/$gnulib_mk && | 489 | rm -f $dir/$gnulib_mk && |
445 | sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk | 490 | sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk |
446 | } | 491 | } |
492 | if test "$silent_rules" = yes; then | ||
493 | awk "$silent_rules_prog" $dir/$gnulib_mk > $dir/${gnulib_mk}-t && | ||
494 | mv $dir/${gnulib_mk}-t $dir/${gnulib_mk} | ||
495 | fi | ||
447 | elif { test "${2+set}" = set && test -r $2/$dir/$file; } || | 496 | elif { test "${2+set}" = set && test -r $2/$dir/$file; } || |
448 | version_controlled_file $dir $file; then | 497 | version_controlled_file $dir $file; then |
449 | echo "$0: $dir/$file overrides $1/$dir/$file" | 498 | echo "$0: $dir/$file overrides $1/$dir/$file" |