mirror of
https://bitbucket.org/gwenhael/cubietruck-slackware.git
synced 2024-11-16 19:50:31 +01:00
don't setup cross-compiler if COMPILE=false or ARCH is ARM
This commit is contained in:
parent
21d0967043
commit
2a8768d10c
2 changed files with 28 additions and 24 deletions
2
TODO.org
2
TODO.org
|
@ -3,7 +3,7 @@
|
|||
* TODO [#A] offer pre-built binaries
|
||||
* TODO [#A] configure by passing --parameters
|
||||
* TODO [#A] reinstall mpfr and/or aaa_elflids to fix missing libmpfr...so
|
||||
* TODO [#B] allow for running on ARM host
|
||||
* DONE [#B] UNTESTED allow for running on ARM host
|
||||
* TODO [#B] build rootfs from slackwarearm-current
|
||||
ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-devtools/minirootfs/scripts/
|
||||
* TODO [#B] compile out-of-tree
|
||||
|
|
50
build.sh
50
build.sh
|
@ -2,8 +2,12 @@
|
|||
|
||||
set -e
|
||||
|
||||
# Requires root ..
|
||||
if [ "$UID" -ne 0 ]; then
|
||||
echo "Please run as root"
|
||||
fi
|
||||
|
||||
# --- Configuration -------------------------------------------------------------
|
||||
#change to your needs
|
||||
IMG_NAME=${IMG_NAME:-"SlackwareARM_cubitruck"}
|
||||
VERSION=${VERSION:-0.2}
|
||||
COMPILE=${COMPILE:-"true"}
|
||||
|
@ -20,31 +24,31 @@ CWD=$(pwd)
|
|||
|
||||
mkdir -p $DEST
|
||||
|
||||
#Requires root ..
|
||||
if [ "$UID" -ne 0 ]; then
|
||||
echo "Please run as root"
|
||||
fi
|
||||
|
||||
echo "Building Cubietruck-Slackware in $DEST from $CWD"
|
||||
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "Downloading necessary files for building - aka Toolchain"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
#Read this for further information if you run into problems with gcc compiler
|
||||
#http://linux-sunxi.org/Toolchain
|
||||
if [ ! -e $PWD/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux/ ]; then
|
||||
[ ! -e $CWD/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux.tar.xz ] && wget -c https://launchpadlibrarian.net/$TOOLCHAIN_URL_RANDOM_NUMBER/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux.tar.xz -O $CWD/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux.tar.xz
|
||||
tar xf $CWD/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux.tar.xz
|
||||
fi
|
||||
|
||||
CROSS_COMPILE=$PWD/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux/bin/arm-linux-gnueabihf-
|
||||
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "Clone / Pull sources and patch"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
mkdir -p $DEST/output
|
||||
|
||||
if [ "$COMPILE" = "true" ]; then
|
||||
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "Downloading necessary files for building - aka Toolchain"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
if $(uname -m | grep -q arm); then
|
||||
CROSS_COMPILE=''
|
||||
else
|
||||
#Read this for further information if you run into problems with gcc compiler
|
||||
#http://linux-sunxi.org/Toolchain
|
||||
if [ ! -e $PWD/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux/ ]; then
|
||||
[ ! -e $CWD/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux.tar.xz ] && wget -c https://launchpadlibrarian.net/$TOOLCHAIN_URL_RANDOM_NUMBER/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux.tar.xz -O $CWD/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux.tar.xz
|
||||
tar xf $CWD/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux.tar.xz
|
||||
fi
|
||||
|
||||
CROSS_COMPILE=$PWD/gcc-linaro-arm-linux-gnueabihf-${TOOLCHAIN_VERSION}_linux/bin/arm-linux-gnueabihf-
|
||||
fi
|
||||
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "Clone / Pull sources and patch"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
mkdir -p $DEST/output
|
||||
|
||||
# Boot loader
|
||||
if [ -d "$DEST/u-boot-sunxi" ]; then
|
||||
( cd $DEST/u-boot-sunxi;
|
||||
|
|
Loading…
Reference in a new issue