Okay, so flex fails to cross-compile right now without setting ac cache variables, plus has a number of hacks around it, mostly because its version of autotools are … pretty nasty. The attached ebuild and patch (presented for review) applies the latest changes from the Debian package, and then sanitises the autotools build system to work as intended. While requiring an autotools rebuild, it takes care of a number of minor details in consideration, such as having an actual non-PIC library (as it is, it has been building _both_ PIC afaics).
Created attachment 254525 [details] new ebuild
Created attachment 254527 [details, diff] Autotools patch
Created attachment 254529 [details, diff] Comparison patch for the ebuild
you probably want ${DEB_DIFF:+...} i guess the isatty patch is also part of the Debian patchset ? i'd prefer the epatch be kept as sep invocations as it's easier to add trailing comments that way since you've updated the EAPI, might as well drop the die from econf otherwise, this looks fine to me
Debian has a different solution for the isatty() prototype, they simply include unistd.h as long as _Win32 is not defined. I tested with doxygen (that was listed in the patch description) and it builds fine. ACK for the multiple-epatch; I went this way to avoid a [[ -n ]] but I guess it looks clumsier this way than the other way.
In tree.