« Built LOS178 2.1.0 TOB | Main | Test build of LOS178 2.1.0 »

Building CDK on Windows

  • Investigated bug on Windows nmake of CDK
  • Fixed build_los178 to properly build LOS178 2.1

Windows nmake bug for CDK build

There is still something wrong. Here's what I did:

  • Obtained the following tarballs from the 20050628 archive:
    • 2000-00.los178_rsc_src.tar.gz
    • 2001-00.los178_src.tar.gz
    • 2013-00.los178_dev.tar.gz
    • 2015-00.los178_rsc_dev.tar.gz
  • Unpacked those tarballs + ppc.cdkwin32.tar.gz into /tmp/los178
  • Setup my environment properly (this includes VCVARS32.bat)
  • cd'ed to src/cdk and performed make install > install.log 2>&1

I still have the error:

    Compiling coff.o
    coff.c(87) : fatal error C1083: Cannot open include file: 'family/ppc/arch_mem.h': No such file or directory
    NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
    Stop.
    make[1]: *** [WIN32_VS_UTIL] Error 2

It seems clear to me that the compiler cannot locate the include file family/ppc/arch_mem.h which does reside under $ENV_PREFIX/sys/include. Additionally it's clear that common/mkimage/Makefile was changed to append "-I$(ENV_PREFIX)/sys/include" to SPECIAL_CFLAGS to resolve this issue. However something on Windows (and Windows nmake) is causing this to remain a problem.

It seems that nmake eventually issues the following command to compile coff.c -> coff.o:

    cl.exe /nologo /ML /W3 /GX /D "_WIN32_VS" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /FD /c -c coff.c -D__powerpc__ /Fo"coff.o"

Which, of course, doesn't seem to mention $ENV_PREFIX/sys/include at all. IOW the above results in:

    cl.exe /nologo /ML /W3 /GX /D "_WIN32_VS" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /FD /c -c coff.c -D__powerpc__ /Fo"coff.o"
    coff.c
    coff.c(87) : fatal error C1083: Cannot open include file: 'family/ppc/arch_mem.h': No such file or directory

While the following results in a successful compilation (with warnings):

    cl.exe /nologo /ML /W3 /GX /D "_WIN32_VS" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /FD /c -c coff.c -D__powerpc__ /Fo"coff.o" /I$ENV_PREFIX/sys/include

The Makefile and Windows nmake are not arranging for SPECIAL_CFLAGS to be passed along to the compiler.

Fix to build_los178

The build_los178 script was having a problem building LOS178. It would fail in different ways than when done from the command line. I suspected the problem would be in the setup_bash function as it attempts to reproduce what a ". SETUP.bash" does inside the Perl environment. Turns out I was right. Changed that subroutine to properly set HOST_OS_REVISION (previously it had an extra carriage return from `uname -r`) and to add /usr/ucb to the PATH.