hughperman / pure-lang

Automatically exported from code.google.com/p/pure-lang
0 stars 0 forks source link

flex -o <space> output.cc bombs on freebsd (flex 2.5.4) #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
> which flex      
/usr/bin/flex                                                 
> flex --version  
flex version 2.5.4                                                
> rm lexer.{cc,hh}
rm: lexer.hh: No such file or directory
> gmake lexer.cc
flex -o ./lexer.cc lexer.ll
flex: can't open ./lexer.cc
gmake: *** [lexer.cc] Error 1
> sed -Eibak 's,(flex -o) ,\1,' Makefile   
> gmake lexer.cc                        
flex -o./lexer.cc lexer.ll
> head lexer.cc
#line 2 "./lexer.cc"
/* A lexical scanner generated by flex */

/* Scanner skeleton version:
 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48
vern Exp $
 * $FreeBSD: src/usr.bin/lex/flex.skl,v 1.8.28.1 2009/04/15 03:14:26
kensmith Exp $
 */

#if defined(__FreeBSD__)
#include <sys/cdefs.h>

Original issue reported on code.google.com by neuhau...@sigpipe.cz on 30 Aug 2009 at 9:19

GoogleCodeExporter commented 8 years ago
hm, looks like 2.5.4 is not recent at all, sorry for the noise.

Original comment by neuhau...@sigpipe.cz on 30 Aug 2009 at 9:25

GoogleCodeExporter commented 8 years ago
attached patch allows flex selection at confiugre time

this is needed on systems with an old flex early in the path, such as freebsd
(/usr/bin/flex 2.5.4 precedes /usr/local/bin/flex 2.5.35)

LEX=/usr/local/bin/flex ./configure ...

Original comment by neuhau...@sigpipe.cz on 30 Aug 2009 at 10:28

Attachments:

GoogleCodeExporter commented 8 years ago
Yeah, flex 2.5.4 is an ancient version.

Unfortunately, the suggested patch won't work, because AC_PROG_LEX might pick 
up lex
if flex isn't available. Instead I just added variables BISON and FLEX for 
bison and
flex to the Makefile now, so that you can set these when invoking 'make'.

Fixed in r2160.

Original comment by aggraef@gmail.com on 30 Aug 2009 at 9:16

GoogleCodeExporter commented 8 years ago
I'm afraid this won't save you from occasional bug report just like this one. 
AC_PROG_LEX can be augmented with a subsequent test for version or required 
feature.
 current code lets you designate a particular flex install, but won't tell you your
choice was wrong (other than through failed build).

Original comment by neuhau...@sigpipe.cz on 31 Aug 2009 at 7:08

GoogleCodeExporter commented 8 years ago
Ok, I added configure checks for bison and flex in r2161. They're not 100% 
foolproof,
but then flex and bison are normally only required if you build from svn 
sources, and
so I don't want want configure to bail out if they're not installed.

To set the flex version you want to use, you can do this:

FLEX=/usr/local/bin/flex ./configure ...

Original comment by aggraef@gmail.com on 31 Aug 2009 at 12:12