2003-01-30 Ralf Corsepius <corsepiu@faw.uni-ulm.de>

* binutils/mkspec.in: New.
	* binutils/.cvsignore: Add mkspec.
	* mkbinutilspec.in: Remove.
	* gdb/Makefile.am: Depend on mkspec.
	* binutils/binutils.add: Add @exe_ext@ to c++filt.
	Add %_defaultbuildroot.
	* configure.ac: Reflect changes above.
This commit is contained in:
Ralf Corsepius
2003-01-30 10:21:40 +00:00
parent 00b8107cce
commit b601e1a44e
6 changed files with 28 additions and 18 deletions

View File

@@ -3,3 +3,4 @@ Makefile
Makefile.in
binutils.spec
binutils.spec.in
mkspec

View File

@@ -7,6 +7,7 @@
#
%define _prefix @prefix@
%define _defaultbuildroot %{_tmppath}/%{name}-%{version}
Vendor: OAR Corporation
Distribution: Linux
@@ -16,10 +17,10 @@ Group: rtems
Release: @Release@
License: GPL/LGPL
Autoreqprov: off
Autoreqprov: on
Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com
Prefix: %{_prefix}
BuildRoot: %{_tmppath}/@target_alias@-binutils
BuildRoot: %{_defaultbuildroot}
BuildPreReq: /sbin/install-info
BuildPreReq: texinfo >= 4.2
@@ -74,7 +75,7 @@ This is binutils sources with patches for RTEMS.
../binutils-@binutils_version@/mkinstalldirs \
$RPM_BUILD_ROOT%{_prefix}/share/locale
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/@target_alias@-c++filt
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/@target_alias@-c++filt@exe_ext@
# gzip info files
gzip -9qf $RPM_BUILD_ROOT%{_prefix}/info/*.info 2>/dev/null
gzip -9qf $RPM_BUILD_ROOT%{_prefix}/info/*.info-* 2>/dev/null
@@ -97,6 +98,6 @@ This is binutils sources with patches for RTEMS.
%clean
# let rpm --clean remove BuildRoot iif using the default BuildRoot
test "$RPM_BUILD_ROOT" = "%{_tmppath}/@target_alias@-binutils" && \
test "$RPM_BUILD_ROOT" = "%{_defaultbuildroot}" && \
rm -rf $RPM_BUILD_ROOT

View File

@@ -0,0 +1,68 @@
#!/bin/sh
#
# Usage: mkspec CPU
#
RTEMS_DIR=`dirname $0`/@top_srcdir@
CFG=../setup.cache
exe_ext=@EXEEXT@
specsrc=${RTEMS_DIR}/binutils/binutils.spec.in
usage()
{
echo "$0 [options] <target_alias>"
echo " options:"
echo " -cfg <setup.cache>"
echo " -a <alternate specs.in>"
exit 1 ;
}
while test $# -ge 2; do
case $1 in
-cfg)
shift
CFG=$1
shift
;;
-a)
shift
specsrc=$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
. ./$CFG
if test -n "${binutils_patch_version}"; then
PATCH1="Patch0: binutils-${binutils_version}-rtems-${binutils_patch_version}.diff"
PATCH2="%patch0 -p0"
fi
sed -e "s%@Release\@%${binutils_rpm_release}%g" \
-e "s,@rpm_build_root\@,${rpm_build_root},g" \
-e "s%@target_alias\@%${target_alias}%g" \
-e "s%@build_alias\@%@build_alias@%g" \
-e "s%@host_alias\@%@host_alias@%g" \
-e "s%@prefix\@%@prefix@%g" \
-e "s%@binutils_version\@%${binutils_version}%g" \
-e "s%@binutils_patch_version\@%${binutils_patch_version}%g" \
-e "s%@exe_ext\@%${exe_ext}%g" \
-e "s,@PATCH1\@,${PATCH1}," \
-e "s,@PATCH2\@,${PATCH2}," \
< ${specsrc}