2002-08-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>

* 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.
This commit is contained in:
Ralf Corsepius
2002-08-12 10:11:44 +00:00
parent f471a45c84
commit 4aba88a119
13 changed files with 157 additions and 45 deletions

View File

@@ -2,18 +2,20 @@
## $Id$
##
MKGCCNEWLIBSPEC = $(SHELL) $(top_builddir)/mkgcc3newlibspec
MKSPEC = $(SHELL) ./mkspec
SUBPACKAGES = gccnewlib.add \
base-gcc.add target-gcc.add \
base-g77.add target-g77.add \
base-gcj.add target-gcj.add \
target-objc.add \
target-c++.add
target-c++.add \
base-gnat.add target-gnat.add
noinst_DATA = gccnewlib.spec.in gccnewlib_c_only.spec.in
gccnewlib.spec.in: $(SUBPACKAGES)
cat $^ \
| sed -e 's%@GCCLANGS@%%g' > $@
cat $^ > $@
CLEANFILES = gccnewlib.spec.in
gccnewlib_c_only.spec.in: gccnewlib.add base-gcc.add target-gcc.add \
@@ -29,55 +31,60 @@ MKGCCNEWLIBSPEC_DEPS = $(top_builddir)/mkgcc3newlibspec gccnewlib.spec.in \
MKGCCNEWLIB_C_ONLY_SPEC_DEPS = $(top_builddir)/mkgcc3newlibspec \
gccnewlib_c_only.spec.in $(top_builddir)/setup.cache
RPM_SPECS_DATA =
arm-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . arm-rtems
$(MKSPEC) -cfg $(top_builddir)/setup.cache arm-rtems > $@
RPM_SPECS_DATA += arm-rtems-$(GCC3NEWLIBVERS).spec
c4x-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIB_C_ONLY_SPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . c4x-rtems
$(MKSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache c4x-rtems > $@
RPM_SPECS_DATA += c4x-rtems-$(GCC3NEWLIBVERS).spec
h8300-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIB_C_ONLY_SPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . h8300-rtems
h8300-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKSPEC) -cfg $(top_builddir)/setup.cache h8300-rtems > $@
RPM_SPECS_DATA += h8300-rtems-$(GCC3NEWLIBVERS).spec
hppa1.1-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . hppa1.1-rtems
$(MKSPEC) -cfg $(top_builddir)/setup.cache hppa1.1-rtems > $@
RPM_SPECS_DATA += hppa1.1-rtems-$(GCC3NEWLIBVERS).spec
i386-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . i386-rtems
$(MKSPEC) -cfg $(top_builddir)/setup.cache i386-rtems > $@
RPM_SPECS_DATA += i386-rtems-$(GCC3NEWLIBVERS).spec
i960-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIB_C_ONLY_SPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . i960-rtems
i960-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKSPEC) -cfg $(top_builddir)/setup.cache i960-rtems > $@
RPM_SPECS_DATA += i960-rtems-$(GCC3NEWLIBVERS).spec
m68k-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . m68k-rtems
$(MKSPEC) -cfg $(top_builddir)/setup.cache m68k-rtems > $@
RPM_SPECS_DATA += m68k-rtems-$(GCC3NEWLIBVERS).spec
mips64orion-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . mips64orion-rtems
$(MKSPEC) -cfg $(top_builddir)/setup.cache mips64orion-rtems > $@
RPM_SPECS_DATA += mips64orion-rtems-$(GCC3NEWLIBVERS).spec
mips-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . mips-rtems
$(MKSPEC) -cfg $(top_builddir)/setup.cache mips-rtems > $@
RPM_SPECS_DATA += mips-rtems-$(GCC3NEWLIBVERS).spec
powerpc-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . powerpc-rtems
$(MKSPEC) -cfg $(top_builddir)/setup.cache powerpc-rtems > $@
RPM_SPECS_DATA += powerpc-rtems-$(GCC3NEWLIBVERS).spec
sh-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . sh-rtems
$(MKSPEC) -cfg $(top_builddir)/setup.cache sh-rtems > $@
RPM_SPECS_DATA += sh-rtems-$(GCC3NEWLIBVERS).spec
sh-rtemself-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . sh-rtemself
$(MKSPEC) -cfg $(top_builddir)/setup.cache sh-rtemself > $@
RPM_SPECS_DATA += sh-rtemself-$(GCC3NEWLIBVERS).spec
sparc-rtems-$(GCC3NEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) $(C_ONLY_ARG) -cfg $(top_builddir)/setup.cache -o . sparc-rtems
$(MKSPEC) -cfg $(top_builddir)/setup.cache sparc-rtems > $@
RPM_SPECS_DATA += sparc-rtems-$(GCC3NEWLIBVERS).spec
RPM_SPECS_DATA = \
arm-rtems-$(GCC3NEWLIBVERS).spec \
c4x-rtems-$(GCC3NEWLIBVERS).spec \
h8300-rtems-$(GCC3NEWLIBVERS).spec \
hppa1.1-rtems-$(GCC3NEWLIBVERS).spec \
i386-rtems-$(GCC3NEWLIBVERS).spec i960-rtems-$(GCC3NEWLIBVERS).spec \
m68k-rtems-$(GCC3NEWLIBVERS).spec \
mips-rtems-$(GCC3NEWLIBVERS).spec mips64orion-rtems-$(GCC3NEWLIBVERS).spec \
powerpc-rtems-$(GCC3NEWLIBVERS).spec sh-rtems-$(GCC3NEWLIBVERS).spec \
sh-rtemself-$(GCC3NEWLIBVERS).spec sparc-rtems-$(GCC3NEWLIBVERS).spec
CLEANFILES += $(RPM_SPECS_DATA)
EXTRA_DIST = $(SUBPACKAGES)

