source: rtems/scripts/gcc3newlib/mkspec.in @ a81b432

4.104.114.84.95
Last change on this file since a81b432 was 4aba88a1, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/12/02 at 10:11:44

2002-08-12 Ralf Corsepius <corsepiu@…>

  • mkgcc3newlibspec.in: Remove
  • gcc3newlib/mkspec.in: New.
  • configure.ac: Reflect changes above.
  • gcc3newlib/gccnewlib.add: Add build_XXX defines. Add preliminary gnat support.
  • gcc3newlib/base-g77.add: Add build_g77.
  • gcc3newlib/base-gcj.add: Add build_gcj.
  • gcc3newlib/base-gnat.add: New.
  • gcc3newlib/target-c++.add: Add build_cxx.
  • gcc3newlib/target-g77.add: Add build_g77.
  • gcc3newlib/target-gcj.add: Add build_gcj.
  • gcc3newlib/target-objc.add: Add build_objc.
  • gcc3newlib/target-gnat.add: New.
  • gcc3newlib/Makefile.am: Use ./mkspec. Use unified spec.
  • Property mode set to 100644
File size: 1.6 KB
Line 
1#!/bin/sh
2#
3#  Usage: mktoolspec CPU
4#
5
6RTEMS_DIR=`dirname $0`/@top_srcdir@
7
8CFG=../setup.cache
9exe_ext=@EXEEXT@
10
11usage()
12{
13  echo "$0 [options] <target_alias>"
14  echo "  options:"
15  echo "    -cfg <setup.cache>"
16  echo "    -o <rpm-spec-dir>"
17  exit 1 ;
18}
19
20specsrc=${RTEMS_DIR}/gcc3newlib/gccnewlib.spec.in
21
22while test $# -ge 2; do
23case $1 in
24-cfg)
25  shift
26  CFG=$1
27  shift
28  ;;
29-a)        # alternate specs file
30  shift
31  specsrc=$1
32  shift
33  ;;
34-*)
35  echo "invalid option $1";
36  usage
37  ;;
38esac
39done
40
41if test ! $# -eq 1;
42then
43  echo "Invalid number of arguments"
44  usage
45fi
46
47# target to build for
48target_alias=$1
49
50. ./$CFG
51
52patchn=-1
53if test -n "${gcc3_patch_version}"; then
54patchn=`expr $patchn + 1`
55PATCH1="Patch${patchn}: gcc-${gcc3_version}-rtems-${gcc3_patch_version}.diff"
56PATCH2="%patch${patchn} -p0"
57fi
58
59if test -n "${gcc3newlib_patch_version}"; then
60patchn=`expr $patchn + 1`
61PATCH3="Patch${patchn}: newlib-${gcc3newlib_version}-rtems-${gcc3newlib_patch_version}.diff"
62PATCH4="%patch${patchn} -p0"
63fi
64
65# note that the variables in the gcc3newlib directory are actually the same
66sed -e "s,@PATCH1\@,${PATCH1}," \
67    -e "s,@PATCH2\@,${PATCH2}," \
68    -e "s,@PATCH3\@,${PATCH3}," \
69    -e "s,@PATCH4\@,${PATCH4}," \
70    -e "s%@Release\@%${gcc3newlib_rpm_release}%g" \
71    -e "s%@target_alias\@%${target_alias}%g" \
72    -e "s%@prefix\@%@prefix@%g" \
73    -e "s,@rpm_build_root\@,${rpm_build_root},g" \
74    -e "s%@gcc_version\@%${gcc3_version}%g" \
75    -e "s%@gcc_patch_version\@%${gcc3_patch_version}%g" \
76    -e "s%@newlib_version\@%${gcc3newlib_version}%g" \
77    -e "s%@newlib_patch_version\@%${gcc3newlib_patch_version}%g" \
78    -e "s%@exe_ext\@%${exe_ext}%g" \
79< ${specsrc}
Note: See TracBrowser for help on using the repository browser.