summaryrefslogtreecommitdiff
path: root/build-0.3/system/configure
blob: 3c1b968ce6873e6c6cff18f116f733a874436781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#! /usr/bin/env bash

# file      : build/system/configure
# copyright : Copyright (c) 2004-2012 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