]> git.mdlowis.com Git - proto/aardvark-linux.git/commitdiff
checkpoint commit
authorMike D. Lowis <mike.lowis@gentex.com>
Thu, 3 Sep 2015 20:35:04 +0000 (16:35 -0400)
committerMike D. Lowis <mike.lowis@gentex.com>
Thu, 3 Sep 2015 20:35:04 +0000 (16:35 -0400)
config.sh
scripts/build-chroot.sh [new file with mode: 0755]
scripts/build-toolchain.sh [new file with mode: 0755]
toolchain-config.sh [moved from musl-cross-config.sh with 96% similarity]

index c683129ec06a249ec7bdfb993c0dbd248f317bc9..73ee7239a339cfafdbc9e02650b53e67807151d0 100644 (file)
--- a/config.sh
+++ b/config.sh
@@ -22,10 +22,24 @@ export AL_TARBALLS=$AL/tarballs
 # Variable pointing to the sources directory
 export AL_SOURCES=$AL/sources
 
+export AL_TGT=$(uname -m)-linux-musl
+
 ###############################################################################
 # Build Environment Settings
 ###############################################################################
 
 # Setup the path to use the cross-tools when they're available
-export PATH=$AL_ROOT/tools/$(uname -m)-linux-musl/bin:$PATH
+export PATH=$AL_ROOT/tools/$AL_TGT/bin:$PATH
+
+export CC=$AL_TGT-gcc
+export CXX=$AL_TGT-g++
+export AR=$AL_TGT-ar
+export AS=$AL_TGT-as
+export LD=$AL_TGT-ld
+export RANLIB=$AL_TGT-ranlib
+export READELF=$AL_TGT-readelf
+export STRIP=$AL_TGT-strip
+
+export CFLAGS="-static"
+export LDFLAGS="-static"
 
diff --git a/scripts/build-chroot.sh b/scripts/build-chroot.sh
new file mode 100755 (executable)
index 0000000..2078601
--- /dev/null
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+###############################################################################
+# Configuration Settings
+###############################################################################
+
+# Turn off command hashing and make the script exit when a command errors.
+set -e
+
+# Load the config settings
+. ./config.sh
+
+# Make sure CFLAGS isnt set
+unset CFLAGS
+
+###############################################################################
+# Helper Functions
+###############################################################################
+fetch(){
+    if [ ! -d "$3" ]; then
+        mkdir -p "$AL_TARBALLS"
+        if [ ! -f "$AL_TARBALLS/$1" ]; then
+            echo curl -L --retry 5 "$2/$1" > "$AL_TARBALLS/$1"
+            curl -L --retry 5 "$2/$1" > "$AL_TARBALLS/$1"
+        fi
+        mkdir -p "$3"
+        tar -xvf "$AL_TARBALLS/$1" -C "$3" --strip-components 1
+    fi
+}
+
+gitclone(){
+    if [ ! -d "$2" ]; then
+        git clone --depth 1 $1 $2
+    fi
+}
+
+###############################################################################
+# Fetch Dependencies
+###############################################################################
+gitclone http://git.suckless.org/sbase "$AL_SOURCES/sbase"
+gitclone http://git.suckless.org/ubase "$AL_SOURCES/ubase"
+fetch dash-0.5.8.tar.gz http://gondor.apana.org.au/~herbert/dash/files/ "$AL_SOURCES/dash"
+
+###############################################################################
+# Install Base Software
+###############################################################################
+cd "$AL_SOURCES/sbase"
+make CC=$CC CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS -j8
+make PREFIX=$AL_ROOT install
+cd "$AL"
+
+#cd "$AL_SOURCES/ubase"
+#make CC=$CC CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS -j8
+#make PREFIX=$AL_ROOT install
+#cd "$AL"
+
+cd "$AL_SOURCES/dash"
+./configure --prefix=$AL_ROOT
+make -j8
+make install
+cd $AL
+
diff --git a/scripts/build-toolchain.sh b/scripts/build-toolchain.sh
new file mode 100755 (executable)
index 0000000..a5a5068
--- /dev/null
@@ -0,0 +1,34 @@
+
+#!/bin/sh
+
+###############################################################################
+# Configuration Settings
+###############################################################################
+
+# Turn off command hashing and make the script exit when a command errors.
+set -e
+
+# Load the config settings
+. ./config.sh
+
+# Make sure CFLAGS isnt set
+unset CFLAGS
+
+###############################################################################
+# Helper Functions
+###############################################################################
+gitclone(){
+    if [ ! -d "$2" ]; then
+        git clone --depth 1 $1 $2
+    fi
+}
+
+###############################################################################
+# Build the Cross-Compiler
+###############################################################################
+gitclone https://github.com/sabotage-linux/musl-cross.git "$AL_SOURCES/musl-cross"
+cp toolchain-config.sh "$AL_SOURCES/musl-cross/config.sh"
+cd "$AL_SOURCES/musl-cross"
+./build.sh
+cd "$AL"
+
similarity index 96%
rename from musl-cross-config.sh
rename to toolchain-config.sh
index 6e492f6031a6257ee2e2aca27812349d175b1feb..9063fda41157d98b14c375ce82c8e4d9b2153761 100644 (file)
@@ -6,7 +6,7 @@
 MAKEFLAGS=-j8
 
 # Tell the build scripts where the cross compiler should go
-CC_BASE_PREFIX="../../root/tools/"
+CC_BASE_PREFIX="$PWD/../../root/tools/"
 
 # If you use arm, you may need more fine-tuning:
 # arm hardfloat v7