Subject: bug#33029: AM_LFLAGS --prefix option breaks build-aux/ylwrap script

From: Mathieu Lirzin <[email-masked]>
Date: Tue, 23 Oct 2018 20:07:31 +0200

Hello Sjoerd,

Sjoerd van Leent <[email-masked]> writes:

> Using Automake 1.15.1, I attempted to create a prefix other than the
> default "yy" for usage of the Fast Lexical Analyzer Generator. The
> FLEX arguments used for this, can be set using Automake option
> AM_LFLAGS and friends. Doing this with the --prefix argument however,
> causes a side-effect which the ylwrap script fails to act on. The
> option does not only replace yy inside the generated lex.yy.c file,
> but also changes lex.yy.c to become lex.<PREFIX>.c. This behavior
> breaks the ylwrap script, as it can no longer find lex.yy.c and
> therefore no longer move and rename it to the proper location
> (breaking the build process).
>
> I managed my way around this, by forcing flex to generate a lex.yy.c
> file (adding -o lex.yy.c also to AM_LFLAGS). The solution to my mind
> is simple: if --prefix is used in the AM_LFLAGS and friends option,
> the ylwrap script should either expect this new prefix as a
> replacement token of the "yy" part of lex.yy.c, or ylwrap should add
> -o lex.yy.c on it's own initiative.
>
> I hope that you are able to aid in repairing this minor deefficiency,
> Best Regards,
> Sjoerd van Leent

I am not familiar with the details of how Flex is working but supporting
the ‘--prefix’ option seems desirable. Currently Automake has very
little manpower, so I encourage you to work on it yourself if you have
some time to devote to it.

Thanks.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37