]> git.zarvox.org Git - crbtree.git/blobdiff - autogen.sh
build: install-tree - move to $builddir
[crbtree.git] / autogen.sh
index d969f8d3e9c73af58d313f4f52190daa98be9833..704bd2c1cfb15cefba409d6f152457a50c43f468 100755 (executable)
@@ -1,24 +1,29 @@
-#!/bin/sh
-
+#!/bin/bash
 set -e
 
 oldpwd=$(pwd)
 topdir=$(dirname $0)
-cd $topdir
 
+cd $topdir
+mkdir -p ./build/m4/
 autoreconf --force --install --symlink
+cd $oldpwd
 
-if [ -f "$topdir/.config.args" ]; then
-        args="$args $(cat $topdir/.config.args)"
+# https://wiki.debian.org/Multiarch/Tuples
+if [[ "$HOSTTYPE" == "x86_64" ]]; then
+        ARCHITECTURE_TUPLE=x86_64-linux-gnu
+elif [[ "$HOSTTYPE" == "arm" ]]; then
+        ARCHITECTURE_TUPLE=arm-linux-gnueabihf
+else
+        echo "Unknown HOSTTYPE"
+        exit 1
 fi
 
-cd $oldpwd
-
-if [ "x$1" = "xc" ]; then
-        $topdir/configure --enable-debug $args
+if [[ "$1" == "b" ]]; then
+        $topdir/configure --prefix=/usr --libdir=/usr/lib/$ARCHITECTURE_TUPLE
         make clean
-elif [ "x$1" = "xl" ]; then
-        $topdir/configure CC=clang $args
+elif [[ "$1" = "c" ]]; then
+        $topdir/configure
         make clean
 else
         echo
@@ -26,6 +31,6 @@ else
         echo "Initialized build system. For a common configuration please run:"
         echo "----------------------------------------------------------------"
         echo
-        echo "$topdir/configure $args"
+        echo "$topdir/configure"
         echo
 fi