From 59a2acf7509c2ddf54b9cf62eced739b11541ed9 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sat, 23 Aug 2014 18:03:00 -0400 Subject: [PATCH] Add targets definition files Clean code to configure OS, architecture and ABI --- functions/main | 37 +++++++++---------------------------- targets/arm926ejs | 6 ++++++ targets/default | 6 ++++++ targets/m68k | 3 +++ targets/x86 | 3 +++ targets/x86_64 | 5 +++++ 6 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 targets/arm926ejs create mode 100644 targets/default create mode 100644 targets/m68k create mode 100644 targets/x86 create mode 100644 targets/x86_64 diff --git a/functions/main b/functions/main index 357eb19..b92bf26 100644 --- a/functions/main +++ b/functions/main @@ -94,34 +94,15 @@ DEFAULT_IPKG_SCRIPT="ipkg.def" HVMAKE="make -j ${MAKEJOBS}" -case "${HVL_TARGET}" in - arm926*) - CLFS_BUILDFLAGS="-mabi=aapcs-linux -mfloat-abi=soft" - CLFS_TARGET="arm-linux-gnueabi" - CLFS_ARCH=arm - ;; - "x86_64") - CLFS_BUILDFLAGS="-m64" - CLFS_TARGET="${HVL_TARGET}-unknown-linux-gnu" - CLFS_ARCH=${HVL_TARGET} - ;; - "x86") - # No special flags - CLFS_BUILDFLAGS="" - CLFS_TARGET="i686-unknown-linux-gnu" - CLFS_ARCH=${HVL_TARGET} - ;; - m68k*) - #CLFS_BUILDFLAGS="-mcpu=51jm" - CLFS_BUILDFLAGS="" - CLFS_TARGET="${HVL_TARGET}-unknown-linux-gnu" - CLFS_ARCH=${HVL_TARGET} - ;; - *) - echo "Unsupported target architecture: ${HVL_TARGET}" - return ${EXIT_FAILURE} - ;; -esac +# Load default values. They can be overriden +# by a target-specific file +source ../targets/default + +if [ -f ../targets/${HVL_TARGET} ]; then + source ../targets/${HVL_TARGET} +fi + +CLFS_TARGET="${CLFS_ARCH}-${CLFS_OS}-${CLFS_ABI}" CLFS_HOST="$(echo $MACHTYPE | \ sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")" diff --git a/targets/arm926ejs b/targets/arm926ejs new file mode 100644 index 0000000..bade0e1 --- /dev/null +++ b/targets/arm926ejs @@ -0,0 +1,6 @@ +#!/bin/bash + +CLFS_BUILDFLAGS="-mabi=aapcs-linux -mfloat-abi=soft" +CLFS_ARCH=arm +CLFS_ABI="gnueabi" + diff --git a/targets/default b/targets/default new file mode 100644 index 0000000..a2be344 --- /dev/null +++ b/targets/default @@ -0,0 +1,6 @@ +#!/bin/bash + +CLFS_BUILDFLAGS="" +CLFS_ARCH=${HVL_TARGET} +CLFS_OS="linux" +CLFS_ABI="gnu" diff --git a/targets/m68k b/targets/m68k new file mode 100644 index 0000000..6bea319 --- /dev/null +++ b/targets/m68k @@ -0,0 +1,3 @@ +#!/bin/bash + +#CLFS_BUILDFLAGS="-mcpu=51jm" diff --git a/targets/x86 b/targets/x86 new file mode 100644 index 0000000..7a693aa --- /dev/null +++ b/targets/x86 @@ -0,0 +1,3 @@ +#!/bin/bash + + diff --git a/targets/x86_64 b/targets/x86_64 new file mode 100644 index 0000000..739bf95 --- /dev/null +++ b/targets/x86_64 @@ -0,0 +1,5 @@ +#!/bin/bash + +CLFS_BUILDFLAGS="-m64" +CLFS_OS="unknown-linux" + -- 2.20.1