source: rtems/scripts/README.cdn-X @ 06e70cd

4.104.114.84.95
Last change on this file since 06e70cd was 7da8c10, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/31/03 at 16:02:21

2003-01-31 Ralf Corsepius <corsepiu@…>

  • 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.
  • Property mode set to 100644
File size: 3.7 KB
Line 
1Applying RTEMS-toolchain RPM-specs for Canadian Cross Compilation
2=================================================================
3
4Example: Building a Cygwin-based xxx-rtems toolchain under Linux:
5
6Quickstart
7----------
8The command to invoke rpm for building RTEMS's gnu toolchain cdn. cross
9under Linux is:
10rpmbuild -ba xxx-rtems-yyy.spec \
11--define='_build i686-pc-linux-gnu'
12--define='_host i386-cygwin' \
13--target=i386-cygwin
14
15[If using rpm < 4.1, use "rpm" instead of "rpmbuild".]
16
17
18If you don't understand this, read on ... :-)
19
201. Prerequisites
21----------------
22* a native Linux-toolchain (eg. gcc, binutils).
23Prebuild binaries should come with any Linux distribution.
24We further on assume this toolchain to be installed in /usr, such that
25/usr/bin/gcc is supposed to be your native CC.
26
27* a Linux -> Cygwin cross-toolchain
28RPM-specs are available in the contrib/cygwin directory in RTEMS's sourcetree.
29Prebuild binaries should be available from
30        ftp://ftp.OARCorp.com
31        http://packman.links2linux.de
32
33We further on assume this toolchain to be installed in /opt/i386-cygwin,
34i.e. /opt/i386-cygwin/bin/i386-cygwin-gcc is assumed to be the linux->cygwin
35cross compiler.
36
372. Preparations
38---------------
39
40* Make sure to have /usr/bin and /opt/i386-cygwin/bin in $PATH.
41
42* Download the source-tarballs and patches. Put them into a directory where
43rpm can pick them up (/usr/src/redhat/SOURCES under RH)
44
45* configure this directory
46./configure
47[Many files being generated]
48
49Among these files the rpm.specs will be generated, one per tool in its
50corresponding subdirectory.
51
52The spec-files you are looking for are:
53binutils/xxx-rtems-binutils.spec
54gcc3newlib/xxx-rtems-gccnewlib.spec
55gdb/xxx-rtems-gdb.spec
56
57[You must have appropriate versions of autoconf and
58automake installed.]
59
603. Building
61-----------
62
63rpmbuild -ba binutils/xxx-rtems-binutils-<binutilsvers>.spec \
64--define='_build=i686-pc-linux-gnu' \
65--define='_host=i386-cygwin' \
66--target=i386-cygwin
67
68rpmbuild -ba gcc3newlib/xxx-rtems-gcc-<gccvers>-newlib-<newlibvers>.spec \
69--define='_build=i686-pc-linux-gnu' \
70--define='_host=i386-cygwin' \
71--target=i386-cygwin
72
73rpmbuild -ba
74gdb/xxx-rtems-gdb-<gdbvers>.spec \
75--define='_build=i686-pc-linux-gnu' \
76--define='_host=i386-cygwin' \
77--target=i386-cygwin
78
79Each of these commands builds several corresponding rpms.
80[Beware: This can take several hours.]
81
82NOTE: These packages will be packaged as Linux' rpms, but contain Cygwin
83binaries. If using the default rpm-directories, this will put the rpms into
84your linux RPM-directories, i.e. pollute these directories with foreign
85RPMs.
86
87To avoid this, I recommend to set up RPM's internal variable %_rpmdir to
88point to a different directory than the default or to use a different root for the cygwin
89RPM directory tree, i.e. to set %_topdir. [1]
90
914. Repackaging the RPMS into tarballs
92-------------------------------------
93
94Basically, there exist two ways:
95
96* Applying "alien".
97I highly recommend using this, but unfortunately alien is not
98shipped with all Linux distributions.
99[alien can also be applied to repackage the rpms into other packaging
100formats.]
101
102* Manual unpacking and tar-ing
103cd <empty-directory>
104rpmcpio xxx-rtems-yyy.<arch>.rpm | cpio -i --make-directories
105tar cjvf <where-ever>/xxx-rtems-yyy.<arch>.tar.bz2 opt/rtems
106rm -rf opt/rtems
107
108NOTE: You might want to consider performing repackaging as root to avoid
109loosing file permissions.
110
1115. Other platforms
112------------------
113The procedure to build for other platforms (Solaris, ...) is analogous. Just
114replace i386-cygwin with your target, eg sun-sparc-solaris2.8
115
116Ralf Corsepius          2003-01-31
117
118[1] Setting up an rpm variable can be done:
119* on the command line:
120rpmbuild --define='_topdir /home/user/src/cygwin' ...
121* from a user's ~/.rpmmacros
122_topdir /home/user/src/cygwin
Note: See TracBrowser for help on using the repository browser.