]> git.mdlowis.com Git - proto/aardvark-linux.git/commitdiff
Changed name to aardvark linux
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 17 Jun 2015 02:28:08 +0000 (22:28 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 17 Jun 2015 02:28:08 +0000 (22:28 -0400)
.gitignore [new file with mode: 0644]
build.sh
config

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..b6c7eca
--- /dev/null
@@ -0,0 +1,2 @@
+tarballs/
+tools/
index 32cff52c501fee8736a6a063027903390af5670e..afc67a3d4847a7ca6a259cd7aca3ba691c39571a 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -7,12 +7,12 @@ set -e
 . ./config
 
 # Setup the path to use new tools as they become available
-export PATH=$LFS_TOOLS/bin:$PATH
+export PATH=$AL_TOOLS/bin:$PATH
 
 download(){
-    mkdir -p "$LFS_TARBALLS"
-    if [ ! -f "$LFS_TARBALLS/$1" ]; then
-        curl "$2/$1" > "$LFS_TARBALLS/$1"
+    mkdir -p "$AL_TARBALLS"
+    if [ ! -f "$AL_TARBALLS/$1" ]; then
+        curl "$2/$1" > "$AL_TARBALLS/$1"
     fi
 }
 
@@ -27,42 +27,55 @@ extract(){
 download binutils-2.25.tar.bz2 http://ftp.gnu.org/gnu/binutils/
 download cfe-3.6.1.src.tar.xz http://llvm.org/releases/3.6.1/
 download llvm-3.6.1.src.tar.xz http://llvm.org/releases/3.6.1/
+#download musl-1.1.10.tar.gz http://www.musl-libc.org/releases/
 
 # Extract the tarballs
-extract "$LFS_TARBALLS/binutils-2.25.tar.bz2" "$LFS_TARBALLS/binutils"
-extract "$LFS_TARBALLS/llvm-3.6.1.src.tar.xz" "$LFS_TARBALLS/llvm"
-extract "$LFS_TARBALLS/cfe-3.6.1.src.tar.xz" "$LFS_TARBALLS/llvm/tools/clang"
+extract "$AL_TARBALLS/binutils-2.25.tar.bz2" "$AL_TARBALLS/binutils"
+extract "$AL_TARBALLS/llvm-3.6.1.src.tar.xz" "$AL_TARBALLS/llvm"
+extract "$AL_TARBALLS/cfe-3.6.1.src.tar.xz" "$AL_TARBALLS/llvm/tools/clang"
 
 # Build binutils and install it in the tools prefix
-mkdir -p "$LFS_TARBALLS/binutils/build"
-cd "$LFS_TARBALLS/binutils/build"
+mkdir -p "$AL_TARBALLS/binutils/build"
+cd "$AL_TARBALLS/binutils/build"
 if [ ! -f Makefile ]; then
-    ../configure --disable-shared --with-sysroot --prefix="$LFS_TOOLS"
+    ../configure \
+       --prefix="$AL_TOOLS" \
+       --with-sysroot="$AL" \
+       --with-lib-path="$AL_TOOLS" \
+       --target="$AL_TGT" \
+       --disable-shared \
+       --disable-nls \
+       --disable-werror 
 fi
-if [ ! -f "$LFS_TOOLS/bin/ar" ]; then
+if [ ! -f "$AL_TOOLS/bin/ar" ]; then
     make
     make install
 fi
-cd $LFS
+cd $AL
 
 # Test that the new linker works
 echo 'int main(int argc, char** argv) { return 0; }' > test.c
-cc -o test test.c
+gcc -o test test.c
 rm test test.c
+which ld
 
 # Build clang and install it in the
-mkdir -p "$LFS_TARBALLS/llvm/build"
-cd "$LFS_TARBALLS/llvm/build"
+mkdir -p "$AL_TARBALLS/llvm/build"
+cd "$AL_TARBALLS/llvm/build"
 if [ ! -f Makefile ]; then
-    cmake -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$LFS_TOOLS" ../
+    cmake -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$AL_TOOLS" -DBUILD_SHARED_LIBS=OFF ../
 fi
-if [ ! -f "$LFS_TOOLS/bin/clang" ]; then
+if [ ! -f "$AL_TOOLS/bin/clang" ]; then
     make clang
     make install
 fi
 
-# Test that the new clang binary works
-echo 'int main(int argc, char** argv) { return 0; }' > test.c
-clang -o test test.c
-rm test test.c
-
+## Test that the new clang binary works
+#echo 'int main(int argc, char** argv) { return 0; }' > test.c
+#clang -o test test.c
+#if [ "0" -ne "`readelf -d test | grep -c '0x'`" ]; then
+#    echo "Expected toolchain to compile statically but target was dynamically linked."
+#    exit 1
+#else
+#    rm test test.c
+#fi
diff --git a/config b/config
index 642d78b5c2becbee38bbec00c8dd70386686e396..7dba491c4abc9cf6cc5b7e7135a280bf63a20826 100644 (file)
--- a/config
+++ b/config
@@ -1,4 +1,11 @@
+# Define the target triplet to distinguish it from the host toolchain
+export AL_TGT=$(uname -m)-aardvark-linux-gnu
 
-export LFS=$PWD
-export LFS_TOOLS=$LFS/tools
-export LFS_TARBALLS=$LFS/tarballs
+# Define a variable to point to the root of the project
+export AL=$PWD
+
+# Variable point to the toolchain directory
+export AL_TOOLS=$AL/tools
+
+# Variable pointing to the tarballs directory
+export AL_TARBALLS=$AL/tarballs