summaryrefslogtreecommitdiffstats
path: root/scripts/mkbinutilspec
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-10-20 15:29:12 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-10-20 15:29:12 +0000
commit10629f743599b259f03b74a376cf71f321469e0c (patch)
tree4b67b2b2b9a447bdd4613f96cd10649098c412b0 /scripts/mkbinutilspec
parentCommitting changes before Ralf's changed. (diff)
downloadrtems-10629f743599b259f03b74a376cf71f321469e0c.tar.bz2
New version from Ralf.
Diffstat (limited to 'scripts/mkbinutilspec')
-rw-r--r--scripts/mkbinutilspec62
1 files changed, 42 insertions, 20 deletions
diff --git a/scripts/mkbinutilspec b/scripts/mkbinutilspec
index 4ffcc77a5a..c6f4118320 100644
--- a/scripts/mkbinutilspec
+++ b/scripts/mkbinutilspec
@@ -1,32 +1,54 @@
#!/bin/sh
#
-# Usage: mktoolspec CPU
+# Usage: mkbinutilspec CPU
#
RTEMS_DIR=`dirname $0`
+CFG=user.cfg
+dst=/usr/src/packages/SPECS
+
+usage()
+{
+ echo "$0 [options] <target_alias>"
+ echo " options:"
+ echo " -cfg <user.cfg>"
+ echo " -o <rpm-spec-dir>"
+ exit 1 ;
+}
+
+while test $# -ge 2; do
+case $1 in
+-cfg)
+ shift
+ CFG=$1
+ shift
+ ;;
+-o)
+ shift
+ dst=$1
+ shift
+ ;;
+-*)
+ echo "invalid option $1";
+ usage
+ ;;
+esac
+done
+
+if test ! $# -eq 1;
+then
+ echo "Invalid number of arguments"
+ usage
+fi
+
+# target to build for
target_alias=$1
# RPM release number
rpm_release=0
-# binutils version number
-binutils_version=990901
-binutils_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
+. ./$CFG
specfile=${dst}/$target_alias-binutils-${binutils_version}.spec
@@ -34,7 +56,7 @@ sed -e "s%@Release@%${rpm_release}%g" \
-e "s%@target_alias@%${target_alias}%g" \
-e "s%@binutils_version@%${binutils_version}%g" \
-e "s%@binutils_patch_version@%${binutils_patch_version}%g" \
-< ${RTEMS_DIR}/binutils.spec.in \
+< ${RTEMS_DIR}/binutils/binutils.spec.in \
> ${specfile}
-echo Generated ${specfile}.
+echo Generated ${specfile}