Subject: compat_defs.h
To: None <tech-toolchain@NetBSD.org>
From: Martin Husemann <martin@duskware.de>
List: tech-toolchain
Date: 06/21/2004 00:24:28
I tried upgrading a 1.6.2 machine to 2.0_BETA (using the source).
It fails, because src/tools/compat/compat_defs.h plays this def/undef
games:

/* So extra NetBSD extentions don't get pulled in */
#ifdef __NetBSD__
#define _POSIX_C_SOURCE
#undef _NETBSD_SOURCE
#endif

#include <stdlib.h>  

#ifdef __NetBSD__
#undef _POSIX_C_SOURCE
#endif

After that, _NETBSD_SOURCE is no longer defined, and this hides
_PASSWORD_NOWARN and a bunch of other defines in src/include/pwd.h.

The result is:

#   compile  compat/pw_scan.lo
cc -O  -I. -I./include -I/usr/src/tools/compat -DHAVE_NBTOOL_CONFIG_H=1  -D_FILE_OFFSET_BITS=64 -D_NETBSD_SOURCE -D__DBINTERFACE_PRIVATE -c -o pw_scan.lo.o    /usr/src/tools/compat/../../lib/libc/gen/pw_scan.c
/usr/src/tools/compat/../../lib/libc/gen/pw_scan.c: In function `__nbcompat_pw_scan':
/usr/src/tools/compat/../../lib/libc/gen/pw_scan.c:96: `_PASSWORD_NOWARN' undeclared (first use in this function)
/usr/src/tools/compat/../../lib/libc/gen/pw_scan.c:96: (Each undeclared identifier is reported only once
/usr/src/tools/compat/../../lib/libc/gen/pw_scan.c:96: for each function it appears in.)
/usr/src/tools/compat/../../lib/libc/gen/pw_scan.c:107: `_PASSWORD_NOUID' undeclared (first use in this function)
/usr/src/tools/compat/../../lib/libc/gen/pw_scan.c:119: `_PASSWORD_NOGID' undeclared (first use in this function)
/usr/src/tools/compat/../../lib/libc/gen/pw_scan.c:121: `_PASSWORD_OLDFMT' undeclared (first use in this function)
/usr/src/tools/compat/../../lib/libc/gen/pw_scan.c:125: `_PASSWORD_NOCHG' undeclared (first use in this function)
/usr/src/tools/compat/../../lib/libc/gen/pw_scan.c:125: `_PASSWORD_NOEXP' undeclared (first use in this function)

*** Failed target:  pw_scan.lo
*** Failed command: cc -O -I. -I./include -I/usr/src/tools/compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_NETBSD_SOURCE -D__DBINTERFACE_PRIVATE -c -o pw_scan.lo.o /usr/src/tools/compat/../../lib/libc/gen/pw_scan.c
*** Error code 1

Why does it work for others? Or doesn't it work at all? This is still with
gcc 2.95.3 - is that the difference? Or am I missing something?


Martin