From: Julien L. <ju...@fa...> - 2007-04-21 14:56:33
|
x-post: mingw-dvlpr & flex-devel I recently was trying to compile flex under MSYS, and stumbled upon MinGW/MSYS mailing-list documentation on the compiling problems of it and of libregex. For archive purposes, I'm posting the solution I had to use to correctly compile flex for MSYS; as the current archives didn't post a full solution. This might also be of use for the next MSYS release. Among the problems of the compiling flex, there's a 'regex.h' problem (header not found) and then I stumbled upon another problem where all 40 test cases fail (internal regcomp error). Here's my solution: - download libregex (currently 0.12, on ftp.gnu.org/old-gnu/regex) - extract, configure and make only object (make CFLAGS="-O2" regex.o) as we (I?) don't care about tex. - make a library out of it (ar -crs libregex.a regex.o) - copy them to correct locations (cp libregex.a /usr/lib/ && cp regex.h /usr/include/) - extract flex, configure and make (make should succeed, but flex.exe should have regcomp errors if you try './flex.exe') - remove flex.exe, and use a modified link command: rm flex.exe gcc -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 regex.o If you now run the test case, you should have 4 errors, most are because they are C++ errors and inclusion of non existing _G_config.h; and one of them is just solved by running test case with correct CFLAGS and LDFLAGS. Cheers, Julien |