歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

使用ELDK 5.0編譯U-Boot中的smdk2410

准備玩玩ARM板子了,今天嘗試著建立一下編譯環境。

U-BOOT的ELDK已經發到5.0版本了。

而且,相較以前的ELDK版本,這個版本的安裝路徑不能在重定位了,規定死了要安裝在 /opt/eldk-5.0/ 目錄下,所以我預先建立了/opt/eldk-5.0/路徑。

root@xUbuntu-laptop:/opt# ls
eldk-5.0
root@xubuntu-laptop:/opt#

至於,我選擇的是針對 普通ARM的 armv5te架構的版本,下載的文件則有,見下面紅色字體的文件

root@xubuntu-laptop:/home/eldk-download# ls -al
total 20
drwxr-xr-x  3 root root 4096 2011-10-06 12:25 .
drwxr-xr-x 13 root root 4096 2011-10-14 22:59 ..
-rwxrwxrwx  1 root root 4909 2011-10-06 12:25 install.sh
drwxr-xr-x  3 root root 4096 2011-10-06 12:24 targets
root@xubuntu-laptop:/home/eldk-download# ls -al targets/armv5te/
total 499692
drwxr-xr-x 2 root root      4096 2011-10-07 17:36 .
drwxr-xr-x 3 root root      4096 2011-10-06 12:24 ..
-rw-r--r-- 1 root root 151669927 2011-10-06 13:31 eldk-eglibc-i686-arm-toolchain-qte-5.0.tar.bz2
-rw------- 1 root root 359995091 2011-10-07 17:42 poky-image-qte-sdk-armv5te.tar.gz
-rw-r--r-- 1 root root        71 2011-10-06 12:26 target.conf
root@xubuntu-laptop:/home/eldk-download# 


安裝很簡單,如下,藍色部分為提示信息

root@xubuntu-laptop:/home/eldk-download# ls
install.sh  targets
root@xubuntu-laptop:/home/eldk-download# ./install.sh -i qte armv5te
--------------------------------------------------------------------
NOTICE: superuser priviledges will be needed to install the
root file system; make sure you have sufficient permissions.
--------------------------------------------------------------------
*** Installing ./targets/armv5te/poky-image-qte-sdk-armv5te.tar.gz
*** Installing ./targets/armv5te/eldk-eglibc-i686-arm-toolchain-qte-5.0.tar.bz2

運行完畢,則進入/opt/eldk-5.0 目錄

root@xubuntu-laptop:/home/eldk-download# cd /opt/eldk-5.0/
root@xubuntu-laptop:/opt/eldk-5.0# ls -al
total 12
drwxrwxrwt 3 root root 4096 2011-10-14 22:34 .
drwxr-xr-x 3 root root 4096 2011-10-07 17:46 ..
drwxr-xr-x 4 root root 4096 2011-10-14 22:34 armv5te
root@xubuntu-laptop:/opt/eldk-5.0# ls -al armv5te/
total 80
drwxr-xr-x  4 root root  4096 2011-10-14 22:34 .
drwxrwxrwt  3 root root  4096 2011-10-14 22:34 ..
-rw-rw-r--  1 root root  2345 2011-05-21 08:28 environment-setup-armv5te-linux-gnueabi
drwxrwxr-x 16 root root  4096 2011-05-21 07:29 rootfs
-rw-rw-r--  1 root root 53330 2011-05-21 08:28 site-config-armv5te-linux-gnueabi
drwxr-xr-x  4 root root  4096 2011-05-21 08:16 sysroots
-rw-rw-r--  1 root root   119 2011-05-21 08:28 version-armv5te-linux-gnueabi
root@xubuntu-laptop:/opt/eldk-5.0# 

利用 source 命令,更新eldk相關的環境變量

root@xubuntu-laptop:/opt/eldk-5.0# cd armv5te/
root@xubuntu-laptop:/opt/eldk-5.0/armv5te# ls
environment-setup-armv5te-linux-gnueabi  sysroots
rootfs                                   version-armv5te-linux-gnueabi
site-config-armv5te-linux-gnueabi
root@xubuntu-laptop:/opt/eldk-5.0/armv5te# source environment-setup-armv5te-linux-gnueabi