View File

@@ -1,3 +1,4 @@
%if %build_g77
# ==============================================================
# rtems-base-g77
# ==============================================================
@@ -40,3 +41,4 @@ This is the files for gcc/g77 that are shared by all targets.
done
fi
%endif

View File

@@ -1,3 +1,4 @@
%if %build_gcj
# ==============================================================
# rtems-base-gcj
# ==============================================================
@@ -18,3 +19,4 @@ This is the files for gcc/java (gcj) that are shared by all targets.
%{_prefix}/bin/jv-scan@exe_ext@
%{_prefix}/bin/gcjh@exe_ext@
%endif

View File

@@ -0,0 +1,18 @@
%if %build_gnat
# ==============================================================
# base-gnat
# ==============================================================
%package -n base-gnat
Provides: base-gnat
Summary: gcc/gnat tools
Group: rtems
%description -n base-gnat
RTEMS is an open source operating system for embedded systems.
This is the gcc/gnat tools for the gcc/gnat compiler
%files -n base-gnat
%dir %{_prefix}/bin
%{_prefix}/bin/gnat*
%endif

View File

@@ -43,6 +43,26 @@ Buildroot: %{_tmppath}/%{name}
NoSource: 0
NoSource: 1
%define build_cxx 1
%define build_g77 0
%define build_objc 0
%define build_gcj 0
%define build_gnat 0
%if "@target_alias@" == "c4x-rtems"
%define build_gnat 0
%define build_cxx 0
%elseif "@target_alias@" == "i386-rtems"
%define build_gnat 1
%elseif "@target_alias@" == "i960-rtems"
%define build_gnat 0
%define build_cxx 0
%elseif "@target_alias@" == "powerpc-rtems"
%define build_gnat 1
%elseif "@target_alias@" == "sparc-rtems"
%define build_gnat 1
%endif
%description
RTEMS is an open source operating system for embedded systems.
@@ -82,12 +102,38 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
# CONFIGURE_ARGS="--build=%{_build} --host=%{_target}"
# %endif
languages="c,c++"
%if %build_g77
languages="$languages,g77"
%endif
%if %build_gcj
languages="$languages,gcj"
%endif
%if %build_objc
languages="$languages,objc"
%endif
%if %build_gnat
languages="$languages,ada"
%endif
../gcc-@gcc_version@/configure $CONFIGURE_ARGS --target=@target_alias@ \
--with-gnu-as --with-gnu-ld --with-newlib --verbose \
--with-system-zlib --disable-nls \
--enable-version-specific-runtime-libs \
--enable-threads=rtems --prefix=%{_prefix} @GCCLANGS@
--enable-threads=rtems --prefix=%{_prefix} \
--enable-languages=$languages
%if %build_gnat
cd ../gcc-@gcc_version@/gcc/ada
touch treeprs.ads [es]info.h nmake.ad[bs]
cd ../../../build
%endif
make all
%if %build_gnat
cd gcc
# This is what is documented, but it doesn't work for me (RC)
# make gnatlib_and_tools
make cross-gnattools
cd ..
%endif
make info
%install
@@ -100,7 +146,8 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
make prefix=$RPM_BUILD_ROOT%{_prefix} install
cd @target_alias@/newlib
make prefix=$RPM_BUILD_ROOT%{_prefix} install-info
make prefix=$RPM_BUILD_ROOT%{_prefix} \
bindir=$RPM_BUILD_ROOT%{_bindir} install-info
# cd back to build/
cd ../..

