From 7da8c10750a8b4a9a114b46721593379c899a817 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Fri, 31 Jan 2003 16:02:21 +0000 Subject: 2003-01-31 Ralf Corsepius * README.cdn-X: New. * binutils/binutils.add: Add --build=%_build --host=%_host. * cpukit/.cvsignore: Add *.spec.in. * gcc3newlib/gccnewlib.add: Add --build=%_build --host=%_host. * gdb/gdb.add: Add --build=%_build --host=%_host. * rtemsdoc/.cvsignore: Add *.spec.in. --- scripts/ChangeLog | 9 ++++ scripts/README.cdn-X | 122 ++++++++++++++++++++++++++++++++++++++++++ scripts/binutils/binutils.add | 1 + 3 files changed, 132 insertions(+) create mode 100644 scripts/README.cdn-X diff --git a/scripts/ChangeLog b/scripts/ChangeLog index 2211158c6c..e4f7dd49e9 100644 --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,12 @@ +2003-01-31 Ralf Corsepius + + * README.cdn-X: New. + * binutils/binutils.add: Add --build=%_build --host=%_host. + * cpukit/.cvsignore: Add *.spec.in. + * gcc3newlib/gccnewlib.add: Add --build=%_build --host=%_host. + * gdb/gdb.add: Add --build=%_build --host=%_host. + * rtemsdoc/.cvsignore: Add *.spec.in. + 2003-01-31 Ralf Corsepius * gcc3newlib/gccnewlib.add: Remove Buildroot. diff --git a/scripts/README.cdn-X b/scripts/README.cdn-X new file mode 100644 index 0000000000..95d6e8dae5 --- /dev/null +++ b/scripts/README.cdn-X @@ -0,0 +1,122 @@ +Applying RTEMS-toolchain RPM-specs for Canadian Cross Compilation +================================================================= + +Example: Building a Cygwin-based xxx-rtems toolchain under Linux: + +Quickstart +---------- +The command to invoke rpm for building RTEMS's gnu toolchain cdn. cross +under Linux is: +rpmbuild -ba xxx-rtems-yyy.spec \ +--define='_build i686-pc-linux-gnu' +--define='_host i386-cygwin' \ +--target=i386-cygwin + +[If using rpm < 4.1, use "rpm" instead of "rpmbuild".] + + +If you don't understand this, read on ... :-) + +1. Prerequisites +---------------- +* a native Linux-toolchain (eg. gcc, binutils). +Prebuild binaries should come with any Linux distribution. +We further on assume this toolchain to be installed in /usr, such that +/usr/bin/gcc is supposed to be your native CC. + +* a Linux -> Cygwin cross-toolchain +RPM-specs are available in the contrib/cygwin directory in RTEMS's sourcetree. +Prebuild binaries should be available from + ftp://ftp.OARCorp.com + http://packman.links2linux.de + +We further on assume this toolchain to be installed in /opt/i386-cygwin, +i.e. /opt/i386-cygwin/bin/i386-cygwin-gcc is assumed to be the linux->cygwin +cross compiler. + +2. Preparations +--------------- + +* Make sure to have /usr/bin and /opt/i386-cygwin/bin in $PATH. + +* Download the source-tarballs and patches. Put them into a directory where +rpm can pick them up (/usr/src/redhat/SOURCES under RH) + +* configure this directory +./configure +[Many files being generated] + +Among these files the rpm.specs will be generated, one per tool in its +corresponding subdirectory. + +The spec-files you are looking for are: +binutils/xxx-rtems-binutils.spec +gcc3newlib/xxx-rtems-gccnewlib.spec +gdb/xxx-rtems-gdb.spec + +[You must have appropriate versions of autoconf and +automake installed.] + +3. Building +----------- + +rpmbuild -ba binutils/xxx-rtems-binutils-.spec \ +--define='_build=i686-pc-linux-gnu' \ +--define='_host=i386-cygwin' \ +--target=i386-cygwin + +rpmbuild -ba gcc3newlib/xxx-rtems-gcc--newlib-.spec \ +--define='_build=i686-pc-linux-gnu' \ +--define='_host=i386-cygwin' \ +--target=i386-cygwin + +rpmbuild -ba +gdb/xxx-rtems-gdb-.spec \ +--define='_build=i686-pc-linux-gnu' \ +--define='_host=i386-cygwin' \ +--target=i386-cygwin + +Each of these commands builds several corresponding rpms. +[Beware: This can take several hours.] + +NOTE: These packages will be packaged as Linux' rpms, but contain Cygwin +binaries. If using the default rpm-directories, this will put the rpms into +your linux RPM-directories, i.e. pollute these directories with foreign +RPMs. + +To avoid this, I recommend to set up RPM's internal variable %_rpmdir to +point to a different directory than the default or to use a different root for the cygwin +RPM directory tree, i.e. to set %_topdir. [1] + +4. Repackaging the RPMS into tarballs +------------------------------------- + +Basically, there exist two ways: + +* Applying "alien". +I highly recommend using this, but unfortunately alien is not +shipped with all Linux distributions. +[alien can also be applied to repackage the rpms into other packaging +formats.] + +* Manual unpacking and tar-ing +cd +rpmcpio xxx-rtems-yyy..rpm | cpio -i --make-directories +tar cjvf /xxx-rtems-yyy..tar.bz2 opt/rtems +rm -rf opt/rtems + +NOTE: You might want to consider performing repackaging as root to avoid +loosing file permissions. + +5. Other platforms +------------------ +The procedure to build for other platforms (Solaris, ...) is analogous. Just +replace i386-cygwin with your target, eg sun-sparc-solaris2.8 + +Ralf Corsepius 2003-01-31 + +[1] Setting up an rpm variable can be done: +* on the command line: +rpmbuild --define='_topdir /home/user/src/cygwin' ... +* from a user's ~/.rpmmacros +_topdir /home/user/src/cygwin diff --git a/scripts/binutils/binutils.add b/scripts/binutils/binutils.add index 0526e32066..f1c070faa7 100644 --- a/scripts/binutils/binutils.add +++ b/scripts/binutils/binutils.add @@ -42,6 +42,7 @@ This is binutils sources with patches for RTEMS. %build cd build ../binutils-@binutils_version@/configure \ + --build=%_build --host=%_host \ --target=@target_alias@ \ --verbose --prefix=%{_prefix} --disable-nls -- cgit v1.2.3