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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [scripts/] [mkgcc3newlibspec.in] - Blame information for rev 1774

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

Line No. Rev Author Line
1 1026 ivang
#!/bin/sh
2
#
3
#  Usage: mktoolspec CPU
4
#
5
 
6
RTEMS_DIR=`dirname $0`/@top_srcdir@
7
 
8
CFG=setup.cache
9
dst=@RPM_SPECSdir@
10
exe_ext=@EXEEXT@
11
 
12
usage()
13
{
14
  echo "$0 [options] "
15
  echo "  options:"
16
  echo "    -cfg "
17
  echo "    -o "
18
  exit 1 ;
19
}
20
 
21
specsrc=${RTEMS_DIR}/gcc3newlib/gccnewlib.spec.in
22
 
23
while test $# -ge 2; do
24
case $1 in
25
-cfg)
26
  shift
27
  CFG=$1
28
  shift
29
  ;;
30
-o)
31
  shift
32
  dst=$1
33
  shift
34
  ;;
35
-a)        # alternate specs file
36
  shift
37
  specsrc=$1
38
  shift
39
  ;;
40
-*)
41
  echo "invalid option $1";
42
  usage
43
  ;;
44
esac
45
done
46
 
47
if test ! $# -eq 1;
48
then
49
  echo "Invalid number of arguments"
50
  usage
51
fi
52
 
53
# target to build for
54
target_alias=$1
55
 
56
. ./$CFG
57
 
58
specfile=${dst}/${target_alias}-gcc-${gcc3_version}-newlib-${gcc3newlib_version}.spec
59
 
60
patchn=-1
61
if test -n "${gcc3_patch_version}"; then
62
patchn=`expr $patchn + 1`
63
PATCH1="Patch${patchn}: gcc-${gcc3_version}-rtems-${gcc3_patch_version}.diff"
64
PATCH2="%patch${patchn} -p0"
65
fi
66
 
67
if test -n "${gcc3newlib_patch_version}"; then
68
patchn=`expr $patchn + 1`
69
PATCH3="Patch${patchn}: newlib-${gcc3newlib_version}-rtems-${gcc3newlib_patch_version}.diff"
70
PATCH4="%patch${patchn} -p0"
71
fi
72
 
73
# note that the variables in the gcc3newlib directory are actually the same
74
sed -e "s,@PATCH1\@,${PATCH1}," \
75
    -e "s,@PATCH2\@,${PATCH2}," \
76
    -e "s,@PATCH3\@,${PATCH3}," \
77
    -e "s,@PATCH4\@,${PATCH4}," \
78
    -e "s%@Release\@%${gcc3newlib_rpm_release}%g" \
79
    -e "s%@target_alias\@%${target_alias}%g" \
80
    -e "s%@prefix\@%@prefix@%g" \
81
    -e "s,@rpm_build_root\@,${rpm_build_root},g" \
82
    -e "s%@gcc_version\@%${gcc3_version}%g" \
83
    -e "s%@gcc_patch_version\@%${gcc3_patch_version}%g" \
84
    -e "s%@newlib_version\@%${gcc3newlib_version}%g" \
85
    -e "s%@newlib_patch_version\@%${gcc3newlib_patch_version}%g" \
86
    -e "s%@exe_ext\@%${exe_ext}%g" \
87
< ${specsrc} \
88
> ${specfile}
89
 
90
echo Generated ${specfile}.

powered by: WebSVN 2.1.0

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