From a15cf65c44d5c224169c32ef5495b68c758134b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 18 May 2014 16:08:14 +0200 Subject: Imported Upstream version 3.3.0.2 --- build-0.3/system/configure | 138 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100755 build-0.3/system/configure (limited to 'build-0.3/system/configure') diff --git a/build-0.3/system/configure b/build-0.3/system/configure new file mode 100755 index 0000000..621a12a --- /dev/null +++ b/build-0.3/system/configure @@ -0,0 +1,138 @@ +#! /usr/bin/env bash + +# file : build/system/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2004-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# $1 out file +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +# Build system. +# + +build=`$bld_root/system/config.guess` + +if [ $? != 0 ]; then + + $echo "unable to determine build system type" + exit 1 +fi + +$echo "build system is $build" + +build_cpu=`echo $build | cut -f 1 -d -` +build_mf=`echo $build | cut -f 2 -d -` +build_kernel=`echo $build | cut -f 3 -d -` +build_os=`echo $build | cut -f 4 -d -` + +if [ -z "$build_os" ]; then + + # Old format: cpu-mf-os + # + build_os=$build_kernel + build_kernel= +fi + + +# Host system. +# + +if [ -n "$host_system" ]; then + + host=`$bld_root/system/config.sub "$host_system"` + + if [ $? != 0 ]; then + + $echo "unable to canonicalize host system '$host_system'" + exit 1 + fi +else + host=$build +fi + +$echo "host system is $host" + +host_cpu=`echo $host | cut -f 1 -d -` +host_mf=`echo $host | cut -f 2 -d -` +host_kernel=`echo $host | cut -f 3 -d -` +host_os=`echo $host | cut -f 4 -d -` + +if [ -z "$host_os" ]; then + + # Old format: cpu-mf-os + # + host_os=$host_kernel + host_kernel= +fi + + +# Target system. +# +if [ -n "$target_system" ]; then + + target=`$bld_root/system/config.sub "$target_system"` + + if [ $? != 0 ]; then + + $echo "unable to canonicalize target system '$target_system'" + exit 1 + fi + + $echo "target system is $target" + + target_cpu=`echo $target | cut -f 1 -d -` + target_mf=`echo $target | cut -f 2 -d -` + target_kernel=`echo $target | cut -f 3 -d -` + target_os=`echo $target | cut -f 4 -d -` + + if [ -z "$target_os" ]; then + + # Old format: cpu-mf-os + # + target_os=$target_kernel + target_kernel= + fi + +else +target= +target_cpu= +target_mf= +target_kernel= +target_os= +fi + + + +# Write the configuration out. +# +echo "system_configuration := y" >$1 +echo >>$1 +echo "build_system := $build" >>$1 +echo "build_cpu := $build_cpu" >>$1 +echo "build_manufacturer := $build_mf" >>$1 +echo "build_os := $build_os" >>$1 +echo "build_kernel := $build_kernel" >>$1 +echo >>$1 +echo "host_system := $host" >>$1 +echo "host_cpu := $host_cpu" >>$1 +echo "host_manufacturer := $host_mf" >>$1 +echo "host_os := $host_os" >>$1 +echo "host_kernel := $host_kernel" >>$1 +echo >>$1 +echo "target_system := $target" >>$1 +echo "target_cpu := $target_cpu" >>$1 +echo "target_manufacturer := $target_mf" >>$1 +echo "target_os := $target_os" >>$1 +echo "target_kernel := $target_kernel" >>$1 -- cgit v1.2.3