aboutsummaryrefslogtreecommitdiff
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
commit1e7ff5a23347851ec69cc43cb984c08f1ac609fa (patch)
tree57bb8c1e5850916b87b03574f63dd90ca8975fde
parent1c0fc0cef63f1cb0687961cafbc392b9afd141d8 (diff)
downloadmailfromd-1e7ff5a23347851ec69cc43cb984c08f1ac609fa.tar.gz
mailfromd-1e7ff5a23347851ec69cc43cb984c08f1ac609fa.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.
-rwxr-xr-xbootstrap49
-rw-r--r--configure.ac5
-rw-r--r--gacopyz/Makefile.am2
-rw-r--r--mfd/Makefile.am22
4 files changed, 64 insertions, 14 deletions
diff --git a/bootstrap b/bootstrap
index a93ee909..750dc3c7 100755
--- a/bootstrap
+++ b/bootstrap
@@ -420,12 +420,57 @@ version_controlled_file() {
else
echo "$0: no version control for $dir/$file?" >&2
fi
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=
sep=
for file in `ls -a $1/$dir`; do
case $file in
@@ -441,12 +486,16 @@ 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
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
diff --git a/configure.ac b/configure.ac
index 4fca3bdd..bba239c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,14 +21,15 @@ m4_define([MF_VERSION_PATCH], 90)
AC_INIT([mailfromd],
MF_VERSION_MAJOR.MF_VERSION_MINOR[]m4_ifdef([MF_VERSION_PATCH],.MF_VERSION_PATCH),
[bug-mailfromd@gnu.org.ua])
AC_CONFIG_SRCDIR([mfd/main.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([1.11 gnits tar-ustar dist-bzip2 std-options])
-
+AM_INIT_AUTOMAKE([1.11 gnits tar-ustar dist-bzip2 std-options silent-rules])
+# Enable silent rules by default:
+test -z "$enable_silent_rules" && AM_DEFAULT_VERBOSITY=0
#
AC_DEFINE_UNQUOTED([MAILFROMD_VERSION_MAJOR], MF_VERSION_MAJOR,
[Major version number])
AC_DEFINE_UNQUOTED([MAILFROMD_VERSION_MINOR], MF_VERSION_MINOR,
[Minor version number])
AC_DEFINE_UNQUOTED([MAILFROMD_VERSION_PATCH],
diff --git a/gacopyz/Makefile.am b/gacopyz/Makefile.am
index d658b3e7..5eb9bde0 100644
--- a/gacopyz/Makefile.am
+++ b/gacopyz/Makefile.am
@@ -32,9 +32,9 @@ libgacopyz_a_SOURCES = \
EXTRA_DIST=trans.tab trans.awk
BUILT_SOURCES=trans.h
INCLUDES=-I$(top_srcdir)/gnu -I../gnu
trans.h: ${top_srcdir}/gacopyz/trans.tab ${top_srcdir}/gacopyz/trans.awk ${top_srcdir}/gacopyz/gacopyz.h
- $(AWK) -f ${top_srcdir}/gacopyz/trans.awk \
+ $(AM_V_GEN) $(AWK) -f ${top_srcdir}/gacopyz/trans.awk \
-vheader_file=${top_srcdir}/gacopyz/gacopyz.h\
${top_srcdir}/gacopyz/trans.tab > trans.h
diff --git a/mfd/Makefile.am b/mfd/Makefile.am
index 1595b20a..b0fc6f99 100644
--- a/mfd/Makefile.am
+++ b/mfd/Makefile.am
@@ -137,58 +137,58 @@ INCLUDES = \
LDADD = ../lib/libmf.a ../gnu/libgnu.a $(MAILUTILS_LIBS) $(MILTER) $(GEOIP_LIBS)
builtin.h: Makefile.am
node-type.h: drivers.c
- $(AWK) -v MODE=types -f $(top_srcdir)/mfd/drv.awk drivers.c > node-type.h
+ $(AM_V_GEN) $(AWK) -v MODE=types -f $(top_srcdir)/mfd/drv.awk drivers.c > node-type.h
node-tab.c: drivers.c
- $(AWK) -f $(top_srcdir)/mfd/drv.awk drivers.c > node-tab.c
+ $(AM_V_GEN) $(AWK) -f $(top_srcdir)/mfd/drv.awk drivers.c > node-tab.c
$(M4_FILES:.m4=.c): snarf.m4 init.m4
lex.c: gram.h
SUFFIXES = .m4 .c .def .h .mfi .mfh .opc .oph .cin .hin
.mfi.c:
- $(AWK) -f $(top_srcdir)/mfd/mfstat.awk \
+ $(AM_V_GEN) $(AWK) -f $(top_srcdir)/mfd/mfstat.awk \
$(top_srcdir)/mfd/mailfromd.h $< > $@
.mfi.mfh:
- $(AWK) -f $(top_srcdir)/mfd/mfstat.awk \
+ $(AM_V_GEN) $(AWK) -f $(top_srcdir)/mfd/mfstat.awk \
$(top_srcdir)/mfd/mailfromd.h $< > $@
M4=m4
.m4.c:
- $(M4) --prefix -s -DSOURCE="$<" $(top_srcdir)/mfd/snarf.m4 $< > $@-t
- sed '1{/#line/d;}' $@-t > $@
+ $(AM_V_GEN)$(M4) --prefix -s -DSOURCE="$<" $(top_srcdir)/mfd/snarf.m4 $< > $@-t && \
+ sed '1{/#line/d;}' $@-t > $@ && \
rm $@-t
.def.h:
- $(M4) --prefix $(top_srcdir)/mfd/init.m4 $(M4_FILES) $< > $@
+ $(AM_V_GEN) $(M4) --prefix $(top_srcdir)/mfd/init.m4 $(M4_FILES) $< > $@
.opc.c:
- $(AWK) -f $(top_srcdir)/mfd/opcode.awk \
+ $(AM_V_GEN) $(AWK) -f $(top_srcdir)/mfd/opcode.awk \
$(top_srcdir)/mfd/opcodes $< > $@
.oph.h:
- $(AWK) -f $(top_srcdir)/mfd/opcode.awk \
+ $(AM_V_GEN) $(AWK) -f $(top_srcdir)/mfd/opcode.awk \
$(top_srcdir)/mfd/opcodes $< > $@
optab.c optab.h: opcodes
.cin.c:
- SRCLIST=`echo $(mailfromd_SOURCES) | tr -s ' ' ','`; \
+ $(AM_V_GEN) SRCLIST=`echo $(mailfromd_SOURCES) | tr -s ' ' ','`; \
$(M4) -s -DSRCLIST="$$SRCLIST" $(top_srcdir)/mfd/debugdef.m4 $< > $@
.hin.h:
- SRCLIST=`echo $(mailfromd_SOURCES) | tr -s ' ' ','`; \
+ $(AM_V_GEN) SRCLIST=`echo $(mailfromd_SOURCES) | tr -s ' ' ','`; \
$(M4) -DSRCLIST="$$SRCLIST" $(top_srcdir)/mfd/debugdef.m4 $< > $@
debug.c: Makefile.in debugdef.m4 debug.cin
debug.h: Makefile.in debugdef.m4 debug.hin
AM_YFLAGS=-dtv

Return to:

Send suggestions and report system problems to the System administrator.