source:
rtems/scripts/mkbinutilspec.in
@
3d36fe3d
Last change on this file since 3d36fe3d was 3d36fe3d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/29/02 at 07:55:49 | |
---|---|
|
|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[10629f7] | 1 | #!/bin/sh |
2 | # | |
3 | # Usage: mkbinutilspec CPU | |
4 | # | |
5 | ||
[43e7d103] | 6 | RTEMS_DIR=`dirname $0`/@top_srcdir@ |
[10629f7] | 7 | |
[43e7d103] | 8 | CFG=setup.cache |
[10629f7] | 9 | dst=@RPM_SPECSdir@ |
[0c602f0] | 10 | exe_ext=@EXEEXT@ |
[10629f7] | 11 | |
12 | usage() | |
13 | { | |
14 | echo "$0 [options] <target_alias>" | |
15 | echo " options:" | |
[43e7d103] | 16 | echo " -cfg <setup.cache>" |
[10629f7] | 17 | echo " -o <rpm-spec-dir>" |
18 | exit 1 ; | |
19 | } | |
20 | ||
21 | while test $# -ge 2; do | |
22 | case $1 in | |
23 | -cfg) | |
24 | shift | |
25 | CFG=$1 | |
26 | shift | |
27 | ;; | |
28 | -o) | |
29 | shift | |
30 | dst=$1 | |
31 | shift | |
32 | ;; | |
33 | -*) | |
34 | echo "invalid option $1"; | |
35 | usage | |
36 | ;; | |
37 | esac | |
38 | done | |
39 | ||
40 | if test ! $# -eq 1; | |
41 | then | |
42 | echo "Invalid number of arguments" | |
43 | usage | |
44 | fi | |
45 | ||
46 | # target to build for | |
47 | target_alias=$1 | |
48 | ||
49 | . ./$CFG | |
50 | ||
51 | specfile=${dst}/$target_alias-binutils-${binutils_version}.spec | |
52 | ||
[df1f734] | 53 | if test -n "${binutils_patch_version}"; then |
54 | PATCH1="Patch0: binutils-${binutils_version}-rtems-${binutils_patch_version}.diff" | |
[df2b589] | 55 | PATCH2="%patch0 -p0" |
[df1f734] | 56 | fi |
57 | ||
[64cc4bb5] | 58 | sed -e "s%@Release\@%${binutils_rpm_release}%g" \ |
[3d36fe3d] | 59 | -e "s,@rpm_build_root\@,${rpm_build_root},g" \ |
[64cc4bb5] | 60 | -e "s%@target_alias\@%${target_alias}%g" \ |
[4b3af7a4] | 61 | -e "s%@prefix\@%@prefix@%g" \ |
[64cc4bb5] | 62 | -e "s%@binutils_version\@%${binutils_version}%g" \ |
63 | -e "s%@binutils_patch_version\@%${binutils_patch_version}%g" \ | |
64 | -e "s%@exe_ext\@%${exe_ext}%g" \ | |
[df1f734] | 65 | -e "s,@PATCH1\@,${PATCH1}," \ |
66 | -e "s,@PATCH2\@,${PATCH2}," \ | |
[10629f7] | 67 | < ${RTEMS_DIR}/binutils/binutils.spec.in \ |
68 | > ${specfile} | |
69 | ||
70 | echo Generated ${specfile} |
Note: See TracBrowser
for help on using the repository browser.