Creating a Platform Interface for CDT
In order to cross-compile programs for another platform you need a few things, headers, libraries and C runtime support object code. These files all come from your target platform and may need to be reorganized and modified a little for use with gcc as cross-compiler.
InstallCDT expects platform interfaces to exist in <Install Directory>/PlatformInterfaces/<gcc target> before being run, it copies the files out of this directory to the appropriate place for gcc and configures gcc accordingly. <Install Directory> is /Developer/Cocotron/<version> unless specified otherwise, <gcc target> is the gcc specific target, e.g. i386-redhat-linux or sparc-sun-solaris .
The directory should look like this:
The easiest thing to do here is just copy or mount the entire contents of /usr/include for the target platform. This typically does not need to be modified for CDT.
The lib directory is trickier as the libraries, symlinks and link command files need to all be happy living in lib/ when they are used to living in lib and usr/lib on the target platform.
gcc and Cocotron require only a handful of libraries and object code which can be summarized as: C runtime object code, libc, libdl, libm, and libpthread for Linux and Solaris, ld-linux on Linux and libnsl and libsocket for Solaris.
Typically the shared libraries are just a symlink to the particular version, so you need to copy the link and the link destination. These files live in lib/ and usr/lib.
My experience with Linux has been that libc.so and libpthread.so are link command files which reference absolute paths, you will need to edit out the absolute path for things to work.
Linux file list:
crt1.o crti.o crtn.o ld-2.3.3.so ld-linux.so.2 libc-2.3.3.so libc.a libc.so libc.so.6 libc_nonshared.a libc_stubs.a libdl-2.3.3.so libdl.a libdl.so libdl.so.2 libm.a libm.so libpthread-0.10.so libpthread.a libpthread.so libpthread.so.0 libpthread_nonshared.a Solaris file list:libc.a libc.so libc.so.1 libdl.so libdl.so.1 libm.a libm.so libm.so.1 libnsl.so libnsl.so.1 libpthread.so libpthread.so.1 libsocket.so libsocket.so.1 values-Xa.o