ylwrap. Suggested by Akim Demaille long ago, to ease maintenance.
* automake.in (handle_languages): Do not define MORE-THAN-ONE.
(yacc_lex_finish_helper, lang_yacc_finish, lang_lex_finish): Always
require ylwrap.
* doc/automake.texi (Auxiliary Programs, Yacc and Lex): Update the
documentation of ylwrap.
* tests/lex.test, tests/lex4.test, tests/mmodely.test,
tests/yacc.test, tests/yacc2.test, tests/yacc3.test,
tests/yaccpp.test: Adjust.
2006-08-19 Alexandre Duret-Lutz <adl@gnu.org>
+ * lib/am/lex.am, lib/am/yacc.am: Drop the inline rules, always use
+ ylwrap. Suggested by Akim Demaille long ago, to ease maintenance.
+ * automake.in (handle_languages): Do not define MORE-THAN-ONE.
+ (yacc_lex_finish_helper, lang_yacc_finish, lang_lex_finish): Always
+ require ylwrap.
+ * doc/automake.texi (Auxiliary Programs, Yacc and Lex): Update the
+ documentation of ylwrap.
+ * tests/lex.test, tests/lex4.test, tests/mmodely.test,
+ tests/yacc.test, tests/yacc2.test, tests/yacc3.test,
+ tests/yaccpp.test: Adjust.
+
* doc/automake.texi (Releases): Update statistics until 1.9.6.
* Makefile.am (maintainer-check): Check for mkdir_p.
$(MKDIR_P)) but should be considered obsolete. If you are using
$(mkdir_p) in some of your rules, please plan to update them to
$(MKDIR_P) at some point.
+
+ - ylwrap is now always used for lex and yacc source files,
+ regardless of whether there is more than one source per-directory.
\f
New in 1.9:
'AMDEP' => $AMDEP,
'FASTDEP' => $FASTDEP,
'-c' => $lang->compile_flag || '',
- 'MORE-THAN-ONE'
- => (count_files_for_language ($lang->name) > 1),
# These are not used, but they need to be defined
# so &transform do not complain.
SUBDIROBJ => 0,
return if defined $language_scratch{'lex-yacc-done'};
$language_scratch{'lex-yacc-done'} = 1;
- # If there is more than one distinct yacc (resp lex) source file
- # in a given directory, then the `ylwrap' program is required to
- # allow parallel builds to work correctly. FIXME: for now, no
- # line number.
+ # FIXME: for now, no line number.
require_conf_file ($configure_ac, FOREIGN, 'ylwrap');
&define_variable ('YLWRAP', "$am_config_aux_dir/ylwrap", INTERNAL);
}
reject_var 'YACCFLAGS', "`YACCFLAGS' obsolete; use `YFLAGS' instead";
- &yacc_lex_finish_helper
- if count_files_for_language ('yacc') > 1;
+ yacc_lex_finish_helper;
}
return if defined $language_scratch{'lex-done'};
$language_scratch{'lex-done'} = 1;
- &yacc_lex_finish_helper
- if count_files_for_language ('lex') > 1;
+ yacc_lex_finish_helper;
}
@url{http://www.gnu.org/software/texinfo/}.
@item ylwrap
-This program wraps @command{lex} and @command{yacc} and ensures that,
-for instance, multiple @command{yacc} instances can be invoked in a
-single directory in parallel.
+This program wraps @command{lex} and @command{yacc} to rename their
+output files. It also ensures that, for instance, multiple
+@command{yacc} instances can be invoked in a single directory in
+parallel.
@end table
rebuild rule for distributed Yacc and Lex sources are only used when
@code{maintainer-mode} is enabled, or when the files have been erased.
-
@cindex @command{ylwrap}
@cindex @command{yacc}, multiple parsers
@cindex Multiple @command{yacc} parsers
@cindex Multiple @command{lex} lexers
@cindex @command{lex}, multiple lexers
-
-Automake makes it possible to include multiple @command{yacc} (or
-@command{lex}) source files in a single program. When there is more
-than one distinct @command{yacc} (or @command{lex}) source file in a
-directory, Automake uses a small program called @command{ylwrap} to run
-@command{yacc} (or @command{lex}) in a subdirectory. This is
-necessary because yacc's output file name is fixed, and a parallel
-make could conceivably invoke more than one instance of @command{yacc}
-simultaneously. The @command{ylwrap} program is distributed with
-Automake. It should appear in the directory specified by
-@code{AC_CONFIG_AUX_DIR}, or one of its default locations
-(@pxref{Input, , Finding `configure' Input, autoconf, The Autoconf
-Manual}).
+When @command{lex} or @command{yacc} sources are used, @code{automake
+-i} automatically installs an auxiliary program called
+@command{ylwrap} in your package (@pxref{Auxiliary Programs}). This
+program is used by the build rules to rename the output of these
+tools, and makes it possible to include multiple @command{yacc} (or
+@command{lex}) source files in a single directory. (This is necessary
+because yacc's output file name is fixed, and a parallel make could
+conceivably invoke more than one instance of @command{yacc}
+simultaneously.)
For @command{yacc}, simply managing locking is insufficient. The output of
@command{yacc} always uses the same symbol names internally, so it isn't
## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2004, 2006 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
?GENERIC?%EXT%%DERIVED-EXT%:
?!GENERIC?%OBJ%: %SOURCE%
-if %?MORE-THAN-ONE%
?GENERIC? $(am__skiplex) $(SHELL) $(YLWRAP) %SOURCE% $(LEX_OUTPUT_ROOT).c %OBJ% -- %COMPILE%
?!GENERIC??DIST_SOURCE? $(am__skiplex) \
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? $(SHELL) $(YLWRAP) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% $(LEX_OUTPUT_ROOT).c %OBJ% -- %COMPILE%
-else !%?MORE-THAN-ONE%
-?GENERIC? $(am__skiplex) %COMPILE% %SOURCE%
-?!GENERIC??DIST_SOURCE? $(am__skiplex) \
-## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?!GENERIC? %COMPILE% `test -f %SOURCE% || echo '$(srcdir)/'`%SOURCE%
-## Edit out `#line' or `#' directives.
-?GENERIC? $(am__skiplex) \
-?!GENERIC??DIST_SOURCE? $(am__skiplex)\
- { sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|%OBJ%|' $(LEX_OUTPUT_ROOT).c >%OBJ% && \
- rm -f $(LEX_OUTPUT_ROOT).c; }
-endif !%?MORE-THAN-ONE%
## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004
+## Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2006
## Free Software Foundation, Inc.
## This program is free software; you can redistribute it and/or modify
## Point #4 is because parsers listed in nodist_*_SOURCES are always
## built on the user's side, so it makes no sense to disable them.
##
-## Points #1, #2, #3 are solved by unconditionally prefixing the rules
+## Points #1, #2, #3 are solved by unconditionally prefixing the rule
## with $(am__skipyacc) defined below only when needed.
##
## Point #4 requires a condition on whether parser.y/parser.c are
?GENERIC?%EXT%%DERIVED-EXT%:
?!GENERIC?%OBJ%: %SOURCE%
-if %?MORE-THAN-ONE%
?GENERIC? $(am__skipyacc) $(SHELL) $(YLWRAP) %SOURCE% y.tab.c %OBJ% y.tab.h %BASE%.h y.output %BASE%.output -- %COMPILE%
?!GENERIC??DIST_SOURCE? $(am__skipyacc) \
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? $(SHELL) $(YLWRAP) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% y.tab.c %OBJ% y.tab.h %BASE%.h y.output %BASE%.output -- %COMPILE%
-else !%?MORE-THAN-ONE%
-?GENERIC? $(am__skipyacc) %COMPILE% %SOURCE%
-?!GENERIC??DIST_SOURCE? $(am__skipyacc) \
-## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?!GENERIC? %COMPILE% `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
-## Edit out Bison multiple inclusion guards. It may be BISON_Y_TAB_H,
-## or Y_TAB_H depending upon the version, that's why the regexp is
-## so loose.
-?GENERIC? $(am__skipyacc) \
-?!GENERIC??DIST_SOURCE? $(am__skipyacc) \
- if test -f y.tab.h; then \
- to=`echo "%BASE%_H" | sed \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
- sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|%BASE%.h|" \
- y.tab.h >%BASE%.ht; \
- rm -f y.tab.h; \
- if cmp -s %BASE%.ht %BASE%.h; then \
- rm -f %BASE%.ht ;\
- else \
- mv %BASE%.ht %BASE%.h; \
- fi; \
- fi
-?GENERIC? $(am__skipyacc) \
-?!GENERIC??DIST_SOURCE? $(am__skipyacc) \
- if test -f y.output; then \
- mv y.output %BASE%.output; \
- fi
-?GENERIC? $(am__skipyacc) \
-?!GENERIC??DIST_SOURCE? $(am__skipyacc) \
-## Edit out `#line' or `#' directives.
- { sed '/^#/ s|y\.tab\.c|%OBJ%|' y.tab.c >%OBJ%t && mv %OBJ%t %OBJ% && \
- rm -f y.tab.c; }
-endif !%?MORE-THAN-ONE%
#! /bin/sh
-# Copyright (C) 1996, 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1998, 2001, 2002, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_LEX
: > joe.l
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOMAKE -a
# Test to make sure that lex source generates correct target.
-$FGREP '$(LEX)' Makefile.in || exit 1
+$FGREP '$(LEX)' Makefile.in
# Test to make sure that lex source generates correct clean rule.
# From Ralf Corsepius.
$FGREP joel Makefile.in && exit 1
-exit 0
+:
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_CXX
: > joe.ll
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOMAKE -a
$FGREP joe.Po Makefile.in
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -a
./configure
$MAKE
+echo 'echo "$@" >y.tab.c' > myyacc.sh
+echo 'echo "$@" >lex.yy.c' > mylex.sh
+
# make maintainer-clean; ./configure; make should always work,
# per GNU Standard.
$MAKE maintainer-clean
./configure
-YACC='echo>y.tab.c' LEX='echo>lex.yy.c' LEX_OUTPUT_ROOT='lex.yy' \
- $MAKE -e zardoz.c joe.c
+YACC="$SHELL `pwd`/myyacc.sh" LEX="$SHELL `pwd`/mylex.sh" \
+ LEX_OUTPUT_ROOT='lex.yy' $MAKE -e zardoz.c joe.c
grep zardoz.y zardoz.c
grep joe.l joe.c
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_YACC
zardoz_SOURCES = zardoz.y
END
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOMAKE -a
grep 'zardoz.c' Makefile.in
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
# Don't redefine several times the same variable.
cp Makefile.am Makefile.src
-
-
-
$ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -a
# If zardoz.h IS mentioned, fail
grep 'zardoz.h' Makefile.in > /dev/null && exit 1
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_YACC
@echo $(DIST_COMMON)
END
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOMAKE -a
$FGREP -v @SET_MAKE@ Makefile.in > Makefile.sed
# It should not be disted here
cp Save Makefile.am
echo "$flag = -d" >> Makefile.am
- $AUTOMAKE -Wno-gnu || exit 1
- grep 'zardoz.h' Makefile.in || exit 1
+ $AUTOMAKE -Wno-gnu
+ grep 'zardoz.h' Makefile.in
done
#! /bin/sh
-# Copyright (C) 1997, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2001, 2002, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CXX
AC_PROG_YACC
zardoz_SOURCES = zardoz.yy
END
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOMAKE -a
grep zardoz.cc Makefile.in