OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [openrisc/] [arch/] [current/] [doc/] [build_or32_elf_tools.sh] - Blame information for rev 587

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
#!/bin/bash -x
2
 
3
# Checkout and build gnu toolchain for OpenRISC (or32 target)
4
 
5
# Usage:
6
# build_or32_elf_tools.sh [-c]
7
#   -c  Controls whether CVS checkout is done prior to build
8
#       You probably only want to use this command-line option the first time you build.
9
 
10
# Directory in which to checkout sources and build
11
BUILD_DIR=$HOME/or32-elf-src
12
 
13
# Target architecture/OS
14
TARGET=or32-elf
15
 
16
# Directory in which to put compiled files, exported headers, etc.
17
INSTALL_PREFIX=$HOME/tools/i386-redhat-linux
18
 
19
########################################################################
20
 
21
if [ $1foo = -cfoo ]; then DO_CVS_CHECKOUT=1; else DO_CVS_CHECKOUT=0; fi
22
 
23
#
24
# Some common variables
25
#
26
OK_STR="Build OK"
27
FAIL_STR="Build Failed"
28
 
29
mkdir -p $BUILD_DIR
30
cd $BUILD_DIR
31
 
32
#
33
# Start with binutils
34
#
35
if [ $DO_CVS_CHECKOUT != 0 ]; then
36
date > checkout_binutils.log 2>&1
37
cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d binutils or1k/binutils >> \
38
 checkout_binutils.log 2>&1
39
fi
40
 
41
mkdir -p b-b
42
cd b-b
43
date > ../build_binutils.log 2>&1
44
 
45
../binutils/configure --target=$TARGET --prefix=$INSTALL_PREFIX >> ../build_binutils.log 2>&1
46
 
47
make all install >> ../build_binutils.log 2>&1
48
BUILD_BINUTILS_STATUS=$?
49
export PATH=$INSTALL_PREFIX/bin:$PATH
50
cd ..
51
 
52
#
53
# Check if binutils was built and installed correctly
54
#
55
if [ $BUILD_BINUTILS_STATUS = 0 ]; then
56
        echo "$OK_STR (`date`)" >> build_binutils.log
57
else
58
        echo "$FAIL_STR (`date`)" >>  build_binutils.log
59
fi
60
 
61
#
62
# Build gdb
63
#
64
if [ $DO_CVS_CHECKOUT != 0 ]; then
65
date > checkout_gdb.log 2>&1
66
cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d gdb or1k/gdb-5.0 >> checkout_gdb.log 2>&1
67
fi
68
 
69
mkdir -p b-gdb
70
cd b-gdb
71
date > ../build_gdb.log 2>&1
72
# Current version of readline has a configuration bug, so you must not specify
73
# the prefix
74
#../gdb/configure --target=$TARGET --prefix=$INSTALL_PREFIX >> ../build_gdb.log 2>&1
75
../gdb/configure --target=$TARGET >> ../build_gdb.log 2>&1
76
make all >> ../build_gdb.log 2>&1
77
BUILD_GDB_STATUS=$?
78
cp gdb/gdb $INSTALL_PREFIX/bin/$TARGET-gdb
79
cd ..
80
 
81
 
82
#
83
# Check if gdb was built and installed correctly
84
#
85
if [ $BUILD_GDB_STATUS = 0 ]; then
86
        echo "$OK_STR (`date`)" >> build_gdb.log
87
else
88
        echo "$FAIL_STR (`date`)" >>  build_gdb.log
89
fi
90
 
91
#
92
# Build or1k simulator
93
#
94
if [ $DO_CVS_CHECKOUT != 0 ]; then
95
date > checkout_or1ksim.log 2>&1
96
cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d or1ksim or1k/or1ksim >> checkout_or1ksim.log 2>&1
97
fi
98
 
99
cd or1ksim
100
date > ../build_or1ksim.log 2>&1
101
../or1ksim/configure --target=$TARGET --prefix=$INSTALL_PREFIX >> ../build_or1ksim.log 2>&1
102
make all install >> ../build_or1ksim.log 2>&1
103
BUILD_OR1KSIM_STATUS=$?
104
cp sim $INSTALL_PREFIX/bin/or32-elf-sim
105
cd ..
106
 
107
#
108
# Check if or1ksim was built and installed correctly
109
#
110
if [ $BUILD_OR1KSIM_STATUS = 0 ]; then
111
        echo "$OK_STR (`date`)" >> build_or1ksim.log
112
else
113
        echo "$FAIL_STR (`date`)" >>  build_or1ksim.log
114
fi
115
 
116
# For now, bail here
117
#exit
118
 
119
#
120
# Build gcc
121
#
122
if [ $DO_CVS_CHECKOUT != 0 ]; then
123
date > checkout_gcc.log 2>&1
124
cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d gcc or1k/gcc-3.1 >> checkout_gcc.log 2>&1
125
fi
126
 
127
# The config script looks for libraries in a weird place.  Instead of figuring out what's wrong,
128
# I just placate it.
129
 
130
pushd $INSTALL_PREFIX
131
cp -pr lib $TARGET
132
popd
133
 
134
mkdir -p b-gcc
135
cd b-gcc
136
date > ../build_gcc.log 2>&1
137
../gcc/configure --target=$TARGET \
138
        --with-gnu-as --with-gnu-ld --verbose \
139
        --enable-threads --prefix=$INSTALL_PREFIX \
140
        --enable-languages="c,c++" >> ../build_gcc.log 2>&1
141
make all install >> ../build_gcc.log 2>&1
142
BUILD_GCC_STATUS=$?
143
 
144
#
145
# Check if gcc was built and installed correctly
146
#
147
if [ $BUILD_GCC_STATUS = 0 ]; then
148
        echo "$OK_STR (`date`)" >> build_gcc.log
149
else
150
        echo "$FAIL_STR (`date`)" >>  build_gcc.log
151
fi
152
 
153
# Install even though g++ build fails due to inability to build libg++ without C library.
154
# (How do we prevent building of libg++ ?)
155
make install
156
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.