(Illustration by Gaich Muramatsu)
On Wed, May 16, 2007 at 07:53:50PM -0400, Davor Ocelic wrote: > On Wed, May 16, 2007 at 06:58:23PM -0400, Jan Harkes wrote: > > On Wed, May 16, 2007 at 05:37:32PM -0400, Davor Ocelic wrote: > > > The rpc2 library is missing a ./configure check for the existence > > > of yacc, so ylwrap gets called and fails during the build, instead > > > of warning in advance. > > > > It does check for both lex and yacc. > > > > AM_PROG_LEX > > AC_PROG_YACC > > > > However the default autoconf macro doesn't fail if the files are not > > found. I guess for some source trees the tarball could contain > > pre-generated c files so that a missing lex or yacc binary wouldn't > > actually be a fatal error. > > > > Do you want configure to fail when it can't find either of these? > > Well, whatever configure does when other critical things are not > found - it exits, right ? Well it all depends, some errors are considered fatal, from what I can see a missing lex will be replaced by a call to the 'missing' script which tries to re-copy the generated files. A missing bison or yacc binary will result in an attempt to use 'yacc' either way. Also when lex was not found and the LEX is set to to "missing --run flex", the LEX_OUTPUT_ROOT variable isn't initialized, so even though it can now copy the generated source to yy.lex.c we can't find the file. Of course the other part is that we currently don't include the generated sources in the distributed tarballs. All of these problems are fixed by adding 3 lines to configure.in and removing 3 lines from rp2gen/Makefile.am. We actually used to include the generated code, the advantage is that it is possible to build from the distributed source tarball without having anything but a posix shell and a c-compiler installed (and some libraries/headers like libc6-dev). The problem of including pre-generated files is that they fail to build on some systems, and there is no rule that can really force a rebuild if lex or yacc happen to be available (especially if they are installed after the initial build fails). For people checking source out of the cvs or git repository, we never check in any generated files so they already need various development tools, automake/autoconf/libtool. So requiring a flex and bison (or lex and yacc) doesn't seem that much of an additional requirement. I'll try some things with the configure script. JanReceived on 2007-05-17 00:03:13