summaryrefslogtreecommitdiffstats
path: root/scripts/mkgccnewlibspec
blob: 172d905ca65c2577bb2de848f9292347f8373a5f (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
#!/bin/sh 
#
#  Usage: mktoolspec CPU
#

RTEMS_DIR=`dirname $0`

target_alias=$1

# RPM release number
rpm_release=0

# gcc version number
gcc_version=2.95.1
gcc_patch_version=19991015

# newlib version number
newlib_version=1.8.2
newlib_patch_version=19991015

# Some linux distributions use /usr/src/packages
# redhat uses /usr/src/redhat
# others might use /usr/src
if test -d /usr/src/packages/SPECS; 
then
dst=/usr/src/packages/SPECS;
elif test -d /usr/src/redhat/SPECS;
 then
dst=/usr/src/redhat/SPECS;
elif test -d /usr/src/SPECS/; 
then
dst=/usr/src/SPECS;
fi

specfile=${dst}/$target_alias-gcc-${gcc_version}-newlib-${newlib_version}.spec
sed -e "s%@Release@%${rpm_release}%g" \
    -e "s%@target_alias@%${target_alias}%g" \
    -e "s%@gcc_version@%${gcc_version}%g" \
    -e "s%@gcc_patch_version@%${gcc_patch_version}%g" \
    -e "s%@newlib_version@%${newlib_version}%g" \
    -e "s%@newlib_patch_version@%${newlib_patch_version}%g" \
< ${RTEMS_DIR}/gccnewlib.spec.in \
> ${specfile}

echo Generated ${specfile}.