= Building Tool RPM Packages = ''Chris: This is the start of documenting building the tool RPM packages.'' RTEMS provides binary tool packages in the RPM format. You need to build the packages from source so will need the RTEMS source tree, plus the source for GCC, binutils, newlib and GDB. The [wiki:StandardPackagePatches standard packages may require patches]. = Build Machine = The current tool sets are build on Linux PC based machines. Joel uses a RedHat 7.3 machine to give the resulting executables a wide range of machines to run on. Ralf and Chris use Fedora Core 4 machines. The page is written while building on a Fedora Core 4 machine. The host machine needs to be a software development machine. You need to make sure you have a working GNU compile suite. If you intend to build all possible packages you will need a large amount of disk space. You need to install perl and help2man. On Fedora Core 4 you can find a help2man RPM package in the [http://download.fedora.redhat.com/pub/fedora/linux/extras Extras RPM repository standard packages may require patches]. = Source Code = To build the latest tool set you will need a current RTEMS snapshot. A [http://www.rtems.org/cvs.html CVS checkout] may be suitable. You will also need to download these source code packages: * [wiki:Autoconf-2.59-quoting-20040817-1.diff autoconf-2.59-quoting-20040817-1.diff] * [wiki:Autoconf-2.59.tar.bz2 autoconf-2.59.tar.bz2] * [wiki:Automake-1.8.1-rtems-20040112-1.diff automake-1.8.1-rtems-20040112-1.diff] * [wiki:Automake-1.8.2-rtems-20040112-1.diff automake-1.8.2-rtems-20040112-1.diff] * [wiki:Automake-1.9.5-rtems-20050303.diff automake-1.9.5-rtems-20050303.diff] * [wiki:Automake-1.9.5.tar.bz2 automake-1.9.5.tar.bz2] * [wiki:Automake-1.9.6.tar.bz2 automake-1.9.6.tar.bz2] * [wiki:Binutils-2.16.1-rtems-20050816.diff binutils-2.16.1-rtems-20050816.diff]| * [wiki:Binutils-2.16.1.tar.bz2 binutils-2.16.1.tar.bz2] * [wiki:Binutils-2.16-rtems-20050509.diff binutils-2.16-rtems-20050509.diff] * [wiki:Binutils-2.16.tar.bz2 binutils-2.16.tar.bz2] * [wiki:Gcc-4.0.2.tar.bz2 gcc-4.0.2.tar.bz2] * [wiki:Newlib-1.13.0-rtems-20050810.diff newlib-1.13.0-rtems-20050810.diff] * [wiki:Newlib-1.13.0.tar.gz newlib-1.13.0.tar.gz] Place these files in a SOURCES directory under the RPM build location you select. = RPM Base Directory = You need to selection a location on the host build machine where the RPMs are built and the resulting images left. An example is: /opt/rtems/src This means the source code should be placed in: /opt/rtems/src/SOURCES You also need to create few working directories. These are: $ cd /opt/rtems/src $ mkdir SRPMS $ mkdir -p RPMS/noarch = RPM Macros File = Create a private RPM macros file in your home directory: $ cat ~/.rpmmacros %_topdir /opt/rtems/src %_tmppath /tmp/rtems %_rpmdir %_topdir/%_target_os/RPMS %_srcrpmdir %_topdir/%_target_os/SRPMS %_signature gpg # %_gpg_path ~/.gnupg # %_gpg_name "RTEMS Packager" %_gpg_name rtems %vendor: OAR Corp %packager http://www.rtems.org/ The {{{%_topdir field is set to your RPM Base directory. = Building = The building of the RPM packages requires a number of phases to be completed in order. Each phase requires the previous phase to be completed. = Configuring the Scripts = Enter the scripts directory of RTEMS and run configure providing a prefix address. The prefix is the . This assumes you have successfully completed a bootstrap: $ cd /opt/rtems/src/cvs/scripts $ ./configure --prefix=/opt/rtems/current The result are a number of specs files in each component directory. There is a spec file for each RTEMS target processor type. = =Running rpmbuild == The first packages you need to build are the autotools packages. RTEMS uses autotool packages that are later releases than those found on most Linux operating sysems. To build enter the autotools directory and run rpmbuild: $ cd autotools $ rpmbuild -ba rtems-4.7-autoconf-rtems.spec --target=i686-pc-linux-gnu This builds autoconf for a Linux PC host. ''Note:'' Different versions of RPM may behave differently. This may appear when building a different target. If this occurs try: rpmbuild \ --define '_build i386-redhat-linux' \ --define '_host i686-pc-cygwin' \ --target=i686-pc-cygwin \ -ba