View File

@@ -0,0 +1,79 @@
#!/bin/sh
#
# Usage: mktoolspec CPU
#
RTEMS_DIR=`dirname $0`/@top_srcdir@
CFG=../setup.cache
exe_ext=@EXEEXT@
usage()
{
echo "$0 [options] <target_alias>"
echo " options:"
echo " -cfg <setup.cache>"
echo " -o <rpm-spec-dir>"
exit 1 ;
}
specsrc=${RTEMS_DIR}/gcc3newlib/gccnewlib.spec.in
while test $# -ge 2; do
case $1 in
-cfg)
shift
CFG=$1
shift
;;
-a) # alternate specs file
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
patchn=-1
if test -n "${gcc3_patch_version}"; then
patchn=`expr $patchn + 1`
PATCH1="Patch${patchn}: gcc-${gcc3_version}-rtems-${gcc3_patch_version}.diff"
PATCH2="%patch${patchn} -p0"
fi
if test -n "${gcc3newlib_patch_version}"; then
patchn=`expr $patchn + 1`
PATCH3="Patch${patchn}: newlib-${gcc3newlib_version}-rtems-${gcc3newlib_patch_version}.diff"
PATCH4="%patch${patchn} -p0"
fi
# note that the variables in the gcc3newlib directory are actually the same
sed -e "s,@PATCH1\@,${PATCH1}," \
-e "s,@PATCH2\@,${PATCH2}," \
-e "s,@PATCH3\@,${PATCH3}," \
-e "s,@PATCH4\@,${PATCH4}," \
-e "s%@Release\@%${gcc3newlib_rpm_release}%g" \
-e "s%@target_alias\@%${target_alias}%g" \
-e "s%@prefix\@%@prefix@%g" \
-e "s,@rpm_build_root\@,${rpm_build_root},g" \
-e "s%@gcc_version\@%${gcc3_version}%g" \
-e "s%@gcc_patch_version\@%${gcc3_patch_version}%g" \
-e "s%@newlib_version\@%${gcc3newlib_version}%g" \
-e "s%@newlib_patch_version\@%${gcc3newlib_patch_version}%g" \
-e "s%@exe_ext\@%${exe_ext}%g" \
< ${specsrc}

View File

@@ -1,3 +1,4 @@
%if %build_cxx
# ==============================================================
# @target_alias@-c++
# ==============================================================
@@ -23,3 +24,4 @@ This is the gcc/g++ compiler for @target_alias@
%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@/cc1plus@exe_ext@
%dir %{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@/include
%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@/include/g++
%endif

View File

@@ -1,3 +1,4 @@
%if %build_g77
# ==============================================================
# @target_alias@-g77
# ==============================================================
@@ -17,3 +18,4 @@ This is the gcc/g77 compiler for @target_alias@
%{_prefix}/bin/@target_alias@-g77@exe_ext@
%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@/f771@exe_ext@
%endif

View File

@@ -1,3 +1,4 @@
%if %build_gcj
# ==============================================================
# @target_alias@-gcj
# ==============================================================
@@ -19,3 +20,4 @@ This is the gcc/java compiler for @target_alias@
%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@/jc1@exe_ext@
%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@/jvgenmain@exe_ext@
%endif

View File

@@ -0,0 +1,22 @@
%if %build_gnat
# ==============================================================
# @target_alias@-gnat
# ==============================================================
%package -n @target_alias@-gnat
Provides: @target_alias@-gnat
Summary: gcc/gnat compiler for @target_alias@
Group: rtems
Requires: rtems-base-gnat @target_alias@-gcc
%description -n @target_alias@-gnat
RTEMS is an open source operating system for embedded systems.
This is the gcc/gnat compiler for @target_alias@
%files -n @target_alias@-gnat
# %files -n @target_alias@-gnat -f build/files.gnat
%dir %{_prefix}/bin
%{_prefix}/bin/@target_alias@-gnat*
%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@/gnat1@exe_ext@
%endif

View File

@@ -1,3 +1,4 @@
%if %build_objc
# ==============================================================
# @target_alias@-objc
# ==============================================================
@@ -15,3 +16,4 @@ This is the gcc/objc compiler for @target_alias@
%files -n @target_alias@-objc -f build/files.objc
%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@/cc1obj@exe_ext@
%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@/include/objc
%endif