Re: [Flex-help] Some flex patch snippets for Solaris.
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Will E. <wes...@gm...> - 2016-05-20 16:47:02
|
A couple thoughts: Yes, configure tries to find m4. There should be a way to specify it though, and whatever the result of "all that" is, that's what main.c should use. Probably by setting a value in config.h, now that I think about it. Some of this is done in the git tree at https://github.com/westes/flex/, post 2.6.1. If you submit patches against that -- particularly if you submit a pull request -- that makes the paperwork go a bit easier. I've got your submitted changes in my queue to review. On Friday, 20 May 2016, 9:14 am -0700, Rich Burridge <ric...@or...> wrote: > On 05/20/2016 08:02 AM, Rich Burridge wrote: > > ... > > 3/ The third one is a Solaris specific problem. In /usr/bin, the > > Solaris version > > of m4 doesn't understand the -P command line option, so fails when > > it's > > part of the chain in flex. We have the GNU m4 binary under > > /usr/gnu/bin. > > We can't rely on the M4 environment variable always being set, or that > > /usr/gnu/bin will be found in the PATH environment variable before > > /usr/bin, > > so the existing logic in flex-2.6.1/src/main.c to find m4 doesn't > > work correctly > > on Solaris. I've fixed this by using the following patch: > > > > --- flex-2.6.1/src/main.c.orig 2016-05-19 14:36:18.569346881 -0700 > > +++ flex-2.6.1/src/main.c 2016-05-20 07:59:04.169569771 -0700 > > @@ -348,6 +348,7 @@ > > > > /* Setup the filter chain. */ > > output_chain = filter_create_int(NULL, filter_tee_header, > > headerfilename); > > +#ifndef __sun > > if ( !(m4 = getenv("M4"))) { > > char *slash; > > m4 = M4; > > @@ -389,6 +390,9 @@ > > } > > } > > filter_create_ext(output_chain, m4, "-P", 0); > > +#else > > + filter_create_ext(output_chain, "/usr/gnu/bin/m4", "-P", 0); > > +#endif > > filter_create_int(output_chain, filter_fix_linedirs, NULL); > > > > /* For debugging, only run the requested number of filters. */ > > To reply to my own post. > > It was pointed out to me that a better solution here would be for > the flex configure script to provide a --with-m4 option, and that > that was passed done and used in .../src/main.c > > Thanks. > > > > > > > > > Thanks. > > > > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > -- > Flex-help mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-help -- Will Estes wes...@gm... |