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
diff --git a/tools/configure b/tools/configure
index 50b89dc..8b024be 100755
--- a/tools/configure
+++ b/tools/configure
@@ -46,6 +46,7 @@ findarmgcc() {
     prefixtools arm-elf-
     gccchoice="4.0.3"
   fi
+  extravars="export ARM_CORE=$ARM_CORE\nexport ARM_TDMI=${ARM_TDMI:-0}"
 }

 # scan the $PATH for the given command
@@ -251,6 +252,8 @@ coldfirecc () {
 }

 arm7tdmicc () {
+ ARM_CORE=7
+ ARM_TDMI=1
  findarmgcc
  GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
  if test "X$1" != "Xshort" -a "$ARG_ARM_EABI" != "1"; then
@@ -261,6 +264,8 @@ arm7tdmicc () {
 }

 arm9tdmicc () {
+ ARM_CORE=9
+ ARM_TDMI=1
  findarmgcc
  GCCOPTS="$CCOPTS -mcpu=arm9tdmi"
  if test "$modelname" != "gigabeatf" -a "$t_manufacturer" != "as3525" -a "$ARG_ARM_EABI" != "1"; then
@@ -271,6 +276,8 @@ arm9tdmicc () {
 }

 arm940tbecc () {
+ ARM_CORE=9
+ ARM_TDMI=0
  findarmgcc
  GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t"
  if test "ARG_ARM_EABI" != "1"; then
@@ -281,6 +288,8 @@ arm940tbecc () {
 }

 arm940tcc () {
+ ARM_CORE=9
+ ARM_TDMI=0
  findarmgcc
  GCCOPTS="$CCOPTS -mcpu=arm940t"
  if test "ARG_ARM_EABI" != "1"; then
@@ -291,6 +300,8 @@ arm940tcc () {
 }

 arm946cc () {
+ ARM_CORE=9
+ ARM_TDMI=0
  findarmgcc
  GCCOPTS="$CCOPTS -mcpu=arm9e"
  if test "ARG_ARM_EABI" != "1"; then
@@ -301,6 +312,8 @@ arm946cc () {
 }

 arm926ejscc () {
+ ARM_CORE=9
+ ARM_TDMI=0
  findarmgcc
  GCCOPTS="$CCOPTS -mcpu=arm926ej-s"
  if test "ARG_ARM_EABI" != "1"; then
@@ -311,6 +324,8 @@ arm926ejscc () {
 }

 arm1136jfscc () {
+ ARM_CORE=11
+ ARM_TDMI=0
  findarmgcc
  GCCOPTS="$CCOPTS -mcpu=arm1136jf-s"
  if test "$modelname" != "gigabeats" -a "ARG_ARM_EABI" != "1"; then
@@ -321,6 +336,8 @@ arm1136jfscc () {
 }

 arm1176jzscc () {
+ ARM_CORE=11
+ ARM_TDMI=0
  findarmgcc
  GCCOPTS="$CCOPTS -mcpu=arm1176jz-s"
  if test "ARG_ARM_EABI" != "1"; then
@@ -2938,6 +2955,7 @@ sed > Makefile \
  -e "s,@RBDIR@,${rbdir},g" \
  -e "s,@PREFIX@,$PREFIX,g" \
  -e "s,@CMDLINE@,$cmdline,g" \
+ -e "s*@EXTRA@*$extravars*g" \
 <<EOF
 ## Automatically generated. http://www.rockbox.org/

@@ -3002,6 +3020,7 @@ export ENC_OPTS=@ENC_OPTS@
 export ENCODER=@ENCODER@
 export USE_ELF=@USE_ELF@
 export RBDIR=@RBDIR@
+@EXTRA@

 CONFIGURE_OPTIONS=@CMDLINE@