Subject: interix bootstrap problems with workarounds
To: None <tech-pkg@NetBSD.org>
From: Ben Collver <collver@peak.org>
List: tech-pkg
Date: 12/26/2005 22:23:29
Tonight I bootstrapped pkgsrc on Microsoft SFU 3.5 (Thanks to Todd), and
here are some notes.  I tried to follow the directions in
pkgsrc/doc/pkgsrc.txt using pkgsrc-current, and ran into 3 issues:


(1) cc did not work, resolved with brute admin force:

cd /dev/fs/C/SFU/bin
mv cc cc.orig
mv c89 c89.orig
cd /opt/gcc.3.3/bin
ln -s gcc cc
cd /usr/share/mk
cp sys.mk sys.mk.orig
sed <sys.mk.orig >sys.mk -e 's,^CC=c89,CC=gcc,' -e 's,^CFLAGS=.*,CFLAGS=-D_ALL_SOURCE,'


(2) On Interix, bmake does not set MAKEFILE, which tickles the bmake regression tests.

bmake/main.c:1139
#ifdef __INTERIX
                /*
                 * XXX Hack from tv:
                 * This system has broken filesystem support - can't
                 * always distinguish b/w [Mm]akefile.
                 */
                setMAKEFILE = FALSE;

Resolved this with more brute force:
cd /usr/pkgsrc/devel
cp -Rp bmake bmake-interix
cd bmake-interix/files
cp Makefile.in Makefile.in.orig
# in the next line, that is a tab, not spaces.. you may need to press Ctrl-V before pressing Tab
sed <Makefile.in.orig >Makefile.in -e "s,^	cd,#	cd,"
cd /usr/pkgsrc/bootstrap
cp bootstrap bootstrap.orig
sed <bootstrap.orig >bootstrap -e 's,devel/bmake,devel/bmake-interix,'


(3) Pax build broken when tape support is disabled.

in pax.h, ISTAPE is only defined if SUPPORT_TAPE is defined:
#ifdef SUPPORT_TAPE
#define ISTAPE          3       /* tape drive */
#endif

in ar_io.c, ISTAPE is used even when SUPPORT_TAPE is undefined, which guarantees an error:
        case ISTAPE:
#ifdef SUPPORT_TAPE
...
        case ISTAPE:
#ifdef SUPPORT_RMT
        case ISRMT:
#endif /* SUPPORT_RMT */
#ifdef SUPPORT_TAPE
...

Resolved this with more brute force:
cd /usr/pkgsrc/archivers
cp -Rp pax pax-interix
cd pax-interix/files
cp ar_io.c ar_io.c.orig
ed ar_io.c
1027m1028
1242m1246
wq
cd /usr/pkgsrc/bootstrap
sed <bootstrap.orig >bootstrap -e 's,devel/bmake,devel/bmake-interix,' -e 's,archivers/pax,archivers/pax-interix,'


After this, the bootstrap succeeded and I was able to build a few
packages.  Interix definitely feels slower than NetBSD on the same
hardware.

Ben