"5.15. Gawk-3.1.4" and NGROUPS_MAX

Sergey Ilyevsky selik at t2.technion.ac.il
Tue Jan 25 03:23:01 PST 2005

Hi, All.

I'm at chapter 5 (LFS 6.0), tring to compile gawk. I get the following

if gcc -DDEFPATH="\".:/tools/share/awk\"" -DHAVE_CONFIG_H -DGAWK\
 -DLOCALEDIR="\"/tools/share/locale\"" -I. -I. -I.  -Iintl  \
 -g -O2 -MT io.o -MD -MP -MF ".deps/io.Tpo" -c -o io.o io.c; \
then mv -f ".deps/io.Tpo" ".deps/io.Po"; else rm -f ".deps/io.Tpo"; exit 1; fi
io.c: In function `useropen':
io.c:1515: error: `ngroups' undeclared (first use in this function)
io.c:1515: error: (Each undeclared identifier is reported only once
io.c:1515: error: for each function it appears in.)
io.c:1517: error: `groupset' undeclared (first use in this function)
make[2]: *** [io.o] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gawk/gawk-3.1.4'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/gawk/gawk-3.1.4'
make: *** [all] Error 2

There's the following "#if" in files awk.h, main.c and io.c:
#if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0

The problem is that in awk.h and main.c gcc doesn't get through this #if,
but in io.c he does. This is because of the NGROUPS_MAX constant, which is
defined in sys/param.h , which is included from io.c .

The problem can be easily solved (by defining NGOUPS_MAX, or removing the
#if part from io.c), it seems that it's gawk's problem, but I don't understand
how I get this problem with new glibc and gcc, when others don't...
Btw, there's no problems to compile it on my host system.

With best wishes,
                                Sergey Ilyevsky.

More information about the lfs-support mailing list