/usr/local/palmdev
on Unix, or C:\PalmDev
on Windows. (You will get to configure
where GCC looks for SDKs later. These are
the values which the prebuilt binaries use on the various platforms, and it
seems like a useful convention to follow.)
You should install the SDK(s) you have selected into the directory you have
chosen. You may also wish to create a symlink for a `default SDK'. For
example, for a base directory of /usr/local/palmdev
, the tree
structure should look something like
/usr/local/palmdev/sdk-2/include/Core/... /usr/local/palmdev/sdk-3.5/include/Core/... /usr/local/palmdev/sdk-3.5/lib/... /usr/local/palmdev/sdk -> sdk-2
You'll also need various software development packages:
gcc
or cc
is earlier than this but
you have a recent GCC installed as, e.g., gcc295
,
you can specify that the tools be built using the non-default compiler
by defining variables for the configure command:
~/build$ CC=gcc295 CXX=g++295 ../prc-tools-2.0/configure ...etc...
makeinfo
that's
just /bin/true
(i.e., a shell script that doesn't do anything)!
If your Cygwin suffers from this, you might want to build and install this
makeinfo.c
which will at least create an output file to keep the makefiles happy.
Once you have downloaded the packages, you need to unpack them and apply the patches:
(Omit~$ tar xfz prc-tools-2.0.tar.gz ~$ tar xfz binutils-2.9.1.tar.gz ~$ tar xfz gdb-4.18.tar.gz ~$ tar xfz gcc-2.95.2.tar.gz ~$ tar xfz make-3.77.tar.gz ~$ cat prc-tools-2.0/*.palmos.diff | patch -p0
make-3.77.tar.gz
and make-docs-3.77.palmos.diff
if you don't want to generate make documentation.)
On Windows, you should also apply the Cygwin-specific patches:
~$ cat prc-tools-2.0/*.cygwin.diff | patch -p0
If you don't have autoconf installed, you need to fix the datestamp
on cstamp-h.in
to prevent autoconf from being invoked to
regenerate it:
~$ touch gcc-2.95.2/gcc/cstamp-h.in
Finally, you need to make the GNU packages available to prc-tools's configure script and top-level Makefile so that building all the packages can be integrated into just one build:
(On Windows, if you use any non-Cygwin programs in your build (such as the texi2html perl script), you should use~$ cd prc-tools-2.0 ~/prc-tools-2.0$ ln -s ../binutils-2.9.1 binutils ~/prc-tools-2.0$ ln -s ../gdb-4.18 gdb ~/prc-tools-2.0$ ln -s ../gcc-2.95.2 gcc ~/prc-tools-2.0$ ln -s ../make-3.77 make ~/prc-tools-2.0$ cd ..
mv
instead of
ln -s
since non-Cygwin programs can't see through Cygwin's
symlinks.)
These parameters specify the following:~$ mkdir build ~$ cd build ~/build$ mkdir empty ~/build$ ../prc-tools-2.0/configure --target=m68k-palmos \ --enable-languages=c,c++ \ --with-headers=`pwd`/empty \ --sharedstatedir=/usr/local/palmdev
--target=m68k-palmos
m68k-palmos-coff
; dropping the
-coff
now will ease a potential future move to ELF, and
just plain makes more sense. But at the moment m68k-palmos
is merely an alias for m68k-palmos-coff
, so you can use
the full name for compatibility with prc-tools-0.5.0 for now if you like.
--enable-language=c,c++
objc
won't work here.
--with-headers=`pwd`/empty
--with-build-sdk=2
--sharedstatedir=/usr/local/palmdev
/usr/local/palmdev
on Unix and /PalmDev
on Windows.
--prefix=/usr/local
--exec-prefix=
prefix
/usr/local
. On Windows, the prebuilt binary is
configured with
--prefix=/prc-tools --exec-prefix=/prc-tools/H-i586-cygwin32
and then Cygwin
mounts
are used to map the files from anywhere. Alternatively, if you want to
install these files into the same directories that Cygwin uses, follow
Mumit Khan's
instructions and use --prefix=/cygnus/cygwin-b20
--exec-prefix=/cygnus/cygwin-b20/H-i586-cygwin32
.
~/build# make all-install
Otherwise, you'll need to make each of the dependencies of
all-install
explicitly, since the various builds and installs
are interleaved:
(This is less ridiculous if you happen to be building only part of the tool chain!)~/build$ make all-host ~/build$ su ~/build# make install-host ~/build# ^D ~/build$ make all-gcc ~/build$ su ~/build# make install-gcc ~/build# make install-palmdev ~/build# ^D ~/build$ make all-target ~/build$ su ~/build# make install-target
The multistage process is needed because GCC requires binutils to be installed
before it can be built (or we could use the
unified binutils/gcc
tree trick, but that would cause other problems for us); and in turn
prc-tools-2.0/crt
needs GCC to be installed before it can be
built.
There are further details in the GCC distribution's
install
directory
and also in the Cross-FAQ,
if you run into problems.
--enable-html-docs
or some such). If you want to generate
these, you need to do it separately:
~/build$ cd doc ~/build/doc$ make html ~/build/doc$ su ~/build/doc# make install-html