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
@@ -430,21 +430,29 @@ silent_rules_prog=' | |||
430 | # state = 1 - first line inside a rule | 430 | # state = 1 - first line inside a rule |
431 | # state = 2 - subsequent lines inside a rule | 431 | # state = 2 - subsequent lines inside a rule |
432 | # cont = 1 - this line is a continuation of the previous one | 432 | # cont = 1 - this line is a continuation of the previous one |
433 | 433 | # defn = 1 - insert AM_V_GEN/AM_V_at definitions after the initail comment | |
434 | # Print comment lines | 434 | # Print comment lines |
435 | /^[ \t]*#/ { print; next } | 435 | /^[ \t]*#/ { print; next } |
436 | # Insert AM_V_ definitions, if required. | ||
437 | state == 0 && defn == 1 { | ||
438 | print "AM_DEFAULT_VERBOSITY=0" # FIXME | ||
439 | print "AM_V_GEN = $(am__v_GEN_$(V))" | ||
440 | print "am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))" | ||
441 | print "am__v_GEN_0 = @echo \" GEN \" $@;" | ||
442 | print "AM_V_at = $(am__v_at_$(V))" | ||
443 | print "am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))" | ||
444 | print "am__v_at_0 = @" | ||
445 | defn = 0 | ||
446 | } | ||
436 | # Start of a rule | 447 | # Start of a rule |
437 | /^[^ \t].*:/ { print; state = 1; cont = 0; next } | 448 | /^[^ \t].*:/ { print; state = 1; cont = 0; next } |
438 | # First action within the rule | 449 | # First action within the rule |
439 | state == 1 && /^\t/ { | 450 | state == 1 && /^\t/ { |
440 | # Print silent rules without changes. The second match | 451 | # Print silent rules without changes. The second match |
441 | # is necessary to handle @VAR@ substitutions. | 452 | # is necessary to handle @VAR@ substitutions. |
442 | if (match($1, /^@/) && !match($1, /@$/)) | 453 | if (!(match($1, /^@/) && !match($1, /.@$/))) |
443 | 454 | sub(/^\t[\t ]*/, "&$(AM_V_GEN)") | |
444 | else { | 455 | |
445 | sub(/^\t[\t ]*/,"") | ||
446 | print "\t$(AM_V_GEN)" $0 | ||
447 | } | ||
448 | cont = match($0, /\\$/) | 456 | cont = match($0, /\\$/) |
449 | state = 2 | 457 | state = 2 |
450 | next | 458 | next |
@@ -452,22 +460,32 @@ state == 1 && /^\t/ { | |||
452 | # All non-continuation lines within the rule are prefixed | 460 | # All non-continuation lines within the rule are prefixed |
453 | # with $(AM_V_at). | 461 | # with $(AM_V_at). |
454 | state == 2 && /^\t/ && NF > 0 { | 462 | state == 2 && /^\t/ && NF > 0 { |
455 | if (!cont) { | 463 | if (!cont) |
456 | sub(/^\t[\t ]*/,"") | 464 | sub(/^\t[\t ]*/, "&$(AM_V_at)") |
457 | print "\t$(AM_V_at)" $0 | 465 | |
458 | } else | ||
459 | |||
460 | cont = match($0, /\\$/) | 466 | cont = match($0, /\\$/) |
461 | next | 467 | next |
462 | } | 468 | } |
463 | # Everything else is output verbatim | 469 | # Everything else is output verbatim |
464 | { print }' | 470 | { print } |
471 | ' | ||
465 | 472 | ||
466 | silent_rules=yes | 473 | silent_rules=yes |
467 | grep 'AM_SILENT_RULES' configure.ac > /dev/null || | 474 | grep 'AM_SILENT_RULES' configure.ac > /dev/null || |
468 | grep '^[ ]*AM_INIT_AUTOMAKE([^)][^)]*silent-rules' configure.ac > /dev/null || | 475 | grep '^[ ]*AM_INIT_AUTOMAKE([^)][^)]*silent-rules' configure.ac > /dev/null || |
469 | silent_rules=no | 476 | silent_rules=no |
470 | 477 | ||
478 | silentize() { | ||
479 | if test "$silent_rules" = yes; then | ||
480 | case $1 in | ||
481 | *.am) defn=0;; | ||
482 | *.in) defn=1;; | ||
483 | esac | ||
484 | awk -v defn=$defn "$silent_rules_prog" $1 > ${1}-t && | ||
485 | mv ${1}-t $1 | ||
486 | fi | ||
487 | } | ||
488 | |||
471 | slurp() { | 489 | slurp() { |
472 | for dir in . `(cd $1 && find * -type d -print)`; do | 490 | for dir in . `(cd $1 && find * -type d -print)`; do |
473 | copied= | 491 | copied= |
@@ -489,10 +507,7 @@ slurp() { | |||
489 | rm -f $dir/$gnulib_mk && | 507 | rm -f $dir/$gnulib_mk && |
490 | sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk | 508 | sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk |
491 | } | 509 | } |
492 | if test "$silent_rules" = yes; then | 510 | silentize $dir/$gnulib_mk |
493 | awk "$silent_rules_prog" $dir/$gnulib_mk > $dir/${gnulib_mk}-t && | ||
494 | mv $dir/${gnulib_mk}-t $dir/${gnulib_mk} | ||
495 | fi | ||
496 | elif { test "${2+set}" = set && test -r $2/$dir/$file; } || | 511 | elif { test "${2+set}" = set && test -r $2/$dir/$file; } || |
497 | version_controlled_file $dir $file; then | 512 | version_controlled_file $dir $file; then |
498 | echo "$0: $dir/$file overrides $1/$dir/$file" | 513 | echo "$0: $dir/$file overrides $1/$dir/$file" |
@@ -651,7 +666,7 @@ if test $with_gettext = yes; then | |||
651 | '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+} | 666 | '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+} |
652 | } | 667 | } |
653 | ' po/Makevars.template >po/Makevars | 668 | ' po/Makevars.template >po/Makevars |
654 | 669 | silentize po/Makefile.in.in | |
655 | if test -d runtime-po; then | 670 | if test -d runtime-po; then |
656 | # Similarly for runtime-po/Makevars, but not quite the same. | 671 | # Similarly for runtime-po/Makevars, but not quite the same. |
657 | rm -f runtime-po/Makevars | 672 | rm -f runtime-po/Makevars |