📄 buildtoolchain
字号:
#!/bin/bash# buildtoolchain v1.21 10/15/02# www.embeddedlinuxinterfacing.com## The original location of this script is# http://www.embeddedlinuxinterfacing.com/chapters/03/buildtoolchain## Copyright (C) 2001 by Craig Hollabaugh## This program is free software; you can redistribute it and/or modify it under# the terms of the GNU Library General Public License as published by the Free# Software Foundation; either version 2 of the License, or (at your option) any# later version.## This program is distributed in the hope that it will be useful, but WITHOUT# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more# details.## You should have received a copy of the GNU Library General Public License# along with this program; if not, write to the Free Software Foundation, Inc.,# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA### Files needed and source locations# binutils ftp://ftp.gnu.org/gnu/binutils/ # kernel ftp://ftp.kernel.org/pub/linux/kernel# gcc ftp://ftp.gnu.org/pub/gnu/gcc/# glibc ftp://ftp.gnu.org/pub/gnu/glibc/# glibc-linuxthreads ftp://ftp.gnu.org/pub/gnu/glibc/# gdb ftp://ftp.gnu.org/pub/gnu/gdb/# ftp://sources.redhat.com/pub/gdb/old-releases/## ARM specific patches# Toolchain ftp://ftp.armlinux.org/pub/toolchain# Kernel ftp://ftp.arm.linux.org.uk/pub/armlinux/source/kernel-patches/# Kernel ftp://ftp.netwinder.org/users/n/nico/### references# The GNU Toolchain for ARM targets HOWTO# http://www.armlinux.org/docs/toolchain/# The Linux for PowerPC Embedded Systems HOWTO# http://penguinppc.org/embedded/howto/PowerPC-Embedded-HOWTO.html# Bill Gatliff's Cross GNU FAQ# http://crossgcc.billgatliff.com## Change Log## v0.5 # a. added $SRCFILELOC to filenames in Step 1 # b. made helloworld.c do a little counting# c. now saving linux/.config in tmp then restoring in Step 5## v0.6# a. changed clean to remove# b. fixed *PATCH being undefined and file check for it## v0.7# a. split steps into files, so you can tinker in middle and not# have to start over from the beginning# b. added targetboard in step5, this keeps you from running make menuconfig# c. added KERNELPATCH3 for arm mediaengine needs 3 patches# d. kernel patches are now done in the linux directory with patch -p1## v0.8# a. added wgets to step01 to get sources except for patches (arch dependent)# b. changed command line parameter ppc to powerpc## v0.9# a. gdb v5.0 is no longer available from gnu.org, need to get it from redhat# We need v5.0 because the gdbserver from montavista's rpm is v5.0 # b. added path to the step calls below## v1.2# a. step 5 now works with linux kernel source directories that are named# like linux-2.4.19# b. buildtoolchain now uses tee to write an output file for the build# c. step 6 uses Gatliff's bootstrap --without-headers --with-newlib # see crossgcc.billgatliff.com# d. added beeps to end of steps# e. output files are now created for each step# f. tail -f output-build-status will tell you where you in the build process# g. added --passive-ftp to wgets# # v1.21# a. all wgets come from embeddedlinuxinterfacing.com#set -erm -rf output-step* . ./buildtoolchain-environment $1date "+%x %X - Started: buildtoolchain $BTVERSION" > $SRCFILELOC/output-build-statusdate "+%x %X - Started: buildtoolchain $BTVERSION"./buildtoolchain-step01-check 2>&1 | tee output-step01-check./buildtoolchain-step02-clean 2>&1 | tee output-step02-clean ./buildtoolchain-step03-makebuilddirectories 2>&1 | tee output-step03-makebuilddirectories./buildtoolchain-step04-binutils 2>&1 | tee output-step04-binutils./buildtoolchain-step05-kernelsourceheaders 2>&1 | tee output-step05-kernelsourceheaders ./buildtoolchain-step06-gcc 2>&1 | tee output-step06-gcc./buildtoolchain-step07-glibc 2>&1 | tee output-step07-glibc./buildtoolchain-step08-gdb 2>&1 | tee output-step08-gdb./buildtoolchain-step09-gccversion 2>&1 | tee output-step09-gccversion./buildtoolchain-step10-helloworld 2>&1 | tee output-step10-helloworld./buildtoolchain-step11-rebuildgcc 2>&1 | tee output-step11-rebuildgcc./buildtoolchain-step12-rebuildglibc 2>&1 | tee output-step12-rebuildglibc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -