[an error occurred while processing this directive]
Node:Cross-DJGPP,
Next:0xfe+0x20,
Previous:Upload,
Up:Miscellany
Q: I want to use DJGPP as a cross-compiler for Motorola 68K targets.
How should I proceed about this?
Q: I want to build GCC as a Unix-to-DOS cross-compiler. What should I
do?
A: If you want a cross-compiler for m68k on a DOS machine, you need
DJGPP configured as host=i386-go32
, and target=m68k-coff.
Such a package is already available. The binaries there are
based on GCC 2.7.2. This package is reportedly no longer supported, but
if you have questions about it, you can send them to Jim Karpinski. You can also try to contact Kai Ruottu, who is the provider of DOS-hosted
gcc-m68k. Note that this package has only basic support for C++:
the compiler is included, but the libraries, including libstc++
and libg++
, and the C++ headers are missing, so even
cin
and cout
don't work.
A Win32-hosted gcc-m68k is another possibility. It was created by David Fiddes. The Cygwin port of GCC can also be configured as a cross-compiler with m68k as the target. See the description of the Cygwin project, for more details about the Cygwin port. Object Software Inc. is a company that supports cross-builds based on GCC and DJGPP. Pre-built binaries of the compiler and some minimal development tools are available from this site for m68k, PowerPC, and Hitachi's SH-3 targets, all based on DJGPP v2. The CrossGCC FAQ, available from the same site, includes detailed instructions for building a cross-compiler for any target.
DJGPP can be built and installed as a cross-compiler running on a Unix machine and targeting DOS/Windows platforms. Detailed instructions for doing this on Linux can be found in the DJGPP HOWTO Repository. Here is the summary of the necessary steps to do that:
v2/djcrx203.zip
from the usual DJGPP sites.
djcrx203.zip
on the Unix machine using
unzip -a
.
You must use the -a
switch, to force unzip
to
convert any DOS-style text file with CR-LF pairs at the end of each line
to Unix-style text files. If you don't, things will break for you.
unzip
is available in source form from many FTP sites. Linux
systems generally come with unzip
, but if your system doesn't,
download the sources and build it.
cross
directory to the top-level
directory, where you unzipped djcrxNNN.zip
.
The main GNU site is at ftp.gnu.org.
djcrxNNN.zip
.
cross/install
that was unpacked
from djcrx203.zip
to build and install the
cross compiler.
The cross-compiler you build is installed as dos-gcc
, so to
compile programs with it, use dos-gcc
rather than cc
or
gcc
, or set CC=dos-gcc
when invoking Make.
The file cross/readme
has some usage info for dos-gcc
. It
is generally correct, except that the version numbers for the various
packages might not be up to date. You should always use the latest
releases of every package.
Another alternative is the build.cross
script included in the
source distribution of the DJGPP port of GCC, gccNNNs.zip
. This
script was tested on GNU/Linux systems, and it allows to build GCC as a
cross compiler hosted on a GNU/Linux system whose target is
DJGPP-supported platforms. To use this script "out of the box", you
will need to take care of some preliminaries:
stubify
program is somewhere on your PATH
;
djcrxNNNb.zip
package) are in the
prefix/i586-pc-msdosdjgpp/include
directory;
gppNNNb.zip
package) are in the
prefix/i586-pc-msdosdjgpp/lang/cxx
directory;
prefix/i586-pc-msdosdjgpp/lib
directory;
i586-pc-msdosdjgpp
are on your
PATH
;
prefix/i586-pc-msdosdjgpp/version
,
where version is the version of GCC, exists.
Here, prefix is the root of your cross-development installation,
usually /usr
or /usr/local
.