[1805015] | 1 | #!/bin/sh |
---|
| 2 | # |
---|
| 3 | # Usage: mkgdbspec CPU |
---|
| 4 | # |
---|
| 5 | |
---|
[43e7d103] | 6 | RTEMS_DIR=`dirname $0`/@top_srcdir@ |
---|
| 7 | |
---|
| 8 | CFG=setup.cache |
---|
[1805015] | 9 | dst=@RPM_SPECSdir@ |
---|
[0c602f0] | 10 | exe_ext=@EXEEXT@ |
---|
[1805015] | 11 | |
---|
| 12 | usage() |
---|
[8ace612e] | 13 | { |
---|
[1805015] | 14 | echo "$0 [options] <target_alias>" |
---|
| 15 | echo " options:" |
---|
[43e7d103] | 16 | echo " -cfg <setup.cache>" |
---|
[1805015] | 17 | echo " -o <rpm-spec-dir>" |
---|
| 18 | exit 1 ; |
---|
[8ace612e] | 19 | } |
---|
[1805015] | 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 | |
---|
[8ace612e] | 49 | . ./$CFG |
---|
| 50 | |
---|
[e4b4a771] | 51 | specfile=${dst}/$target_alias-gdb-${gdb_version}.spec |
---|
| 52 | |
---|
[1479c22] | 53 | case ${target_alias} in |
---|
[c93fb2af] | 54 | arm* | d10v* | d30v* | erc32* | fr30* | h8300* | h8500* | hppa1.1* | \ |
---|
| 55 | i960* | m32r* | mcore* | mips* | mn10200* | mn10300* | sh* | sparc*| \ |
---|
| 56 | v850* | w65* | z8k*) |
---|
[06f2f75] | 57 | extra_configure_arguments="--enable-sim" |
---|
| 58 | ;; |
---|
[1479c22] | 59 | powerpc*) |
---|
| 60 | extra_configure_arguments="--enable-sim --enable-sim-powerpc --enable-sim-timebase --enable-sim-hardware" |
---|
| 61 | # Enabling this causes the program image to be huge and causes |
---|
| 62 | # some gcc/hosts combinations to run out of memory. |
---|
| 63 | # --enable-sim-inline |
---|
| 64 | ;; |
---|
| 65 | *) |
---|
| 66 | ;; |
---|
| 67 | esac |
---|
| 68 | |
---|
[64cc4bb5] | 69 | sed -e "s%@Release\@%${gdb_rpm_release}%g" \ |
---|
[620c972] | 70 | -e "s,@rpm_build_root\@,${rpm_build_root},g" \ |
---|
[64cc4bb5] | 71 | -e "s%@target_alias\@%${target_alias}%g" \ |
---|
| 72 | -e "s%@gdb_version\@%${gdb_version}%g" \ |
---|
| 73 | -e "s%@gdb_patch_version\@%${gdb_patch_version}%g" \ |
---|
| 74 | -e "s%@extra_configure_arguments\@%${extra_configure_arguments}%g" \ |
---|
| 75 | -e "s%@exe_ext\@%${exe_ext}%g" \ |
---|
[e4b4a771] | 76 | < ${RTEMS_DIR}/gdb/gdb.spec.in \ |
---|
[8ace612e] | 77 | > ${specfile} |
---|
[1805015] | 78 | |
---|
[1479c22] | 79 | case ${target_alias} in |
---|
[b471c035] | 80 | arm* | d10v* | d30v* | erc32* | fr30* | h8300* | h8500* | i960* | m32r* | \ |
---|
| 81 | mcore* | mips* | mn10200* | mn10300* | powerpc* | sh* | v850* | w65* | z8k*) |
---|
[0c602f0] | 82 | echo "/opt/rtems/bin/${target_alias}-run${exe_ext}" |
---|
[1805015] | 83 | ;; |
---|
| 84 | sparc*) |
---|
[0c602f0] | 85 | echo "/opt/rtems/bin/${target_alias}-run${exe_ext}" |
---|
| 86 | echo "/opt/rtems/bin/${target_alias}-sis${exe_ext}" |
---|
[1805015] | 87 | ;; |
---|
| 88 | *) ;; |
---|
[8ace612e] | 89 | esac >> ${specfile} |
---|
[1805015] | 90 | |
---|
[8ace612e] | 91 | echo Generated ${specfile} |
---|