利用export顯示環境變量

root@xubuntu-laptop:/opt/eldk-5.0/armv5te# export
declare -x BUILD_DIR="/home/ub-build/"
declare -x CC="arm-linux-gnueabi-gcc"
declare -x CFLAGS="-march=armv5te -mtune=arm926ej-s --sysroot=/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi"
declare -x COLORTERM="Terminal"
declare -x CONFIGURE_FLAGS="--target=arm-linux-gnueabi --host=arm-linux-gnueabi --build=i686-linux --with-libtool-sysroot=/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi"
declare -x CONFIG_SITE="/opt/eldk-5.0/armv5te/site-config-armv5te-linux-gnueabi"
declare -x CPPFLAGS="--sysroot=/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi"
declare -x CROSS_COMPILE="arm-linux-gnueabi-"
declare -x CXX="arm-linux-gnueabi-g++"
declare -x CXXFLAGS="-march=armv5te -mtune=arm926ej-s --sysroot=/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-NoMkV65G1M,guid=d25f34aa3ae12310ab07139c00000024"
declare -x DEFAULTS_PATH="/usr/share/gconf/xubuntu.default.path"
declare -x DESKTOP_SESSION="xubuntu"
declare -x DISPLAY=":0.0"
declare -x GDB="arm-linux-gnueabi-gdb"
declare -x GDMSESSION="xubuntu"
declare -x GDM_KEYBOARD_LAYOUT="us"
declare -x GDM_LANG="en_US"
declare -x GLADE_CATALOG_PATH=":"
declare -x GLADE_MODULE_PATH=":"
declare -x GLADE_PIXMAP_PATH=":"
declare -x GTK_MODULES="canberra-gtk-module"
declare -x GTK_PATH=":/usr/lib/gtk-2.0"
declare -x HOME="/root"
declare -x LANG="en_US.UTF-8"
declare -x LANGUAGE="en_US:en"
declare -x LDFLAGS="--sysroot=/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi"
declare -x LESSCLOSE="/usr/bin/lesspipe %s %s"
declare -x LESSOPEN="| /usr/bin/lesspipe %s"
declare -x LIBGLADE_MODULE_PATH=":"
declare -x LOGNAME="root"
declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:"
declare -x MAIL="/var/mail/root"
declare -x MANDATORY_PATH="/usr/share/gconf/xubuntu.mandatory.path"
declare -x OE_QMAKE_AR="arm-linux-gnueabi-ar"
declare -x OE_QMAKE_CC="arm-linux-gnueabi-gcc"
declare -x OE_QMAKE_CXX="arm-linux-gnueabi-g++"
declare -x OE_QMAKE_INCDIR_QT="/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi//usr/include/qtopia"
declare -x OE_QMAKE_LIBDIR_QT="/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi//usr/lib"
declare -x OE_QMAKE_LINK="arm-linux-gnueabi-g++"
declare -x OE_QMAKE_MOC="/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/moc4"
declare -x OE_QMAKE_QDBUSCPP2XML="/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/qdbuscpp2xml4"
declare -x OE_QMAKE_QDBUSXML2CPP="/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/qdbusxml2cpp4"
declare -x OE_QMAKE_QT_CONFIG="/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi//usr/share/qtopia/mkspecs/qconfig.pri"
declare -x OE_QMAKE_RCC="/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/rcc4"
declare -x OE_QMAKE_UIC="/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/uic4"
declare -x OE_QMAKE_UIC3="/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/uic34"
declare -x OLDPWD="/opt/eldk-5.0"
declare -x PATH="/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin:/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/armv5te-linux-gnueabi:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
declare -x PKG_CONFIG_PATH="/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi/usr/lib/pkgconfig"
declare -x PKG_CONFIG_SYSROOT_DIR="/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi"
declare -x POKY_DISTRO_VERSION="5.0"
declare -x POKY_NATIVE_SYSROOT="/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux"
declare -x POKY_TARGET_SYSROOT="/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi"
declare -x PWD="/opt/eldk-5.0/armv5te"
declare -x QMAKESPEC="/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi//usr/share/qtopia/mkspecs/linux-g++"
declare -x SESSION_MANAGER="local/xubuntu-laptop:@/tmp/.ICE-unix/1094,unix/xubuntu-laptop:/tmp/.ICE-unix/1094"
declare -x SHELL="/bin/bash"
declare -x SHLVL="2"
declare -x SSH_AGENT_PID="1074"
declare -x SSH_AUTH_SOCK="/tmp/ssh-ljrwqbhc1045/agent.1045"
declare -x TARGET_PREFIX="arm-linux-gnueabi-"
declare -x TERM="xterm"
declare -x USER="root"
declare -x USERNAME="xubuntu"
declare -x WINDOWID="62914564"
declare -x WINDOWPATH="7"
declare -x XAUTHORITY="/var/run/gdm/auth-for-xubuntu-lLfwO4/database"
declare -x XDG_CONFIG_DIRS="/etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg"
declare -x XDG_DATA_DIRS="/usr/share/xubuntu:/usr/share/xubuntu:/usr/local/share/:/usr/share/:/usr/share"
declare -x XDG_MENU_PREFIX="xfce-"
declare -x XDG_SESSION_COOKIE="578e5166d8f7bed60afce74700000008-1318601761.3688-1602904928"
root@xubuntu-laptop:/opt/eldk-5.0/armv5te# 


