eldk编译器安装
作者:互联网
- 访问ELDK5网站 http://www.denx.de/wiki/ELDK-5/WebHome
- 从ftp下载对应平台镜像 ftp://ftp.denx.de/pub/eldk/5.5.3/iso/eldk-5.5.3-powerpc.iso
- 也可以分别下载
wget ftp://ftp.denx.de/pub/eldk/5.5.3/install.sh
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-base-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-basic-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-clutter-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-lsb-dev-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-lsb-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-lsb-sdk-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-minimal-dev-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-minimal-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-minimal-mtdutils-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-minimal-xenomai-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-qte-sdk-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-qte-xenomai-sdk-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-sato-dev-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-sato-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-sato-sdk-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-x11-generic-powerpc.tar.gz
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/eldk-eglibc-i686-powerpc-toolchain-gmae-5.5.3.sh
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/eldk-eglibc-i686-powerpc-toolchain-qte-5.5.3.sh
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/eldk-eglibc-i686-powerpc-toolchain-xenomai-qte-5.5.3.sh
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/powerpc.sha256
wget ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/target.conf
- 如果是下载了eldk-5.5.3-powerpc.iso,则将这个镜像挂在到linux中
mkdir -p /mnt/eldk-5.5.3-powerpc-download
mount /mnt/nfs/tmp/eldk-5.5.3-powerpc.iso /mnt/eldk-5.5.3-powerpc-download
cd /mnt/eldk-5.5.3-powerpc-download
- 如果是分散下载,需要将文件下载到对应的目录中,如下
mkdir -p /mnt/eldk-5.5.3-powerpc-download
cd /mnt/eldk-5.5.3-powerpc-download
wget -x -nH --cut-dirs=4 ftp://ftp.denx.de/pub/eldk/5.5.3/install.sh
wget -x -nH --cut-dirs=4 ftp://ftp.denx.de/pub/eldk/5.5.3/targets/powerpc/core-image-base-generic-powerpc.tar.gz
...
- 校验下载文件
- 先校验eldk-5.5.3-powerpc.iso,校验码在 ftp://ftp.denx.de/pub/eldk/5.5.3/iso/iso.sha256
sha256sum eldk-5.5.3-powerpc.iso
- 将生成的校验码和iso.sha256中的对比
- 校验eldk-5.5.3-powerpc.iso内部文件
>>> cd /mnt/eldk-5.5.3-powerpc-download >>> sha256sum -c install.sha256 README: OK install.sh: OK >>> cd targets/powerpc/ >>> sha256sum -c powerpc.sha256 core-image-base-generic-powerpc.tar.gz: OK core-image-basic-generic-powerpc.tar.gz: OK core-image-clutter-generic-powerpc.tar.gz: OK core-image-lsb-dev-generic-powerpc.tar.gz: OK core-image-lsb-generic-powerpc.tar.gz: OK core-image-lsb-sdk-generic-powerpc.tar.gz: OK core-image-minimal-dev-generic-powerpc.tar.gz: OK core-image-minimal-generic-powerpc.tar.gz: OK core-image-minimal-mtdutils-generic-powerpc.tar.gz: OK core-image-minimal-xenomai-generic-powerpc.tar.gz: OK core-image-qte-sdk-generic-powerpc.tar.gz: OK core-image-qte-xenomai-sdk-generic-powerpc.tar.gz: OK core-image-sato-dev-generic-powerpc.tar.gz: OK core-image-sato-generic-powerpc.tar.gz: OK core-image-sato-sdk-generic-powerpc.tar.gz: OK core-image-x11-generic-powerpc.tar.gz: OK eldk-eglibc-i686-powerpc-toolchain-gmae-5.5.3.sh: OK eldk-eglibc-i686-powerpc-toolchain-qte-5.5.3.sh: OK eldk-eglibc-i686-powerpc-toolchain-xenomai-qte-5.5.3.sh: OK target.conf: OK cd -
- 可能有校验不对的文件,这时最好能够重新下对应文件.
- 查看安装脚本帮助信息
>>> sh install.sh -h
Usage: install.sh [-D] [-d <dir>] [-a <arch>] [-s <sdk_img> ] [-r <rfs_img> ] [<target>]
install.sh -l [<target>]
install.sh -h
-D: Dry-run: display commands, but don't actually execute them.
-a: SDK host architecture.
Chose one of 'i686' or 'x86_64".
Defaults to "i686".
-d: Destination directory.
Defaults to "/opt/eldk-5.5.3"
-h: Help: print this message.
-l: List available SDK and RFS images
-s: Select SDK image.
Chose one of 'gmae', 'qte', 'qte-xenomai', or '-' for none.
Defaults to "gmae".
-r: Select list of target RFS images.
Chose one or more of 'minimal', 'minimal-mtdutils', 'minimal-dev',
'minimal-xenomai', 'base', 'basic', 'clutter', 'lsb',
'lsb-dev', 'lsb-sdk', 'sato', 'sato-dev', 'sato-sdk', 'qte-sdk',
'qte-xenomai-sdk', 'x11', or '-' for none.
Defaults to all.
<target> target architecture, defaults to "armv7a-hf"
- 根据帮助信息,查看平台和镜像支持
>>> sh install.sh -l powerpc
Available SDK images for target 'powerpc':
'gmae', 'qte', 'xenomai-qte'.
Available RFS images for target 'powerpc':
'base', 'basic', 'clutter', 'lsb-dev', 'lsb', 'lsb-sdk',
'minimal-dev', 'minimal', 'minimal-mtdutils', 'minimal-xenomai',
'qte-sdk', 'qte-xenomai-sdk', 'sato-dev', 'sato', 'sato-sdk',
'x11'.
gmae: GMAE/Sato: This configuration is based on the GNOME Mobile & Embedded Initiative (GMAE) software stack. It focuses on mobile devices and provides user interfaces like Pimlico, Clutter, Sato and other GNOME Mobile technologies.
In ELDK v5.5.3 this is represented by the “gmae” cross tool chain and the “sato*” target root file system packages.
qte是指包含了qt交叉编译工具链
- SDK images只能选一个,RFS images可以选多个;一般的选择gmae即可,如果需要支持qt,则选择qte
# 只安装交叉编译器
>>> sh install.sh -s gmae -r - powerpc
*** Installing ./targets/powerpc/eldk-eglibc-i686-powerpc-toolchain-gmae-5.5.3.sh
into /opt/eldk-5.5.3/powerpc
# 只安装rootfs
sh install.sh -s - -r "base minimal-mtdutils" powerpc
- rootfs也可以手动的安装
# /mnt/eldk-5.5.3-powerpc-download 是我的eldk-5.5.3-powerpc.iso挂载目录
# rootfs 可选为$(sh install.sh -l powerpc) 中的RFS images内容
rootfs='lsb-dev'; mkdir -p /opt/eldk-5.5.3/powerpc/${rootfs}; tar -xzvf /mnt/eldk-5.5.3-powerpc-download/targets/powerpc/core-image-${rootfs}-generic-powerpc.tar.gz -C /opt/eldk-5.5.3/powerpc/${rootfs}
- 编译器的环境变量
# 在安装目录(/opt/eldk-5.5.3/powerpc/)下,有编译链的环境变量配置文件
# 这个文件不需要编辑,包含了交叉编译过程中可能用到的所有环境变量;
# 如果你安装的是qte的工具链,相应的qt环境变量也会记录在这个文件中
>>> cat /opt/eldk-5.5.3/powerpc/environment-setup-powerpc-linux
export PATH=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/bin:/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux:$PATH
export PKG_CONFIG_SYSROOT_DIR=/opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux
export PKG_CONFIG_PATH=/opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux/usr/lib/pkgconfig
export CONFIG_SITE=/opt/eldk-5.5.3/powerpc/site-config-powerpc-linux
export CC="powerpc-linux-gcc -m32 -mhard-float --sysroot=/opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux"
export CXX="powerpc-linux-g++ -m32 -mhard-float --sysroot=/opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux"
export CPP="powerpc-linux-gcc -E -m32 -mhard-float --sysroot=/opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux"
export AS="powerpc-linux-as "
export LD="powerpc-linux-ld --sysroot=/opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux"
export GDB=powerpc-linux-gdb
export STRIP=powerpc-linux-strip
export RANLIB=powerpc-linux-ranlib
export OBJCOPY=powerpc-linux-objcopy
export OBJDUMP=powerpc-linux-objdump
export AR=powerpc-linux-ar
export NM=powerpc-linux-nm
export M4=m4
export TARGET_PREFIX=powerpc-linux-
export CONFIGURE_FLAGS="--target=powerpc-linux --host=powerpc-linux --build=i686-linux --with-libtool-sysroot=/opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux"
export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types"
export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types -fpermissive"
export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
export CPPFLAGS=""
export OECORE_NATIVE_SYSROOT="/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux"
export OECORE_TARGET_SYSROOT="/opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux"
export OECORE_ACLOCAL_OPTS="-I /opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/share/aclocal"
export OECORE_DISTRO_VERSION="5.5.3"
export OECORE_SDK_VERSION="5.5.3"
export PYTHONHOME=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr
export ARCH=powerpc
export CROSS_COMPILE=powerpc-linux-
- 加载环境变量
. /opt/eldk-5.5.3/powerpc/environment-setup-powerpc-linux
>>> echo $CC
powerpc-linux-gcc -m32 -mhard-float --sysroot=/opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux
>>> $CC -v
Using built-in specs.
COLLECT_GCC=powerpc-linux-gcc
COLLECT_LTO_WRAPPER=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/libexec/powerpc-linux/gcc/powerpc-linux/4.8.1/lto-wrapper
Target: powerpc-linux
Configured with: /opt/eldk/build/eldk-rel-v5.5.3-2014-11-13-ba6000e-powerpc/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/configure --build=x86_64-linux --host=i686-eldk-linux --target=powerpc-linux --prefix=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr --exec_prefix=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr --bindir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux --sbindir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux --libexecdir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/libexec/powerpc-linux --datadir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/share --sysconfdir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/etc --sharedstatedir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/com --localstatedir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/var --libdir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/lib/powerpc-linux --includedir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/include --oldincludedir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/include --infodir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/share/info --mandir=/opt/eldk-5.5.3/powerpc/sysroots/i686-eldk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/opt/eldk/build/eldk-rel-v5.5.3-2014-11-13-ba6000e-powerpc/tmp/sysroots/i686-nativesdk-eldk-linux --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --disable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=powerpc-linux- --without-local-prefix --enable-lto --enable-libssp --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --with-gxx-include-dir=/opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux/usr/include/c++ --with-build-time-tools=/opt/eldk/build/eldk-rel-v5.5.3-2014-11-13-ba6000e-powerpc/tmp/sysroots/x86_64-linux/usr/powerpc-linux/bin --with-sysroot=/opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux --with-build-sysroot=/opt/eldk/build/eldk-rel-v5.5.3-2014-11-13-ba6000e-powerpc/tmp/sysroots/generic-powerpc --enable-targets=powerpc64 --enable-poison-system-directories --disable-libunwind-exceptions --with-mpfr=/opt/eldk/build/eldk-rel-v5.5.3-2014-11-13-ba6000e-powerpc/tmp/sysroots/i686-nativesdk-eldk-linux --with-mpc=/opt/eldk/build/eldk-rel-v5.5.3-2014-11-13-ba6000e-powerpc/tmp/sysroots/i686-nativesdk-eldk-linux --enable-nls --enable-__cxa_atexit --with-long-double-128
Thread model: posix
gcc version 4.8.1 (GCC)
标签:ftp,5.5,eldk,powerpc,--,编译器,linux,安装 来源: https://blog.csdn.net/qq_24276421/article/details/118305635