diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-08-09 12:15:01 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-08-09 14:13:14 +0200 |
commit | 00a383739e96db6d85ca0e9f0791249c5fb481d4 (patch) | |
tree | 109bea40c6b612b422258985e2829cf9606dd1f1 /t | |
parent | e7dcff829917ab8eccd91de3a84d44b7267cf5b0 (diff) | |
download | automake-00a383739e96db6d85ca0e9f0791249c5fb481d4.tar.gz |
[ng] maintainer-mode: remove it altogether
The best explanation for this move is given by excerpts from the
Automake manual itself:
Several years ago François Pinard pointed out several arguments
against this AM_MAINTAINER_MODE macro. Most of them relate to
insecurity. By removing dependencies you get non-dependable builds:
changes to sources files can have no effect on generated files and
this can be very confusing when unnoticed. He adds that security
shouldn't be reserved to maintainers (what '--enable-maintainer-mode'
suggests), on the contrary. If one user has to modify a Makefile.am,
then either Makefile.in should be updated or a error should be output
(this is what Automake uses the 'missing' script for) but the last
thing you want is that nothing happens and the user doesn't notice
it (which is exactly what happens when rebuild rules are disabled by
AM_MAINTAINER_MODE).
Jim Meyering, the inventor of the AM_MAINTAINER_MODE macro was swayed
by François's arguments, and got rid of AM_MAINTAINER_MODE in all of
his packages.
Since in Automake-NG we are breaking backward-compatibility in several
ways already, this is a good occasion to get rid of another obsolescent,
historical-reasons-only, more-dangerous-than-useful feature.
Admittedly, the manual went on saying:
Still many people continue to use AM_MAINTAINER_MODE, because it
helps them working on projects where all files are kept under
version control, and because missing isn't enough if you have the
wrong version of the tools.
But then, the right solutions for using lies not in the use of the
brittle AM_MAINTAINER_MODE macro; such solutions are indeed already
explained in another section of the manual (in the section "CVS and
generated files"):
In distributed development, developers are likely to have different
version of the maintainer tools installed. In this case rebuilds
triggered by timestamp lossage will lead to spurious changes to
generated files. There are some popular solutions to this:
- All developers should use the same versions, so that the rebuilt
files are identical to files in CVS. (This starts to be difficult
when each project you work on uses different versions).
- Or people use a script to fix the timestamp after a checkout (the
GCC folks have such a script).
The use of such a "timestamp-fixing" script is also suggested earlier
in the section, in the discussion about the merits and limits of the
'missing' script.
* NG-NEWS: Update.
* doc/automake-ng.texi: Likewise; among the other things ...
(maintainer-mode): ... rename this node ...
(maintainer tools): ... like this.
* m4/maintainer.m4: Delete.
* Makefile.am (dist_automake_ac_DATA): Delete.
* automake.in ($seen_maint_mode): Remove this global variable.
(scan_autoconf_trace): Don't trace 'AM_MAINTAINER_MODE'.
(read_am_file): Don't special-handle '@MAINT@' substitutions;
which were an anachronism anyway, according to pre-existing
comments.
(preprocess_file): Drop 'MAINTAINER-MODE' transform.
* lib/am/configure.am: Remove all uses of the %MAINTAINER-MODE%
transform.
* lib/am/remake-hdr.am: Likewise.
* lib/am/texi-vars.am: Likewise.
* lib/am/lex.am, lib/am/yacc.am: Likewise, and simplify dropping
the definition and use of (respectively) '$(am.lex.maybe-skip)'
and '$(am.yacc.maybe-skip)'.
* t/condlib.sh (configure.ac): Drop AM_MAINTAINER_MODE use.
* t/flavor.sh: Likewise, and drop '--enable-maintainer-mode'
from the './configure' invocation.
* t/lex-pr204.sh: Remove as obsolete.
* t/yacc-pr204.sh: Likewise.
* t/maintmode-configure-msg.sh: Likewise.
* t/mmode.sh: Likewise.
* t/mmodely.sh: Likewise.
* t/remake5.sh: Likewise.
* t/lex-nodist.sh: Fix header comments to account for some of
the deleted tests.
* t/yacc-nodist.sh: Likewise.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/condlib.sh | 1 | ||||
-rwxr-xr-x | t/flavor.sh | 3 | ||||
-rwxr-xr-x | t/lex-nodist.sh | 6 | ||||
-rwxr-xr-x | t/lex-pr204.sh | 88 | ||||
-rwxr-xr-x | t/maintmode-configure-msg.sh | 72 | ||||
-rwxr-xr-x | t/mmode.sh | 64 | ||||
-rwxr-xr-x | t/mmodely.sh | 95 | ||||
-rwxr-xr-x | t/remake5.sh | 74 | ||||
-rwxr-xr-x | t/yacc-nodist.sh | 6 | ||||
-rwxr-xr-x | t/yacc-pr204.sh | 83 |
10 files changed, 5 insertions, 487 deletions
diff --git a/t/condlib.sh b/t/condlib.sh index 3c8822688..ea8e679f2 100755 --- a/t/condlib.sh +++ b/t/condlib.sh @@ -21,7 +21,6 @@ cat >> configure.ac << 'END' AC_PROG_RANLIB -AM_MAINTAINER_MODE AM_PROG_AR AC_PROG_CC END diff --git a/t/flavor.sh b/t/flavor.sh index 90e0b15b6..058e55fe2 100755 --- a/t/flavor.sh +++ b/t/flavor.sh @@ -21,7 +21,6 @@ . ./defs || exit 1 cat >> configure.ac << 'END' -AM_MAINTAINER_MODE AC_OUTPUT END @@ -38,7 +37,7 @@ $AUTOCONF for flavor in --gnits --gnu --foreign --ignore-deps; do $AUTOMAKE --add-missing $flavor - ./configure --enable-maintainer-mode + ./configure grep " $flavor" Makefile $MAKE diff --git a/t/lex-nodist.sh b/t/lex-nodist.sh index b2f7b2944..c04d613b6 100755 --- a/t/lex-nodist.sh +++ b/t/lex-nodist.sh @@ -15,10 +15,8 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # Checks for .c files derived from non-distributed .l sources. -# The test 'lex-pr204.test' does similar check with AM_MAINTAINER_MODE -# enabled. -# The tests 'yacc-nodist.test' and 'yacc-pr204.test' does similar checks -# for yacc-generated .c and .h files. +# The test 'yacc-nodist.test' does similar checks for yacc-generated +# .c and .h files. required='cc lex' . ./defs || exit 1 diff --git a/t/lex-pr204.sh b/t/lex-pr204.sh deleted file mode 100755 index 535b482ca..000000000 --- a/t/lex-pr204.sh +++ /dev/null @@ -1,88 +0,0 @@ -#! /bin/sh -# Copyright (C) 2011-2012 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Related to PR 204. -# C sources derived from nodist_ lex sources should not be distributed. -# See also related test 'lex-nodist.test'. -# The tests 'yacc-nodist.test' and 'yacc-pr204.test' does similar checks -# for yacc-generated .c and .h files. - -required='cc lex' -. ./defs || exit 1 - -cat >> configure.ac <<'EOF' -AM_MAINTAINER_MODE -AC_PROG_CC -dnl We use AC_PROG_LEX deliberately. -dnl Sister 'lex-nodist.test' should use 'AM_PROG_LEX' instead. -AC_PROG_LEX -AC_OUTPUT -EOF - -# The LEXER2 intermediate variable is there to make sure Automake -# matches 'nodist_' against the right variable name... -cat > Makefile.am << 'EOF' -EXTRA_PROGRAMS = foo -LEXER2 = lexer2.l -nodist_foo_SOURCES = lexer.l $(LEXER2) - -distdirtest: distdir - test ! -f $(distdir)/lexer.c - test ! -f $(distdir)/lexer.l - test ! -f $(distdir)/lexer.h - test ! -f $(distdir)/lexer2.c - test ! -f $(distdir)/lexer2.l - test ! -f $(distdir)/lexer2.h -EOF - -cat > lexer.l << 'END' -%{ -#define YY_NO_UNISTD_H 1 -%} -%% -"GOOD" return EOF; -. -%% -int main (void) -{ - return yylex (); -} -END - -cp lexer.l lexer2.l - -$ACLOCAL -$AUTOCONF -$AUTOMAKE -a - -./configure -$MAKE distdirtest - -# Make sure lexer.c and lexer2.c are still targets. -$MAKE lexer.c lexer2.c -test -f lexer.c -test -f lexer2.c - -# Ensure the rebuild rule works despite AM_MAINTAINER_MODE, because -# it's a nodist_ lexer. -$sleep -touch lexer.l lexer2.l -$sleep -$MAKE lexer.c lexer2.c -is_newest lexer.c lexer.l -is_newest lexer2.c lexer2.l - -: diff --git a/t/maintmode-configure-msg.sh b/t/maintmode-configure-msg.sh deleted file mode 100755 index ebdf4d724..000000000 --- a/t/maintmode-configure-msg.sh +++ /dev/null @@ -1,72 +0,0 @@ -#! /bin/sh -# Copyright (C) 2010-2012 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Make sure that our macro 'AM_MAINTAINER_MODE' adds proper text to -# the configure help screen. Also make sure the "checking ..." messages -# related to the enabling/disabling of maintainer mode are correct (see -# automake bug#9890). - -. ./defs || exit 1 - -set_maintmode () -{ - rm -rf autom4te*.cache # Just to be sure not to use a stale cache. - echo "AC_INIT([$me], [1.0])" > configure.ac - case $1 in - DEFAULT) echo AM_MAINTAINER_MODE;; - *) echo "AM_MAINTAINER_MODE([$*])";; - esac >> configure.ac -} - -check_configure_message_with () -{ - answer=$1; shift - ./configure ${1+"$@"} >stdout || { cat stdout; exit 1; } - cat stdout - grep "^checking whether to enable maintainer-specific.*\\.\\.\\. $answer$" stdout - test $(grep -c 'checking.*maint' stdout) -eq 1 -} - -set_maintmode "DEFAULT" - -$ACLOCAL - -$AUTOCONF --force - -grep_configure_help --enable-maintainer-mode 'enable make rules' - -check_configure_message_with "no" -check_configure_message_with "yes" --enable-maintainer-mode - -set_maintmode "disable" - -$AUTOCONF --force -grep_configure_help --enable-maintainer-mode 'enable make rules' - -check_configure_message_with "no" -check_configure_message_with "yes" --enable-maintainer-mode - -set_maintmode "enable" - -$AUTOCONF --force -./configure --help >stdout || { cat stdout; exit 1; } -cat stdout -grep_configure_help --disable-maintainer-mode 'disable make rules' - -check_configure_message_with "yes" -check_configure_message_with "no" --disable-maintainer-mode - -: diff --git a/t/mmode.sh b/t/mmode.sh deleted file mode 100755 index 23cb646a5..000000000 --- a/t/mmode.sh +++ /dev/null @@ -1,64 +0,0 @@ -#! /bin/sh -# Copyright (C) 2008-2012 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Check for AM_MAINTAINER_MODE defaults. - -. ./defs || exit 1 - -cat >> configure.ac << 'END' -AM_MAINTAINER_MODE -AC_OUTPUT -END - -: >Makefile.am - -$ACLOCAL -$AUTOCONF -$AUTOMAKE -a - -./configure -grep '^MAINT.*#' Makefile - -./configure --disable-maintainer-mode -grep '^MAINT.*#' Makefile - -./configure --enable-maintainer-mode -grep '^MAINT.*#' Makefile && exit 1 - -sed 's/\(AM_MAINTAINER_MODE\).*/\1([disable])/' configure.ac > configure.int -mv -f configure.int configure.ac -mv configure configure1 -$AUTOCONF --force -diff configure configure1 - -sed 's/\(AM_MAINTAINER_MODE\).*/\1([enable])/' configure.ac > configure.int -mv -f configure.int configure.ac -$AUTOCONF --force - -./configure -grep '^MAINT.*#' Makefile && exit 1 - -./configure --enable-maintainer-mode -grep '^MAINT.*#' Makefile && exit 1 - -./configure --disable-maintainer-mode -grep '^MAINT.*#' Makefile - -sed 's/\(AM_MAINTAINER_MODE\).*/\1([foo])/' configure.ac > configure.int -mv -f configure.int configure.ac -$AUTOCONF --force -Werror && exit 1 - -: diff --git a/t/mmodely.sh b/t/mmodely.sh deleted file mode 100755 index 0ece11ffb..000000000 --- a/t/mmodely.sh +++ /dev/null @@ -1,95 +0,0 @@ -#! /bin/sh -# Copyright (C) 2004-2012 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Verify that intermediate files are only built from Yacc and Lex -# sources in maintainer mode. -# From Derek R. Price. - -required=cc -. ./defs || exit 1 - -cat >> configure.ac << 'END' -AM_MAINTAINER_MODE -AC_PROG_CC -AM_PROG_LEX -AC_PROG_YACC -AC_OUTPUT -END - -cat > Makefile.am <<'END' -YACC = false -LEX = false -bin_PROGRAMS = zardoz -zardoz_SOURCES = zardoz.y joe.l -LDADD = @LEXLIB@ -END - -# The point of this test is that it is not dependent on a working lex -# or yacc. -cat > joe.c <<EOF -int joe (int arg) -{ - return arg * 2; -} -EOF -# On systems which link in libraries non-lazily and whose linkers -# complain about unresolved symbols by default, such as Solaris, an -# yylex function needs to be defined to avoid an error due to an -# unresolved symbol. -cat > zardoz.c <<EOF -int joe (int arg); -int yylex (void) -{ - return 0; -} -int main (int argc, char **argv) -{ - return joe (argc); -} -EOF - -# Ensure a later timestamp for our Lex & Yacc sources. -$sleep -: > joe.l -: > zardoz.y - -$ACLOCAL -$AUTOCONF -$AUTOMAKE -a - -./configure -$MAKE - -cat >myyacc.sh <<'END' -#! /bin/sh -echo "$@" >y.tab.c -END -cat >mylex.sh <<'END' -echo "$@" >lex.yy.c -END -chmod +x myyacc.sh mylex.sh -PATH=$(pwd)$PATH_SEPARATOR$PATH; export PATH - -# "make maintainer-clean; ./configure; make" should always work, -# per GNU Standard. -$MAKE maintainer-clean -./configure -$MAKE zardoz.c joe.c YACC="myyacc.sh" LEX="mylex.sh" \ - LEX_OUTPUT_ROOT='lex.yy' -$FGREP zardoz.y zardoz.c -$FGREP joe.l joe.c - -: diff --git a/t/remake5.sh b/t/remake5.sh deleted file mode 100755 index 1383d0d04..000000000 --- a/t/remake5.sh +++ /dev/null @@ -1,74 +0,0 @@ -#! /bin/sh -# Copyright (C) 2003-2012 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Check that AM_MAINTAINER_MODE disable some rebuild rules, -# but not all. -# Report from Ralf Corsepius. - -. ./defs || exit 1 - -cat >>configure.ac <<'EOF' -AM_MAINTAINER_MODE -m4_include([foo.m4]) -if test ! -f rebuild_ok; then - ACLOCAL=false - AUTOMAKE=false - AUTOCONF=false -fi -AC_OUTPUT -EOF - -: > foo.m4 -: > Makefile.am - -$ACLOCAL -$AUTOCONF -$AUTOMAKE --add-missing -./configure -$MAKE - -# Make sure the rules to rebuild configure/Makefile.in are not -# triggered by default. ($MAKE will fail if they are, because the -# tools are set to false.) -$sleep -touch aclocal.m4 Makefile.am configure.ac foo.m4 -$MAKE - -# Make sure the rebuild rule for Makefile is triggered. -$sleep -echo '# GrEpMe' >>Makefile.in -$MAKE -grep GrEpMe Makefile - -# Make sure the rebuild rule for config.status is triggered. -$sleep -grep 'AUTOCONF.*=.*false' Makefile -: > rebuild_ok -./configure --no-create -$MAKE -grep 'AUTOCONF.*=.*false' Makefile && exit 1 - -# Make sure rebuild rules do work if --enable-maintainer-mode is given. -./configure --enable-maintainer-mode -$sleep -echo 'AC_SUBST([YIPPY_YIPPY_YEAH])' >foo.m4 -$MAKE -grep YIPPY_YIPPY_YEAH Makefile - -# Try the distribution, for completeness. -$MAKE distcheck - -: diff --git a/t/yacc-nodist.sh b/t/yacc-nodist.sh index 14fa0a753..4209ec1a7 100755 --- a/t/yacc-nodist.sh +++ b/t/yacc-nodist.sh @@ -15,10 +15,8 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # Checks for .c and .h files derived from non-distributed yacc sources. -# The test 'yacc-pr204.test' does similar check with AM_MAINTAINER_MODE -# enabled. -# The tests 'lex-nodist.test' and 'lex-pr204.test' does similar checks -# for lex-generated .c files. +# The test 'lex-nodist.test' does similar checks for lex-generated .c +# files. required='cc yacc' . ./defs || exit 1 diff --git a/t/yacc-pr204.sh b/t/yacc-pr204.sh deleted file mode 100755 index 44b73b32b..000000000 --- a/t/yacc-pr204.sh +++ /dev/null @@ -1,83 +0,0 @@ -#! /bin/sh -# Copyright (C) 2002-2012 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# For PR 204. -# C sources derived from nodist_ yacc sources should not be distributed. -# See also related test 'yacc-nodist.test'. -# The tests 'lex-nodist.test' and 'lex-pr204.test' does similar checks -# for lex-generated C files. - -required='cc yacc' -. ./defs || exit 1 - -cat >> configure.ac <<'EOF' -AM_MAINTAINER_MODE -AC_PROG_CC -AC_PROG_YACC -AC_OUTPUT -EOF - -# The PARSE2 intermediate variable is there to make -# sure Automake match 'nodist_' against the right -# variable name... -cat > Makefile.am << 'EOF' -AM_YFLAGS = -d -EXTRA_PROGRAMS = foo -PARSE2 = parse2.y -nodist_foo_SOURCES = parse.y $(PARSE2) - -distdirtest: distdir - test ! -f $(distdir)/parse.c - test ! -f $(distdir)/parse.y - test ! -f $(distdir)/parse.h - test ! -f $(distdir)/parse2.c - test ! -f $(distdir)/parse2.y - test ! -f $(distdir)/parse2.h -EOF - -cat > parse.y << 'END' -%{ -int yylex () {return 0;} -void yyerror (char *s) {} -%} -%% -maude : 'm' 'a' 'u' 'd' 'e' {}; -END - -cp parse.y parse2.y - -$ACLOCAL -$AUTOCONF -$AUTOMAKE -a - -./configure -$MAKE distdirtest - -# Make sure parse.c and parse2.c are still targets. -$MAKE parse.c parse2.c -test -f parse.c -test -f parse2.c - -# Ensure the rebuild rule works despite AM_MAINTAINER_MODE, because -# it's a nodist_ parser. -$sleep -touch parse.y parse2.y -$sleep -$MAKE parse.c parse2.c -is_newest parse.c parse.y -is_newest parse2.c parse2.y - -: |