顯示一下arm-linux-gnueabi-gcc的信息

xubuntu@xubuntu-laptop:/home/u-boot-2011.09$ arm-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/libexec/armv5te-linux-gnueabi/gcc/arm-linux-gnueabi/4.5.1/lto-wrapper
Target: arm-linux-gnueabi
Configured with: /opt/poky/build/eldk-2011-05-20-5cde06e-armv5te/tmp/work/i686-nativesdk-oesdk-linux/gcc-cross-canadian-arm-4.5.1-r4/gcc-4.5.1/configure --build=x86_64-linux --host=i686-oesdk-linux --target=arm-linux-gnueabi --prefix=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr --exec_prefix=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr --bindir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/armv5te-linux-gnueabi --sbindir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/armv5te-linux-gnueabi --libexecdir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/libexec/armv5te-linux-gnueabi --datadir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/share --sysconfdir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/etc --sharedstatedir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/com --localstatedir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/var --libdir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/lib/armv5te-linux-gnueabi --includedir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/include --oldincludedir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/include --infodir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/share/info --mandir=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/share/man --with-libtool-sysroot=/opt/poky/build/eldk-2011-05-20-5cde06e-armv5te/tmp/sysroots/i686-oesdk-linux-nativesdk --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=arm-linux-gnueabi- --enable-target-optspace --enable-lto --enable-libssp --disable-bootstrap --disable-libgomp --disable-libmudflap --enable-cheaders=c_global --with-float=soft --with-local-prefix=/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi/usr --with-gxx-include-dir=/usr/include/c++ --with-build-time-tools=/opt/poky/build/eldk-2011-05-20-5cde06e-armv5te/tmp/sysroots/x86_64-linux/usr/arm-linux-gnueabi/bin --with-sysroot=/opt/eldk-5.0/armv5te/sysroots/arm-linux-gnueabi --with-build-sysroot=/opt/poky/build/eldk-2011-05-20-5cde06e-armv5te/tmp/sysroots/armv5te --disable-libunwind-exceptions --disable-libssp --disable-libgomp --disable-libmudflap --with-mpfr=/opt/poky/build/eldk-2011-05-20-5cde06e-armv5te/tmp/sysroots/i686-oesdk-linux-nativesdk --with-mpc=/opt/poky/build/eldk-2011-05-20-5cde06e-armv5te/tmp/sysroots/i686-oesdk-linux-nativesdk --enable-__cxa_atexit
Thread model: posix
gcc version 4.5.1 (GCC)

Copyright © Linux教程網 All Rights Reserved