Rtems development environment Construction--based on FreeBSD system
December 08, 2015 Tuesday
This article is a record of the installation of the RTEMS-4.10.2 development environment, and is only a record, not the process of doing too much research on the principle.
1, the use of the FreeBSD 9.3 version of the system, the system comes with the gcc-4.2.1 compiler, and it will complete the environment in the construction of the various programs compiled work;
2, this article uses RTEMS-4.10.2 edition source code;
3, the following describes the installation process of the development environment:
(1) Install bash
FreeBSD defaults to the/BIN/CSH and/bin/sh two shell, but in my testing process, I found neither of these shells can successfully compile Rtems source code, but in the use of bash can be successful.
Therefore, you need to install bash first, which can be installed by port:
Cd/usr/port/shell/bash
Make install
Use the CHSH command to change the user's default shell to bash, where you can refer to the relevant FreeBSD manuals;
(2) Install GNU make
Since FreeBSD 9.3 uses Berkeley make as the default, and the programs we want to compile are all managed by GNU made, we need to install GNU makes;
Download the make-3.82.tar.bz2 source code from the ftp://ftp.gnu.org website and install the following:
TAR-XJF make-3.82.tar.bz2
mkdir Build_make
CD Build_make
.. /make-3.82/configure
Make
Make install
When the installation is complete, both make and gmake are present in the system, and gmake management is used by default.
(3) Installation Texinfo
Download the texinfo-4.9.tar.gz source code from the ftp://ftp.gnu.org website and install the following:
Tar-xzf texinfo-4.9.tar.gz
mkdir Build_texinfo
CD Build_texinfo
.. /texinfo-4.9/configure
Gmake
Gmake Install
(4) Installation of GMP, MPFR, MPC Library
Download gmp-5.0.4.tar.bz2, mpfr-2.4.2.tar.bz2, mpc-1.0.3.tar.gz source from ftp://ftp.gnu.org website, install in the following order:
A. Install gmp-5.0.4:
TAR-XJF gmp-5.0.4.tar.bz2
mkdir Build_gmp
CD BUILD_GMP
.. /gmp-5.0.4/configure--prefix=/usr/local/gmp (prefix for specifying the installation directory)
Gmake
Gmake Install
B. Install mpfr-2.4.2:
TAR-XJF mpfr-2.4.2.tar.bz2
mkdir BUILD_MPFR
CD BUILD_MPFR
.. /mpfr-2.4.2/configure--PREFIX=/USR/LOCAL/MPFR--with-gmp=/usr/local/gmp (reference GMP)
Gmake
Gmake Install
C. Install mpc-1.0.3:
Tar-xzf mpc-1.0.3.tar.gz
mkdir BUILD_MPC
CD BUILD_MPC
.. /mpc-1.0.3/configure--PREFIX=/USR/LOCAL/MPC--with-gmp=/usr/local/gmp--WITH-MPFR=/USR/LOCAL/MPFR (reference GMP,MPFR)
Gmake
Gmake Install
D. Adding environment variables
At the end of/etc/profile, add the following:
Export Ld_library_path=/usr/local/gmp/lib:/usr/local/mpfr/lib:/usr/local/mpc/lib: $LD _library_path
Source/etc/profile (update environment variables)
(5) Installation of binutils, GCC
Download the following source code from ftp://ftp.rtems.com/pub/rtems/SOURCES/4.10/official website:
binutils-2.20.1.tar.bz2
Binutils-2.20.1-rtems4.10-20140214.diff
Newlib-1.18.0.tar.gz
Newlib-1.18.0-rtems4.10-20130320.diff
gcc-4.4.7.tar.bz2
Gcc-4.4.7-rtems4.10-20130320.diff
A. Install Binutils:
TAR-XJF binutils-2.20.1.tar.bz2
CD binutils-2.20.1
Cat.. /binutils-2.20.1-rtems4.10-20140214.diff | Patch-p1
Cd..
mkdir build_binutils
CD Build_binutils
.. /binutils-2.20.1/configure--target=arm-rtems4.10--prefix=/opt/rtems-4.10--disable-werror
Gmake
Gmake install (requires root access)
Insert a row at the end of ~/.profile:
Export Path=/opt/rtems-4.10/bin:${path}
To execute the command again:
SOURCE ~/.profile (Update environment variable)
B. Installing GCC:
TAR-XJF gcc-4.4.7.tar.bz2
CD gcc-4.4.7
Cat.. /gcc-4.4.7-rtems4.10-20130320.diff | Patch-p1
Cd..
Tar-xzf newlib-1.18.0.tar.gz
CD newlib-1.18.0
Cat.. /newlib-1.18.0-rtems4.10-20130302.diff | Patch-p1
Cd.. /gcc-4.4.7
Ln-s. /newlib-1.18.0/newlib. (Create a soft link)
Cd..
mkdir BUILD_GCC
CD BUILD_GCC
.. /gcc-4.4.7/configure--target=arm-rtems4.10--with-gnu-as--with-gnu-ld--with-newlib--verbose--enable-threads-- Enable-languages= "c,c++"--prefix=/opt/rtems-4.10--with-gmp=/usr/local/gmp--WITH-MPFR=/USR/LOCAL/MPFR
Gmke All
Gmake Info
Gmake install (requires root access)
When all of the above compiles and installs successfully, the installation process for the compilation environment ends.
4. Verify that the environment is installed correctly
(1) from the Rtems official website ftp://ftp.rtems.com/pub/rtems/4.10.2/download rtems-4.10.2 source code;
(2) Compile the source code;
TAR-XJF rtems-4.10.2.tar.bz2
mkdir Build_rtems
CD Build_rtems
.. /rtems-4.10.2/configure--target=arm-rtems4.10--enable-posix--enable-networking--enable-cxx--enable-rtemsbsp= smdk2410--prefix=/opt/rtems-4.10/
Gmake All
SU Root (switch to root account)
Gmake Install (root privilege)
If there is no error, it indicates success.
At this point, the end!
Rtems development environment Construction--based on FreeBSD system