[RFC] Adding bison, lex, etc. build modules?

Paolo Bonzini paolo.bonzini@polimi.it
Mon Jun 28 11:14:00 GMT 2004


What the toplevel configure is doing currently to find development tools
like yacc is:

1) find a yacc using Autoconf (DEFAULT_YACC).  This will be a build
yacc, not a host yacc!
2) for a Canadian, find a "reasonable" build yacc (YACC).  This is bogus
because we already have one in DEFAULT_YACC.
3) for a non Canadian, look if a host yacc was compiled, else use the
DEFAULT_YACC that was found by Autoconf (USUAL_YACC, to which YACC expands)

Plus, BISON and M4 are handled differently than LEX/YACC/MAKEINFO.

After Nathanael's work, adding modules is easy, so it seems to me that
it is much better to make yacc a build module (for Canadian crosses),
and then

1) find a yacc using Autoconf (CONFIGURED_YACC)
2) look if a build (for Canadian) or host (for non Canadian) yacc was
compiled.  If not, use the CONFIGURED_YACC.

This also provides a way to fix in a more elegant way the Texinfo bug
that was reported by Corinna Vinschen.  Just make sure with the
appropriate dependencies that the build texinfo is built before anything
else that has Texinfo manuals, and pick the in-tree makeinfo if the
Makefile exists (rather than the actual program).

Would something like the attached patch be acceptable?  To test it, is
it ok to build a native configuration and a Canadian cross, add check
manually that the bison/flex/texinfo that are invoked are always those
in the tree?

Paolo

2004-06-23  Paolo Bonzini  <bonzini@gnu.org>

	* configure.in (BISON, MAKEINFO, LEX, YACC): Don't set them.
	(CC): Use AC_PROG_CC to set it.
	(DEFAULT_YACC, DEFAULT_M4, DEFAULT_LEX): Rename to...
	(CONFIGURED_YACC, CONFIGURED_M4, CONFIGURED_LEX): ... this.
	(CONFIGURED_BISON, CONFIGURED_MAKEINFO): Find these as well.
	(BUILD_DIR_PREFIX): New variable.
	* Makefile.def (bison, byacc, lex, m4, texinfo): Add as build
	modules.
	* Makefile.tpl (USUAL_BISON, USUAL_YACC, USUAL_LEX,
	USUAL_MAKEINFO): Remove.
	(BISON, YACC, LEX, M4, MAKEINFO): Look in the build directory,
	else resort to those found by configure.
	(CONFIGURED_YACC, CONFIGURED_M4, CONFIGURED_LEX,
	(CONFIGURED_BISON, CONFIGURED_MAKEINFO, BUILD_DIR_PREFIX): Set
	from substituted variables.
	(all-build-bison, all-build-m4, all-build-flex,
	all-build-texinfo): Add dependencies.









-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: redo-bison-and-friends-configuration.patch
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20040628/5f626dce/attachment.ksh>


More information about the Gcc mailing list