forked from Imagelibrary/rtems
Easier to insert tool version number.
This commit is contained in:
@@ -19,12 +19,12 @@ Provides: @target_alias@-gcc-newlib
|
|||||||
Autoreqprov: on
|
Autoreqprov: on
|
||||||
Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com
|
Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com
|
||||||
|
|
||||||
Version: @Version@
|
Version: gcc-@gcc_version@-newlib-@newlib_version@
|
||||||
Summary: rtems gcc and newlib C Library for target @target_alias@
|
Summary: rtems gcc and newlib C Library for target @target_alias@
|
||||||
Source0: gcc-2.95.1.tar.gz
|
Source0: gcc-@gcc_version@.tar.gz
|
||||||
Source1: newlib-1.8.2.tar.gz
|
Source1: newlib-@newlib_version@.tar.gz
|
||||||
Patch0: gcc-2.95.1-rtems-19991015.diff
|
Patch0: gcc-@gcc_version@-rtems-@gcc_patch_version@.diff
|
||||||
Patch1: newlib-1.8.2-rtems-19991015.diff
|
Patch1: newlib-@newlib_version@-rtems-@newlib_patch_version@.diff
|
||||||
|
|
||||||
Buildroot: /tmp
|
Buildroot: /tmp
|
||||||
# Patch:
|
# Patch:
|
||||||
@@ -39,22 +39,22 @@ Authors:
|
|||||||
...
|
...
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
# untar the sources inside @target_alias@-gcc-newlib -@Version@
|
# untar the sources inside @target_alias@-gcc-newlib
|
||||||
%setup -c -n @target_alias@-gcc-newlib -a 0 -a 1
|
%setup -c -n @target_alias@-gcc-newlib -a 0 -a 1
|
||||||
|
|
||||||
%patch0 -p0
|
%patch0 -p0
|
||||||
%patch1 -p0
|
%patch1 -p0
|
||||||
|
|
||||||
( cd gcc-2.95.1
|
( cd gcc-@gcc_version@
|
||||||
|
|
||||||
# Now link the C library into the source tree
|
# Now link the C library into the source tree
|
||||||
ln -s ../newlib-1.8.2/newlib .
|
ln -s ../newlib-@newlib_version@/newlib .
|
||||||
)
|
)
|
||||||
|
|
||||||
%build
|
%build
|
||||||
test -d build || mkdir build
|
test -d build || mkdir build
|
||||||
( cd build
|
( cd build
|
||||||
../gcc-2.95.1/configure --target=@target_alias@ \
|
../gcc-@gcc_version@/configure --target=@target_alias@ \
|
||||||
--with-gnu-as --with-gnu-ld --with-newlib --verbose \
|
--with-gnu-as --with-gnu-ld --with-newlib --verbose \
|
||||||
--prefix=/opt/rtems
|
--prefix=/opt/rtems
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ test -d build || mkdir build
|
|||||||
test -d $RPM_BUILD_ROOT/opt/rtems/@target_alias@/sys-include \
|
test -d $RPM_BUILD_ROOT/opt/rtems/@target_alias@/sys-include \
|
||||||
|| mkdir $RPM_BUILD_ROOT/opt/rtems/@target_alias@/sys-include
|
|| mkdir $RPM_BUILD_ROOT/opt/rtems/@target_alias@/sys-include
|
||||||
|
|
||||||
srclimits=../gcc-2.95.1/newlib/libc/sys/rtems/include/limits.h
|
srclimits=../gcc-@gcc_version@/newlib/libc/sys/rtems/include/limits.h
|
||||||
for dir in $RPM_BUILD_ROOT/opt/rtems/@target_alias@/include \
|
for dir in $RPM_BUILD_ROOT/opt/rtems/@target_alias@/include \
|
||||||
$RPM_BUILD_ROOT/opt/rtems/@target_alias@/sys-include
|
$RPM_BUILD_ROOT/opt/rtems/@target_alias@/sys-include
|
||||||
do
|
do
|
||||||
@@ -111,7 +111,7 @@ test -d build || mkdir build
|
|||||||
/opt/rtems/bin/@target_alias@-g++
|
/opt/rtems/bin/@target_alias@-g++
|
||||||
/opt/rtems/bin/@target_alias@-gcc
|
/opt/rtems/bin/@target_alias@-gcc
|
||||||
/opt/rtems/bin/@target_alias@-gcj
|
/opt/rtems/bin/@target_alias@-gcj
|
||||||
/opt/rtems/lib/gcc-lib/@target_alias@/2.95.1
|
/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@
|
||||||
/opt/rtems/@target_alias@/include*
|
/opt/rtems/@target_alias@/include*
|
||||||
/opt/rtems/@target_alias@/sys-include
|
/opt/rtems/@target_alias@/sys-include
|
||||||
/opt/rtems/@target_alias@/lib*
|
/opt/rtems/@target_alias@/lib*
|
||||||
|
|||||||
@@ -4,11 +4,19 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
RTEMS_DIR=`dirname $0`
|
RTEMS_DIR=`dirname $0`
|
||||||
RTEMS_VERSION=`grep Version ${RTEMS_DIR}/../VERSION | \
|
|
||||||
sed -e 's%RTEMS[ ]*Version[ ]*\(.*\)[ ]*%\1%g'`
|
|
||||||
|
|
||||||
target_alias=$1
|
target_alias=$1
|
||||||
release=0
|
|
||||||
|
# RPM release number
|
||||||
|
rpm_release=0
|
||||||
|
|
||||||
|
# gcc version number
|
||||||
|
gcc_version=2.95.1
|
||||||
|
gcc_patch_version=19991015
|
||||||
|
|
||||||
|
# newlib version number
|
||||||
|
newlib_version=1.8.2
|
||||||
|
newlib_patch_version=19991015
|
||||||
|
|
||||||
# Some linux distributions use /usr/src/packages
|
# Some linux distributions use /usr/src/packages
|
||||||
# redhat uses /usr/src/redhat
|
# redhat uses /usr/src/redhat
|
||||||
@@ -24,11 +32,14 @@ then
|
|||||||
dst=/usr/src/SPECS;
|
dst=/usr/src/SPECS;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -e "s%@Version@%${RTEMS_VERSION}%g" \
|
specfile=${dst}/$target_alias-gcc-${gcc_version}-newlib-${newlib_version}.spec
|
||||||
-e "s%@bsp@%${bsp}%g" \
|
sed -e "s%@Release@%${rpm_release}%g" \
|
||||||
-e "s%@Release@%${release}%g" \
|
-e "s%@target_alias@%${target_alias}%g" \
|
||||||
-e "s%@target_alias@%${target_alias}%g" \
|
-e "s%@gcc_version@%${gcc_version}%g" \
|
||||||
|
-e "s%@gcc_patch_version@%${gcc_patch_version}%g" \
|
||||||
|
-e "s%@newlib_version@%${newlib_version}%g" \
|
||||||
|
-e "s%@newlib_patch_version@%${newlib_patch_version}%g" \
|
||||||
< ${RTEMS_DIR}/gccnewlib.spec.in \
|
< ${RTEMS_DIR}/gccnewlib.spec.in \
|
||||||
> ${dst}/$target_alias-gcc_newlib.spec
|
> ${specfile}
|
||||||
|
|
||||||
echo Generated ${dst}/$target_alias-gcc_newlib.spec.
|
echo Generated ${specfile}.
|
||||||
|
|||||||
Reference in New Issue
Block a user