Re: [Flex-devel] flex 2.5.33 under MSYS
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Julien L. <ju...@fa...> - 2007-04-22 06:17:10
|
>> x-post: mingw-dvlpr & flex-devel On 21/04/2007 20:56, Will Estes wrote: > Based on your comments, it looks like you could set an LDFLAGS variable > to include -lregex, and then you wouldn't have to re-run the link > command when building flex. Is that correct? That was my first reaction to link libregex. Awkwardly, it doesn't work: $ ./configure --prefix=/usr $ make LDFLAGS='-lregex' flex.exe gcc -g -O2 -lregex -o flex.exe ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o -lm Note where the LDFLAGS where inserted! It would 'work' with the LIBS flag though, but I'm pretty sure it's not standard procedure to mess with LIBS: $ make LIBS='-lregex' flex.exe gcc -g -O2 -o flex.exe ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o -lregex Anyway, if we don't insert libregex.a before regex.o, function regcomp from regex.o will be linked (and not the one from libregex.a) and this causes flex to crash: julienlecomte@PUMILIO /srcroot/mingw/gnu/flex-2.5.33 $ ./flex.exe regcomp() regc(-100) reg(0,1328) regbranch(512) regnode(6) regnode(9) regnode(0) regtail(, ) regtail(, ) regnext() regc(-100) reg(0,0) regbranch(0) regnode(6) regnode(9) regnode(0) regtail(♠, ) regnext(♠) regtail(♠, ) regtail( , ) regnext( ) regnext(♠) regtail(, ) regnext() regnext(♠) flex: fatal internal error, regcomp failed: And if we omit regex.o, we of course get undefined errors: $ gcc -g -O2 -o flex.exe ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o -lregex main.o: In function `flexinit': /srcroot/mingw/gnu/flex-2.5.33/main.c:974: undefined reference to `flex_init_regex' filter.o: In function `filter_fix_linedirs': /srcroot/mingw/gnu/flex-2.5.33/filter.c:344: undefined reference to `regex_linedir' /srcroot/mingw/gnu/flex-2.5.33/filter.c:351: undefined reference to `regmatch_strtol' /srcroot/mingw/gnu/flex-2.5.33/filter.c:352: undefined reference to `regmatch_dup' /srcroot/mingw/gnu/flex-2.5.33/filter.c:376: undefined reference to `regex_blank_line' collect2: ld returned 1 exit status Cheers, Julien |