Unable to build turris openwrt on debian - compile error in freadahead.c in m4

When running ./compile_omnia_fw -j1 V=s on debian testing, compilation of m4 fails with:

freadahead.c: In function 'freadahead':
freadahead.c:91:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
#error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."

Is there some workaround ?

Hi,
I’ve the same issue on Gentoo. Any hints?

Please use Ubuntu 14.04 container to build TOS 3.x. There are known issues with anything newer.

Hi. Thanks for the info.