make toolchain path configurable 104/head
authorPaul Fertser <fercerpav@gmail.com>
Sat, 1 Oct 2016 16:46:25 +0000 (18:46 +0200)
committerOleksij Rempel <linux@rempel-privat.de>
Wed, 5 Oct 2016 16:43:18 +0000 (18:43 +0200)
this is needed to make it work with debian
cross-toolchain

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
target_firmware/configure

index 0106e40a7420376496b9dd1ccfd03340969efffe..e2d46396ad9baf33e20053cceccbb47d26317429 100755 (executable)
  # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ##
 
-TOOLCHAIN=$PWD/../toolchain/inst
-
 TARGET=xtensa-elf
-PREFIX="$TOOLCHAIN/bin/$TARGET-"
-TOOLCHAIN_FILE=$PWD/build/toolchain.cmake
+
+[ -z "$CROSS_COMPILE" ] &&
+    CROSS_COMPILE="$PWD/../toolchain/inst/bin/$TARGET-"
+
+TOOLCHAIN_FILE="$PWD/build/toolchain.cmake"
 
 set -e
 rm -rf build
 mkdir -p build
 
 cat > "$TOOLCHAIN_FILE" <<EOF
-INCLUDE(CMakeForceCompiler)
-
-SET(CMAKE_SYSTEM_PROCESSOR xtensa)
-SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN}/$TARGET)
-SET(CMAKE_STRIP :)
-
-CMAKE_FORCE_C_COMPILER(${PREFIX}gcc GNU)
+SET(CMAKE_SYSTEM_NAME Generic)
+SET(CMAKE_C_COMPILER  "${CROSS_COMPILE}gcc")
 EOF
 
 do_cmake() {
-       cmake -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE "$@"
+       cmake -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" "$@"
 }
 
 mkdir -p build/k2 build/magpie