summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-06-12 15:00:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-06-12 15:00:15 +0000
commitdf49c60c9671e4a28e636964d744c1f59fb6cb68 (patch)
treeeabd85e189514ad412a35414ba5d483dcda3ef1f /scripts
parent0ab65474316231792faec37ec1dbddeaf8645775 (diff)
downloadrtems-df49c60c9671e4a28e636964d744c1f59fb6cb68.tar.bz2
Merged from 4.5.0-beta3a
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am24
-rw-r--r--scripts/binutils/.cvsignore2
-rw-r--r--scripts/binutils/Makefile.am42
-rw-r--r--scripts/binutils/base-binutils.add64
-rw-r--r--scripts/binutils/binutils.add93
-rw-r--r--scripts/binutils/target-binutils.add46
-rwxr-xr-xscripts/buildall.in32
-rw-r--r--scripts/configure.in18
-rw-r--r--scripts/gccnewlib/.cvsignore3
-rw-r--r--scripts/gccnewlib/Makefile.am62
-rw-r--r--scripts/gccnewlib/README8
-rw-r--r--scripts/gccnewlib/base-chill.add38
-rw-r--r--scripts/gccnewlib/base-g77.add42
-rw-r--r--scripts/gccnewlib/base-gcc.add52
-rw-r--r--scripts/gccnewlib/base-gcj.add20
-rw-r--r--scripts/gccnewlib/gccnewlib.add138
-rw-r--r--scripts/gccnewlib/target-chill.add18
-rw-r--r--scripts/gccnewlib/target-g77.add19
-rw-r--r--scripts/gccnewlib/target-gcc.add28
-rw-r--r--scripts/gccnewlib/target-gcj.add21
-rw-r--r--scripts/gccnewlib/target-objc.add17
-rw-r--r--scripts/gdb/.cvsignore2
-rw-r--r--scripts/gdb/Makefile.am40
-rw-r--r--scripts/gdb/base-gdb.add55
-rw-r--r--scripts/gdb/gdb.add75
-rw-r--r--scripts/gdb/target-gdb.add21
-rw-r--r--scripts/rtems/.cvsignore1
-rw-r--r--scripts/rtems/Makefile.am33
-rw-r--r--scripts/rtems/rtems.spec.in2
-rw-r--r--scripts/setup.def12
30 files changed, 902 insertions, 126 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 2daa93a409..b3137e28f5 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -2,31 +2,23 @@
## $Id$
##
-AUTOMAKE_OPTIONS = foreign
+AUTOMAKE_OPTIONS = foreign 1.4
SUBDIRS = . binutils gccnewlib gdb rtems
-noinst_SCRIPTS = \
-setup \
-buildall \
-mkbinutilspec \
-mkbspspec \
-mkgccnewlibspec \
-mkgdbspec \
-mkrpms \
-mkspec
+noinst_SCRIPTS = setup buildall mkbinutilspec mkbspspec mkgccnewlibspec \
+ mkgdbspec mkrpms mkspec
-TEMPLATES =
+TEMPLATES =
-noinst_DATA = \
-setup.def $(TEMPLATES)
+noinst_DATA = setup.def $(TEMPLATES)
-EXTRA_DIST = \
-$(noinst_DATA) \
-$(noinst_SCRIPTS)
+EXTRA_DIST = $(noinst_DATA) $(noinst_SCRIPTS)
CONFIGURE_DEPENDENCIES = setup.cache
setup.cache: setup.def
cp setup.def $@
DISTCLEANFILES = setup.cache
+include $(top_srcdir)/../automake/subdirs.am
+include $(top_srcdir)/../automake/local.am
diff --git a/scripts/binutils/.cvsignore b/scripts/binutils/.cvsignore
index 52555123f4..7cd764d6df 100644
--- a/scripts/binutils/.cvsignore
+++ b/scripts/binutils/.cvsignore
@@ -1,3 +1,5 @@
+*.spec
Makefile
Makefile.in
binutils.spec
+binutils.spec.in
diff --git a/scripts/binutils/Makefile.am b/scripts/binutils/Makefile.am
index 0e40d96a8e..b270a3e205 100644
--- a/scripts/binutils/Makefile.am
+++ b/scripts/binutils/Makefile.am
@@ -2,12 +2,19 @@
## $Id$
##
-AUTOMAKE_OPTIONS = foreign
+AUTOMAKE_OPTIONS = foreign 1.4
MKBINUTILSSPEC = $(SHELL) $(top_builddir)/mkbinutilspec
-MKBINUTILSSPEC_DEPS = \
-$(top_builddir)/mkbinutilspec binutils.spec.in $(top_builddir)/setup.cache
+SUBPACKAGES = binutils.add \
+ base-binutils.add target-binutils.add
+
+binutils.spec.in: $(SUBPACKAGES)
+ cat $^ > $@
+CLEANFILES += binutils.spec.in
+
+MKBINUTILSSPEC_DEPS = $(top_builddir)/mkbinutilspec binutils.spec.in \
+ $(top_builddir)/setup.cache
hppa1.1-rtems-$(BINUTILSVERS).spec: $(MKBINUTILSSPEC_DEPS)
$(MKBINUTILSSPEC) -cfg $(top_builddir)/setup.cache -o . hppa1.1-rtems
@@ -39,25 +46,14 @@ sh-rtemself-$(BINUTILSVERS).spec: $(MKBINUTILSSPEC_DEPS)
sparc-rtems-$(BINUTILSVERS).spec: $(MKBINUTILSSPEC_DEPS)
$(MKBINUTILSSPEC) -cfg $(top_builddir)/setup.cache -o . sparc-rtems
-TEMPLATES = \
-binutils.spec.in
-
-RPM_SPECS_DATA = \
-hppa1.1-rtems-$(BINUTILSVERS).spec \
-i386-rtems-$(BINUTILSVERS).spec \
-i960-rtems-$(BINUTILSVERS).spec \
-m68k-rtems-$(BINUTILSVERS).spec \
-m68k-rtemself-$(BINUTILSVERS).spec \
-mips64orion-rtems-$(BINUTILSVERS).spec \
-powerpc-rtems-$(BINUTILSVERS).spec \
-sh-rtems-$(BINUTILSVERS).spec \
-sh-rtemself-$(BINUTILSVERS).spec \
-sparc-rtems-$(BINUTILSVERS).spec
-
-noinst_DATA = \
-$(TEMPLATES)
+RPM_SPECS_DATA = hppa1.1-rtems-$(BINUTILSVERS).spec \
+ i386-rtems-$(BINUTILSVERS).spec i960-rtems-$(BINUTILSVERS).spec \
+ m68k-rtems-$(BINUTILSVERS).spec m68k-rtemself-$(BINUTILSVERS).spec \
+ mips64orion-rtems-$(BINUTILSVERS).spec \
+ powerpc-rtems-$(BINUTILSVERS).spec sh-rtems-$(BINUTILSVERS).spec \
+ sh-rtemself-$(BINUTILSVERS).spec sparc-rtems-$(BINUTILSVERS).spec
+CLEANFILES += $(RPM_SPECS_DATA)
-EXTRA_DIST = \
-$(TEMPLATES)
+EXTRA_DIST = $(SUBPACKAGES)
-CLEANFILES = $(RPM_SPECS_DATA)
+include $(top_srcdir)/../automake/local.am
diff --git a/scripts/binutils/base-binutils.add b/scripts/binutils/base-binutils.add
index e69de29bb2..bfdcd87542 100644
--- a/scripts/binutils/base-binutils.add
+++ b/scripts/binutils/base-binutils.add
@@ -0,0 +1,64 @@
+# ==============================================================
+# rtems-base-binutils
+# ==============================================================
+%package -n rtems-base-binutils
+Provides: rtems-base-binutils
+Summary: base package for rtems binutils
+Group: rtems
+
+%description -n rtems-base-binutils
+
+RTEMS is an open source operating system for embedded systems.
+
+This is the base for binutils regardless of target CPU.
+
+%post -n rtems-base-binutils
+ if test -d $RPM_INSTALL_PREFIX/rtems/info;
+ then
+ rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
+ f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
+ test x"$f" != x"" && for i in $f; do
+ install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
+ done
+ fi
+
+%postun -n rtems-base-binutils
+ if test -d $RPM_INSTALL_PREFIX/rtems/info;
+ then
+ rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
+ f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
+ test x"$f" != x"" && for i in $f; do
+ install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
+ done
+ fi
+
+%files -n rtems-base-binutils -f files
+%dir /opt/rtems/info
+%doc /opt/rtems/info/dir
+%doc /opt/rtems/info/as.info.gz
+%doc /opt/rtems/info/as.info-?.gz
+%doc /opt/rtems/info/bfd.info.gz
+%doc /opt/rtems/info/bfd.info-?.gz
+%doc /opt/rtems/info/binutils.info.gz
+%doc /opt/rtems/info/binutils.info-?.gz
+%doc /opt/rtems/info/ld.info.gz
+%doc /opt/rtems/info/ld.info-?.gz
+%doc /opt/rtems/info/gasp.info.gz
+%doc /opt/rtems/info/standards.info.gz
+
+%dir /opt/rtems/man
+%dir /opt/rtems/man/man1
+
+%dir /opt/rtems/include
+/opt/rtems/include/bfd.h
+/opt/rtems/include/ansidecl.h
+/opt/rtems/include/bfdlink.h
+
+%dir /opt/rtems/lib
+/opt/rtems/lib/libbfd*
+/opt/rtems/lib/libiberty*
+/opt/rtems/lib/libopcodes*
+
+%dir /opt/rtems/share
+%dir /opt/rtems/share/locale
+
diff --git a/scripts/binutils/binutils.add b/scripts/binutils/binutils.add
index e69de29bb2..a8f1ee5c86 100644
--- a/scripts/binutils/binutils.add
+++ b/scripts/binutils/binutils.add
@@ -0,0 +1,93 @@
+#
+# spec file for binutils package targetting rtems
+#
+# Copyright (c) 1999,2000 OARCorp, Huntsville, AL
+#
+# please send bugfixes or comments to joel@OARcorp.com
+#
+
+Vendor: OAR Corporation
+Distribution: Linux
+Name: @target_alias@-binutils-collection
+Summary: binutils for target @target_alias@
+Group: rtems
+Release: @Release@
+License: GPL/LGPL
+
+Autoreqprov: off
+Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com
+Prefix: /opt
+BuildRoot: /tmp/@target_alias@-binutils
+
+Version: @binutils_version@
+Source0: ftp://ftp.gnu.org/pub/gnu/binutils/binutils-@binutils_version@.tar.gz
+Patch0: binutils-@binutils_version@-rtems-@binutils_patch_version@.diff
+#
+# The original sources are not included in the source RPM.
+# If we included them, then the source RPMs for each target
+# would duplicate MBs of source unnecessarily. This is
+# a duplication of over 30 MBs of source for each of
+# the more than 10 targets it is possible to build.
+#
+# You can get them yourself from the Internet and copy them to
+# your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR).
+# Or you can try the ftp options of rpm :-)
+#
+NoSource: 0
+
+%description
+
+RTEMS is an open source operating system for embedded systems.
+
+This is binutils sources with patches for RTEMS.
+
+%prep
+# untar the sources inside @target_alias@-binutils
+%setup -c -n @target_alias@-binutils -a 0
+
+%patch0 -p0
+ test -d build || mkdir build
+
+%build
+ cd build
+ ../binutils-@binutils_version@/configure --target=@target_alias@ \
+ --verbose --prefix=/opt/rtems
+
+ make all
+ make info
+
+
+%install
+ cd build
+ make prefix=$RPM_BUILD_ROOT/opt/rtems install
+ make prefix=$RPM_BUILD_ROOT/opt/rtems install-info
+# A bug in binutils: binutils does not install share/locale
+# however it uses it
+ ../binutils-@binutils_version@/mkinstalldirs \
+ $RPM_BUILD_ROOT/opt/rtems/share/locale
+
+# gzip info files
+ gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info 2>/dev/null
+ gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-? 2>/dev/null
+
+ if test -f $RPM_BUILD_ROOT/opt/rtems/info/configure.info.gz;
+ then
+# These are only present in binutils >= 2.9.5
+ find $RPM_BUILD_ROOT/opt/rtems/info -name 'configure.*' | \
+ sed -e "s,^$RPM_BUILD_ROOT,,g" > ../files
+ else
+ touch ../files
+ fi
+
+# We assume that info/dir exists when building the RPMs
+ rm -f $RPM_BUILD_ROOT/opt/rtems/info/dir
+ f=`find $RPM_BUILD_ROOT/opt/rtems/info -name '*.info.gz'`
+ test x"$f" != x"" && for i in $f; do
+ install-info $i $RPM_BUILD_ROOT/opt/rtems/info/dir
+ done
+
+%clean
+# let rpm --clean remove BuildRoot iif using the default BuildRoot
+ test "$RPM_BUILD_ROOT" = "/tmp/@target_alias@-binutils" && \
+ rm -rf $RPM_BUILD_ROOT
+
diff --git a/scripts/binutils/target-binutils.add b/scripts/binutils/target-binutils.add
index e69de29bb2..94abb23dc2 100644
--- a/scripts/binutils/target-binutils.add
+++ b/scripts/binutils/target-binutils.add
@@ -0,0 +1,46 @@
+# ==============================================================
+# @target_alias@-binutils
+# ==============================================================
+%package -n @target_alias@-binutils
+Provides: @target_alias@-binutils
+Summary: rtems binutils for @target_alias@
+Group: rtems
+Requires: rtems-base-binutils
+Autoreqprov: off
+
+%description -n @target_alias@-binutils
+
+RTEMS is an open source operating system for embedded systems.
+
+This is the GNU binutils for RTEMS targetting @target_alias@.
+
+%files -n @target_alias@-binutils
+%doc /opt/rtems/man/man1/@target_alias@-*.1
+
+%dir /opt/rtems/bin
+/opt/rtems/bin/@target_alias@-addr2line@exe_ext@
+/opt/rtems/bin/@target_alias@-ar@exe_ext@
+/opt/rtems/bin/@target_alias@-as@exe_ext@
+/opt/rtems/bin/@target_alias@-c++filt@exe_ext@
+/opt/rtems/bin/@target_alias@-gasp@exe_ext@
+/opt/rtems/bin/@target_alias@-ld@exe_ext@
+/opt/rtems/bin/@target_alias@-nm@exe_ext@
+/opt/rtems/bin/@target_alias@-objcopy@exe_ext@
+/opt/rtems/bin/@target_alias@-objdump@exe_ext@
+/opt/rtems/bin/@target_alias@-ranlib@exe_ext@
+/opt/rtems/bin/@target_alias@-readelf@exe_ext@
+/opt/rtems/bin/@target_alias@-size@exe_ext@
+/opt/rtems/bin/@target_alias@-strings@exe_ext@
+/opt/rtems/bin/@target_alias@-strip@exe_ext@
+
+%dir /opt/rtems/@target_alias@
+%dir /opt/rtems/@target_alias@/bin
+/opt/rtems/@target_alias@/bin/ar@exe_ext@
+/opt/rtems/@target_alias@/bin/as@exe_ext@
+/opt/rtems/@target_alias@/bin/ld@exe_ext@
+/opt/rtems/@target_alias@/bin/nm@exe_ext@
+/opt/rtems/@target_alias@/bin/ranlib@exe_ext@
+/opt/rtems/@target_alias@/bin/strip@exe_ext@
+
+%dir /opt/rtems/@target_alias@/lib
+/opt/rtems/@target_alias@/lib/ldscripts
diff --git a/scripts/buildall.in b/scripts/buildall.in
index 81df764d04..cac75f6d4e 100755
--- a/scripts/buildall.in
+++ b/scripts/buildall.in
@@ -6,18 +6,33 @@
RTEMS_DIR=`dirname $0`
CFG=./setup.cache
dst=@RPM_SPECSdir@
+target=@target@
+rpm_cpu=@RPM_CPU@
usage()
{
echo "$0 [options] <target_alias>"
echo " options:"
+ echo " -b -- build binutils"
+ echo " -g -- build gcc/newlib"
+ echo " -d -- build gdb"
+ echo " -t -- enable test/debug mode"
echo " -cfg <setup.cache>"
echo " -o <rpm-spec-dir>"
exit 1 ;
}
+testing=no
+do_binutils=no
+do_gccnewlib=no
+do_gdb=no
+
while test $# -ge 1; do
case $1 in
+ -b) do_binutils=yes ; shift;;
+ -g) do_gccnewlib=yes ; shift;;
+ -d) do_gdb=yes ; shift;;
+ -t) do_test=yes ; shift;;
-cfg)
test $# -ge 2 || usage
shift
@@ -41,6 +56,12 @@ while test $# -ge 1; do
esac
done
+if test ${do_binutils} = no -a ${do_gccnewlib} = no -a ${do_gdb} = no ; then
+ echo "You must request building binutils, gcc/newlib, or gdb."
+ usage
+fi
+
+
# This is the full list .. hppa1.1 does not build now.
#ALL_TARGETS="hppa1.1-rtems i386-rtems i960-rtems m68k-rtems \
# m68k-rtemself mips64orion-rtems \
@@ -61,11 +82,6 @@ newlib=${newlib_version}
# also use binutils_rpm_release
buildroot=/tmp
-testing=no
-do_binutils=yes
-do_gccnewlib=yes
-do_gdb=yes
-
#
# Now get started
#
@@ -77,7 +93,7 @@ if [ ${testing} = yes ] ; then
ECHO=echo
fi
-installed_count=`rpm -qa | grep rtems | wc -l`
+installed_count=`rpm -q -g rtems | wc -l`
if [ ${installed_count} -ne 0 ] ; then
echo This script should be run with NO rtems RPMs installed.
echo It appears that the following rtems RPMs are installed:
@@ -135,8 +151,8 @@ do
# now build gcc/newlib
# NOTE: This requires having binutils installed and we immediately
# remove it once finished.
- base_binutils_rpm=${dst}/../RPMS/i386/rtems-base-binutils-${binutils}-${binutils_rpm_release}.i386.rpm
- binutils_rpm=${dst}/../RPMS/i386/${target}-binutils-${binutils}-${binutils_rpm_release}.i386.rpm
+ base_binutils_rpm=${dst}/../RPMS/${rpm_cpu}/rtems-base-binutils-${binutils}-${binutils_rpm_release}.${rpm_cpu}.rpm
+ binutils_rpm=${dst}/../RPMS/${rpm_cpu}/${target}-binutils-${binutils}-${binutils_rpm_release}.${rpm_cpu}.rpm
if [ ! -f ${binutils_rpm} ] ; then
echo There is no RPM for binutils for ${target}.
echo Looked for ${binutils_rpm}.
diff --git a/scripts/configure.in b/scripts/configure.in
index 296939a60a..3f94025b72 100644
--- a/scripts/configure.in
+++ b/scripts/configure.in
@@ -1,7 +1,7 @@
## $Id$
AC_INIT(binutils)
-AM_INIT_AUTOMAKE(rtems-scripts,20000125-0,no)
+AM_INIT_AUTOMAKE(rtems-scripts,20000610-0,no)
AC_EXEEXT
@@ -31,6 +31,21 @@ fi
AC_MSG_RESULT($RPM_SPECSdir)
AC_SUBST(RPM_SPECSdir)
+AC_CANONICAL_HOST
+
+AC_MSG_CHECKING(for RPM CPU type)
+changequote(,)dnl
+case "${host}" in
+ i[34567]86-*linux*) RPM_CPU=i386 ;;
+ i[34567]86-pc-cygwin*) RPM_CPU=i386 ;;
+ sparc-sun-solaris*) RPM_CPU=sparc ;;
+ *)
+ AC_MSG_ERROR(RPM CPU for ${target} is unknown)
+ ;;
+esac
+changequote([,])dnl
+AC_MSG_RESULT($RPM_CPU)
+
GCCNEWLIBVERS="gcc-${gcc_version}-newlib-${newlib_version}"
AC_SUBST(GCCNEWLIBVERS)
BINUTILSVERS="binutils-${binutils_version}"
@@ -40,6 +55,7 @@ AC_SUBST(GDBVERS)
BSPVERS="${rtems_version}"
AC_SUBST(RTEMS_VERSION)
AC_SUBST(BSPVERS)
+AC_SUBST(RPM_CPU)
AC_OUTPUT(
Makefile
diff --git a/scripts/gccnewlib/.cvsignore b/scripts/gccnewlib/.cvsignore
index 03dfe26135..ec9045cdae 100644
--- a/scripts/gccnewlib/.cvsignore
+++ b/scripts/gccnewlib/.cvsignore
@@ -1,4 +1,7 @@
+*.spec
Makefile
Makefile.in
gccnewlib.spec
+gccnewlib.spec.in
gccnewlib_c_only.spec
+gccnewlib_c_only.spec.in
diff --git a/scripts/gccnewlib/Makefile.am b/scripts/gccnewlib/Makefile.am
index 659f284c81..267c0b68a3 100644
--- a/scripts/gccnewlib/Makefile.am
+++ b/scripts/gccnewlib/Makefile.am
@@ -2,17 +2,33 @@
## $Id$
##
-AUTOMAKE_OPTIONS = foreign
+AUTOMAKE_OPTIONS = foreign 1.4
MKGCCNEWLIBSPEC = $(SHELL) $(top_builddir)/mkgccnewlibspec
+SUBPACKAGES = gccnewlib.add \
+ base-gcc.add target-gcc.add \
+ base-chill.add target-chill.add \
+ base-g77.add target-g77.add \
+ base-gcj.add target-gcj.add \
+ target-objc.add
+
+gccnewlib.spec.in: $(SUBPACKAGES)
+ cat $^ \
+ | sed -e 's%@GCCLANGS@%%g' > $@
+CLEANFILES += gccnewlib.spec.in
+
+gccnewlib_c_only.spec.in: gccnewlib.add base-gcc.add target-gcc.add
+ cat $^ \
+ | sed -e "s%@GCCLANGS@%\'--enable-languages=c,c++\'%g" > $@
+CLEANFILES += gccnewlib_c_only.spec.in
+
C_ONLY_ARG = -a $(top_builddir)/gccnewlib/gccnewlib_c_only.spec.in
-MKGCCNEWLIBSPEC_DEPS = \
- $(top_builddir)/mkgccnewlibspec gccnewlib.spec.in $(top_builddir)/setup.cache
-MKGCCNEWLIB_C_ONLY_SPEC_DEPS = \
- $(top_builddir)/mkgccnewlibspec gccnewlib_c_only.spec.in \
- $(top_builddir)/setup.cache
+MKGCCNEWLIBSPEC_DEPS = $(top_builddir)/mkgccnewlibspec gccnewlib.spec.in \
+ $(top_builddir)/setup.cache
+MKGCCNEWLIB_C_ONLY_SPEC_DEPS = $(top_builddir)/mkgccnewlibspec \
+ gccnewlib_c_only.spec.in $(top_builddir)/setup.cache
hppa1.1-rtems-$(GCCNEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . hppa1.1-rtems
@@ -44,26 +60,14 @@ sh-rtemself-$(GCCNEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
sparc-rtems-$(GCCNEWLIBVERS).spec: $(MKGCCNEWLIBSPEC_DEPS)
$(MKGCCNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . sparc-rtems
-TEMPLATES = \
-gccnewlib.spec.in \
-gccnewlib_c_only.spec.in
-
-RPM_SPECS_DATA = \
-hppa1.1-rtems-$(GCCNEWLIBVERS).spec \
-i386-rtems-$(GCCNEWLIBVERS).spec \
-i960-rtems-$(GCCNEWLIBVERS).spec \
-m68k-rtems-$(GCCNEWLIBVERS).spec \
-m68k-rtemself-$(GCCNEWLIBVERS).spec \
-mips64orion-rtems-$(GCCNEWLIBVERS).spec \
-powerpc-rtems-$(GCCNEWLIBVERS).spec \
-sh-rtems-$(GCCNEWLIBVERS).spec \
-sh-rtemself-$(GCCNEWLIBVERS).spec \
-sparc-rtems-$(GCCNEWLIBVERS).spec
-
-noinst_DATA = \
-$(TEMPLATES)
-
-EXTRA_DIST = \
-$(TEMPLATES)
-
-CLEANFILES = $(RPM_SPECS_DATA)
+RPM_SPECS_DATA = hppa1.1-rtems-$(GCCNEWLIBVERS).spec \
+ i386-rtems-$(GCCNEWLIBVERS).spec i960-rtems-$(GCCNEWLIBVERS).spec \
+ m68k-rtems-$(GCCNEWLIBVERS).spec m68k-rtemself-$(GCCNEWLIBVERS).spec \
+ mips64orion-rtems-$(GCCNEWLIBVERS).spec \
+ powerpc-rtems-$(GCCNEWLIBVERS).spec sh-rtems-$(GCCNEWLIBVERS).spec \
+ sh-rtemself-$(GCCNEWLIBVERS).spec sparc-rtems-$(GCCNEWLIBVERS).spec
+CLEANFILES += $(RPM_SPECS_DATA)
+
+EXTRA_DIST = $(SUBPACKAGES)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/scripts/gccnewlib/README b/scripts/gccnewlib/README
new file mode 100644
index 0000000000..db158b93c2
--- /dev/null
+++ b/scripts/gccnewlib/README
@@ -0,0 +1,8 @@
+#
+# $Id$
+#
+
+This directory contains RPM-spec file fragments (*.add) which are used to
+compose the toolchain specs.
+
+Cf. Makefile.am for details on how the toolchain specs get composed.
diff --git a/scripts/gccnewlib/base-chill.add b/scripts/gccnewlib/base-chill.add
index e69de29bb2..026d707be8 100644
--- a/scripts/gccnewlib/base-chill.add
+++ b/scripts/gccnewlib/base-chill.add
@@ -0,0 +1,38 @@
+# ==============================================================
+# rtems-base-chill
+# ==============================================================
+%package -n rtems-base-chill
+Provides: rtems-base-chill
+Summary: base package for rtems gcc/chill compiler.
+Group: rtems
+Requires: rtems-base-gcc
+
+%description -n rtems-base-chill
+RTEMS is an open source operating system for embedded systems.
+
+This is the files for gcc/chill that are shared by all targets.
+
+%files -n rtems-base-chill
+%dir /opt/rtems/info
+%doc /opt/rtems/info/chill.info*.gz
+
+%post -n rtems-base-chill
+ if test -d $RPM_INSTALL_PREFIX/rtems/info;
+ then
+ rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
+ f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
+ test -n "$f" && for i in $f; do
+ install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
+ done
+ fi
+
+%postun -n rtems-base-chill
+ if test -d $RPM_INSTALL_PREFIX/rtems/info;
+ then
+ rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
+ f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
+ test -n "$f" && for i in $f; do
+ install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
+ done
+ fi
+
diff --git a/scripts/gccnewlib/base-g77.add b/scripts/gccnewlib/base-g77.add
index e69de29bb2..fbc8d87c07 100644
--- a/scripts/gccnewlib/base-g77.add
+++ b/scripts/gccnewlib/base-g77.add
@@ -0,0 +1,42 @@
+# ==============================================================
+# rtems-base-g77
+# ==============================================================
+%package -n rtems-base-g77
+Provides: rtems-base-g77
+Summary: rtems base package for gcc/g77 compiler
+Group: rtems
+Requires: rtems-base-gcc
+
+%description -n rtems-base-g77
+RTEMS is an open source operating system for embedded systems.
+
+This is the files for gcc/g77 that are shared by all targets.
+
+%files -n rtems-base-g77
+%dir /opt/rtems/info
+%doc /opt/rtems/info/g77.info*.gz
+
+%dir /opt/rtems/man
+%dir /opt/rtems/man/man1
+%doc /opt/rtems/man/man1/@target_alias@-g77.1
+
+%post -n rtems-base-g77
+ if test -d $RPM_INSTALL_PREFIX/rtems/info;
+ then
+ rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
+ f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
+ test -n "$f" && for i in $f; do
+ install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
+ done
+ fi
+
+%postun -n rtems-base-g77
+ if test -d $RPM_INSTALL_PREFIX/rtems/info;
+ then
+ rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
+ f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
+ test -n "$f" && for i in $f; do
+ install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
+ done
+ fi
+
diff --git a/scripts/gccnewlib/base-gcc.add b/scripts/gccnewlib/base-gcc.add
index e69de29bb2..d6a4b65cb3 100644
--- a/scripts/gccnewlib/base-gcc.add
+++ b/scripts/gccnewlib/base-gcc.add
@@ -0,0 +1,52 @@
+# ==============================================================
+# rtems-base-gcc
+# ==============================================================
+%package -n rtems-base-gcc
+Provides: rtems-base-gcc
+Summary: base package for rtems gcc and newlib C Library
+Group: rtems
+
+%description -n rtems-base-gcc
+
+RTEMS is an open source operating system for embedded systems.
+
+This is the files for gcc and newlib that are shared by all targets.
+
+%files -n rtems-base-gcc
+%dir /opt/rtems/info
+%doc /opt/rtems/info/cpp.info*.gz
+%doc /opt/rtems/info/gcc.info*.gz
+%doc /opt/rtems/info/libc.info*.gz
+%doc /opt/rtems/info/libm.info*.gz
+
+%dir /opt/rtems/bin
+/opt/rtems/bin/cpp@exe_ext@
+/opt/rtems/bin/gcov@exe_ext@
+
+%dir /opt/rtems/man
+%dir /opt/rtems/man/man1
+%doc /opt/rtems/man/man1/cccp.1
+
+%dir /opt/rtems/include
+/opt/rtems/include/g++-3
+
+%post -n rtems-base-gcc
+ if test -d $RPM_INSTALL_PREFIX/rtems/info;
+ then
+ rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
+ f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
+ test -n "$f" && for i in $f; do
+ install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
+ done
+ fi
+
+%postun -n rtems-base-gcc
+ if test -d $RPM_INSTALL_PREFIX/rtems/info;
+ then
+ rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
+ f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
+ test -n "$f" && for i in $f; do
+ install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
+ done
+ fi
+
diff --git a/scripts/gccnewlib/base-gcj.add b/scripts/gccnewlib/base-gcj.add
index e69de29bb2..e05cacab97 100644
--- a/scripts/gccnewlib/base-gcj.add
+++ b/scripts/gccnewlib/base-gcj.add
@@ -0,0 +1,20 @@
+# ==============================================================
+# rtems-base-gcj
+# ==============================================================
+%package -n rtems-base-gcj
+Provides: rtems-base-gcj
+Summary: base package for rtems gcc/java compiler (gcj).
+Group: rtems
+Requires: rtems-base-gcc
+
+%description -n rtems-base-gcj
+RTEMS is an open source operating system for embedded systems.
+
+This is the files for gcc/java (gcj) that are shared by all targets.
+
+%files -n rtems-base-gcj
+%dir /opt/rtems/bin
+/opt/rtems/bin/jcf-dump@exe_ext@
+/opt/rtems/bin/jv-scan@exe_ext@
+/opt/rtems/bin/gcjh@exe_ext@
+
diff --git a/scripts/gccnewlib/gccnewlib.add b/scripts/gccnewlib/gccnewlib.add
index e69de29bb2..c547660055 100644
--- a/scripts/gccnewlib/gccnewlib.add
+++ b/scripts/gccnewlib/gccnewlib.add
@@ -0,0 +1,138 @@
+#
+# spec file for building gcc for rtems
+#
+# Copyright (c) 1999,2000 OARCorp, Huntsville, AL
+#
+# please send bugfixes or comments to joel@OARcorp.com
+#
+
+Vendor: OAR Corporation
+Distribution: Linux
+Name: @target_alias@-gcc-newlib
+Summary: gcc and newlib C Library for @target_alias@.
+Group: rtems
+Release: @Release@
+License: gcc is GPL/LGPL ; newlib no has restrictions on run-time usage
+
+Autoreqprov: on
+Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com
+
+Version: gcc@gcc_version@newlib@newlib_version@
+Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.gz
+Source1: ftp://sourceware.cygnus/com/pub/newlib/newlib-@newlib_version@.tar.gz
+Patch0: gcc-@gcc_version@-rtems-@gcc_patch_version@.diff
+Patch1: newlib-@newlib_version@-rtems-@newlib_patch_version@.diff
+Buildroot: /tmp/@target_alias@-gcc-newlib
+
+#
+# The original sources are not included in the source RPM.
+# If we included them, then the source RPMs for each target
+# would duplicate MBs of source unnecessarily. This is
+# a duplication of over 30 MBs of source for each of
+# the more than 10 targets it is possible to build.
+#
+# You can get them yourself from the Internet and copy them to
+# your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR).
+# Or you can try the ftp options of rpm :-)
+#
+NoSource: 0
+NoSource: 1
+
+%description
+RTEMS is an open source operating system for embedded systems.
+
+This is gcc's and newlib C Library's sources with patches for RTEMS.
+
+ The original sources are not included in the source RPM.
+ If we included them, then the source RPMs for each target
+ would duplicate MBs of source unnecessarily. This is
+ a duplication of over 30 MBs of source for each of
+ the more than 10 targets it is possible to build.
+
+ You can get them yourself from the Internet and copy them to
+ your /usr/src/[redhat|packages]/SOURCES directory ($RPM_SOURCE_DIR).
+ Or you can try the ftp options of rpm :-)
+
+%prep
+# untar the sources inside @target_alias@-gcc-newlib
+%setup -c -n @target_alias@-gcc-newlib -a 0 -a 1
+
+%patch0 -p0
+%patch1 -p0
+
+ # Copy the C library into gcc's source tree
+ ln -s ../newlib-@newlib_version@/newlib gcc-@gcc_version@
+ test -d build || mkdir build
+
+%build
+ cd build
+
+ ../gcc-@gcc_version@/configure --target=@target_alias@ \
+ --with-gnu-as --with-gnu-ld --with-newlib --verbose \
+ --enable-threads --prefix=/opt/rtems @GCCLANGS@
+
+ make all
+ make info
+
+%install
+ cd build
+ # Bug in gcc-2.95.1: It doesn't build this installation directory
+ # If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc
+ ../gcc-@gcc_version@/mkinstalldirs \
+ $RPM_BUILD_ROOT/opt/rtems/@target_alias@/bin
+
+ make prefix=$RPM_BUILD_ROOT/opt/rtems install
+ cd @target_alias@/newlib
+ make prefix=$RPM_BUILD_ROOT/opt/rtems install-info
+
+ # cd back to build/
+ cd ../..
+
+ # gzip info files
+ gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info 2>/dev/null
+ gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-? 2>/dev/null
+ gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-?? 2>/dev/null
+
+ rm -f dirs ;
+ echo "%dir /opt/rtems/lib" >> dirs ;
+ echo "%dir /opt/rtems/lib/gcc-lib" >> dirs ;
+ echo "%dir /opt/rtems/lib/gcc-lib/@target_alias@" >> dirs ;
+
+ # Collect multilib subdirectories
+ TGTDIR="/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@"
+ f=`gcc/xgcc --print-multi-lib | sed -e 's,;.*$,,'`
+ for i in $f; do
+ case $i in
+ \.) echo "%dir ${TGTDIR}" >> dirs
+ ;;
+ *) echo "%dir ${TGTDIR}/$i" >> dirs
+ ;;
+ esac
+ done
+
+ # Collect files to go into different packages
+ cp dirs files.chill
+ cp dirs files.gcc
+ cp dirs files.g77
+ cp dirs files.objc
+ cp dirs files.gcj
+
+ f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
+ for i in $f; do
+ case $i in
+ *chill*) echo "$i" >> files.chill ;;
+ *f771) ;;
+ *cc1obj) ;;
+ *libobjc*) echo "$i" >> files.objc ;;
+ *include/objc*) ;;
+ *jc1) ;;
+ *jvgenmain) ;;
+ *) echo "$i" >> files.gcc ;;
+ esac
+ done
+
+%clean
+# let rpm --clean remove BuildRoot iif using the default BuildRoot
+ test "$RPM_BUILD_ROOT" = "/tmp/@target_alias@-gcc-newlib" && \
+ rm -rf $RPM_BUILD_ROOT
+
diff --git a/scripts/gccnewlib/target-chill.add b/scripts/gccnewlib/target-chill.add
index e69de29bb2..5e10a84814 100644
--- a/scripts/gccnewlib/target-chill.add
+++ b/scripts/gccnewlib/target-chill.add
@@ -0,0 +1,18 @@
+# ==============================================================
+# @target_alias@-chill
+# ==============================================================
+%package -n @target_alias@-chill
+Provides: @target_alias@-chill
+Summary: gcc/chill compiler for @target_alias@
+Group: rtems
+Requires: rtems-base-chill @target_alias@-gcc
+
+%description -n @target_alias@-chill
+RTEMS is an open source operating system for embedded systems.
+
+This is the gcc/chill compiler and support files for @target_alias@
+
+%files -n @target_alias@-chill -f build/files.chill
+%dir /opt/rtems/bin
+/opt/rtems/bin/@target_alias@-chill
+
diff --git a/scripts/gccnewlib/target-g77.add b/scripts/gccnewlib/target-g77.add
index e69de29bb2..920a709652 100644
--- a/scripts/gccnewlib/target-g77.add
+++ b/scripts/gccnewlib/target-g77.add
@@ -0,0 +1,19 @@
+# ==============================================================
+# @target_alias@-g77
+# ==============================================================
+%package -n @target_alias@-g77
+Provides: @target_alias@-g77
+Summary: gcc/g77 compiler for @target_alias@
+Group: rtems
+Requires: rtems-base-g77 @target_alias@-gcc
+
+%description -n @target_alias@-g77
+RTEMS is an open source operating system for embedded systems.
+
+This is the gcc/g77 compiler for @target_alias@
+
+%files -n @target_alias@-g77 -f build/files.g77
+%dir /opt/rtems/bin
+/opt/rtems/bin/@target_alias@-g77@exe_ext@
+
+/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/f771@exe_ext@
diff --git a/scripts/gccnewlib/target-gcc.add b/scripts/gccnewlib/target-gcc.add
index e69de29bb2..3f78469362 100644
--- a/scripts/gccnewlib/target-gcc.add
+++ b/scripts/gccnewlib/target-gcc.add
@@ -0,0 +1,28 @@
+# ==============================================================
+# @target_alias@-gcc
+# ==============================================================
+%package -n @target_alias@-gcc
+Provides: @target_alias@-gcc
+Summary: rtems gcc and newlib C Library for @target_alias@
+Group: rtems
+Requires: @target_alias@-binutils rtems-base-gcc
+
+%description -n @target_alias@-gcc
+RTEMS is an open source operating system for embedded systems.
+
+This is gcc and newlib C Library for @target_alias@.
+
+%files -n @target_alias@-gcc -f build/files.gcc
+%doc /opt/rtems/man/man1/@target_alias@-gcc.1
+%doc /opt/rtems/man/man1/@target_alias@-g++.1
+
+/opt/rtems/bin/@target_alias@-c++@exe_ext@
+/opt/rtems/bin/@target_alias@-g++@exe_ext@
+/opt/rtems/bin/@target_alias@-gcc@exe_ext@
+/opt/rtems/bin/@target_alias@-protoize@exe_ext@
+/opt/rtems/bin/@target_alias@-unprotoize@exe_ext@
+
+%dir /opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/include
+
+/opt/rtems/@target_alias@
+
diff --git a/scripts/gccnewlib/target-gcj.add b/scripts/gccnewlib/target-gcj.add
index e69de29bb2..85ae067e5f 100644
--- a/scripts/gccnewlib/target-gcj.add
+++ b/scripts/gccnewlib/target-gcj.add
@@ -0,0 +1,21 @@
+# ==============================================================
+# @target_alias@-gcj
+# ==============================================================
+%package -n @target_alias@-gcj
+Provides: @target_alias@-gcj
+Summary: gcc/java compiler (gcj) for @target_alias@
+Group: rtems
+Requires: rtems-base-gcj @target_alias@-gcc
+
+%description -n @target_alias@-gcj
+RTEMS is an open source operating system for embedded systems.
+
+This is the gcc/java compiler for @target_alias@
+
+%files -n @target_alias@-gcj -f build/files.gcj
+%dir /opt/rtems/bin
+/opt/rtems/bin/@target_alias@-gcj@exe_ext@
+
+/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/jc1@exe_ext@
+/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/jvgenmain@exe_ext@
+
diff --git a/scripts/gccnewlib/target-objc.add b/scripts/gccnewlib/target-objc.add
index e69de29bb2..0183ad29f9 100644
--- a/scripts/gccnewlib/target-objc.add
+++ b/scripts/gccnewlib/target-objc.add
@@ -0,0 +1,17 @@
+# ==============================================================
+# @target_alias@-objc
+# ==============================================================
+%package -n @target_alias@-objc
+Provides: @target_alias@-objc
+Summary: gcc/objc compiler for @target_alias@
+Group: rtems
+Requires: @target_alias@-gcc
+
+%description -n @target_alias@-objc
+RTEMS is an open source operating system for embedded systems.
+
+This is the gcc/objc compiler for @target_alias@
+
+%files -n @target_alias@-objc -f build/files.objc
+/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/cc1obj@exe_ext@
+/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/include/objc
diff --git a/scripts/gdb/.cvsignore b/scripts/gdb/.cvsignore
index 9662404700..7f0ea45e20 100644
--- a/scripts/gdb/.cvsignore
+++ b/scripts/gdb/.cvsignore
@@ -1,3 +1,5 @@
+*.spec
Makefile
Makefile.in
gdb.spec
+gdb.spec.in
diff --git a/scripts/gdb/Makefile.am b/scripts/gdb/Makefile.am
index 16bd1e449c..e1dfc9d037 100644
--- a/scripts/gdb/Makefile.am
+++ b/scripts/gdb/Makefile.am
@@ -2,12 +2,18 @@
## $Id$
##
-AUTOMAKE_OPTIONS = foreign
+AUTOMAKE_OPTIONS = foreign 1.4
MKGDBSPEC = $(SHELL) $(top_builddir)/mkgdbspec
-MKGDBSPEC_DEPS = \
-$(top_builddir)/mkgdbspec gdb.spec.in $(top_builddir)/setup.cache
+SUBPACKAGES = gdb.add base-gdb.add target-gdb.add
+
+gdb.spec.in: $(SUBPACKAGES)
+ cat $^ > $@
+CLEANFILES += gdb.spec.in
+
+MKGDBSPEC_DEPS = $(top_builddir)/mkgdbspec gdb.spec.in \
+ $(top_builddir)/setup.cache
hppa1.1-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS)
$(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . hppa1.1-rtems
@@ -39,25 +45,13 @@ sh-rtemself-$(GDBVERS).spec: $(MKGDBSPEC_DEPS)
sparc-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS)
$(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . sparc-rtems
-TEMPLATES = \
-gdb.spec.in
-
-RPM_SPECS_DATA = \
-hppa1.1-rtems-$(GDBVERS).spec \
-i386-rtems-$(GDBVERS).spec \
-i960-rtems-$(GDBVERS).spec \
-m68k-rtems-$(GDBVERS).spec \
-m68k-rtemself-$(GDBVERS).spec \
-mips64orion-rtems-$(GDBVERS).spec \
-powerpc-rtems-$(GDBVERS).spec \
-sh-rtems-$(GDBVERS).spec \
-sh-rtemself-$(GDBVERS).spec \
-sparc-rtems-$(GDBVERS).spec
-
-noinst_DATA = \
-$(TEMPLATES)
+RPM_SPECS_DATA = hppa1.1-rtems-$(GDBVERS).spec i386-rtems-$(GDBVERS).spec \
+ i960-rtems-$(GDBVERS).spec m68k-rtems-$(GDBVERS).spec \
+ m68k-rtemself-$(GDBVERS).spec mips64orion-rtems-$(GDBVERS).spec \
+ powerpc-rtems-$(GDBVERS).spec sh-rtems-$(GDBVERS).spec \
+ sh-rtemself-$(GDBVERS).spec sparc-rtems-$(GDBVERS).spec
+CLEANFILES += $(RPM_SPECS_DATA)
-EXTRA_DIST = \
-$(TEMPLATES)
+EXTRA_DIST = $(SUBPACKAGES)
-CLEANFILES = $(RPM_SPECS_DATA)
+include $(top_srcdir)/../automake/local.am
diff --git a/scripts/gdb/base-gdb.add b/scripts/gdb/base-gdb.add
index e69de29bb2..7447468d95 100644
--- a/scripts/gdb/base-gdb.add
+++ b/scripts/gdb/base-gdb.add
@@ -0,0 +1,55 @@
+# =====================================================================
+# rtems-base-gdb
+# =====================================================================
+
+%package -n rtems-base-gdb
+Provides: rtems-base-gdb
+Summary: base package for rtems gdb
+Group: rtems
+
+%description -n rtems-base-gdb
+
+RTEMS is an open source operating system for embedded systems.
+
+This is the base for gdb regardless of target CPU.
+
+%files -n rtems-base-gdb
+
+%dir /opt/rtems/info
+%doc /opt/rtems/info/gdb.info*
+%doc /opt/rtems/info/mmalloc.info*
+%doc /opt/rtems/info/readline.info*
+
+%dir /opt/rtems/man
+%dir /opt/rtems/man/man1
+
+%dir /opt/rtems/include
+# We install libbfd from binutils
+# /opt/rtems/include/bfd.h
+# /opt/rtems/include/bfdlink.h
+
+%dir /opt/rtems/lib
+# We install libbfd from binutils
+# /opt/rtems/lib/libbfd*
+# We use libiberty from gcc
+# /opt/rtems/lib/libiberty*
+
+%post -n rtems-base-gdb
+ if test -d $RPM_INSTALL_PREFIX/rtems/info;
+ then
+ rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
+ f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
+ test -n "$f" && for i in $f; do
+ install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
+ done
+ fi
+
+%postun -n rtems-base-gdb
+ if test -d $RPM_INSTALL_PREFIX/rtems/info;
+ then
+ rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
+ f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
+ test -n "$f" && for i in $f; do
+ install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
+ done
+ fi
diff --git a/scripts/gdb/gdb.add b/scripts/gdb/gdb.add
index e69de29bb2..a210e67061 100644
--- a/scripts/gdb/gdb.add
+++ b/scripts/gdb/gdb.add
@@ -0,0 +1,75 @@
+#
+# spec file for package rtems
+#
+# Copyright (c) 1999 OARCorp, Huntsville, AL
+#
+# please send bugfixes or comments to joel@OARcorp.com
+#
+
+# neededforbuild -- nothing
+
+Vendor: OAR Corporation
+Distribution: Linux
+Name: @target_alias@-gdb-collection
+Release: @Release@
+License: GPL/LGPL
+Group: rtems
+
+Autoreqprov: on
+Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com
+
+Version: @gdb_version@
+Summary: gdb for target @target_alias@
+Source0: ftp://ftp.gnu.org/pub/gnu/gdb-@gdb_version@.tar.gz
+Patch0: gdb-@gdb_version@-rtems-@gdb_patch_version@.diff
+Buildroot: /tmp/@target_alias@-gdb
+
+#
+# The original sources are not included in the source RPM.
+# If we included them, then the source RPMs for each target
+# would duplicate MBs of source unnecessarily. This is
+# a duplication of over 30 MBs of source for each of
+# the more than 10 targets it is possible to build.
+#
+# You can get them yourself from the Internet and copy them to
+# your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR).
+# Or you can try the ftp options of rpm :-)
+#
+NoSource: 0
+
+
+%description
+RTEMS is an open source operating system for embedded systems.
+
+This is the GNU gdb for RTEMS targetting @target_alias@.
+
+%prep
+echo RPM_BUILD_ROOT=${RPM_BUILD_ROOT}
+# untar the sources inside @target_alias@-gdb
+%setup -c -n @target_alias@-gdb -a 0
+
+%patch0 -p0
+
+%build
+test -d build || mkdir build
+ cd build
+ ../gdb-@gdb_version@/configure --target=@target_alias@ \
+ --verbose --prefix=/opt/rtems @extra_configure_arguments@
+
+ make all
+ make info
+
+%install
+ cd build
+ make prefix=$RPM_BUILD_ROOT/opt/rtems install
+ make prefix=$RPM_BUILD_ROOT/opt/rtems install-info
+
+ # gzip info files
+ gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info 2>/dev/null
+ gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-? 2>/dev/null
+ gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-?? 2>/dev/null
+
+%clean
+# let rpm --clean remove BuildRoot iif using the default BuildRoot
+ test "$RPM_BUILD_ROOT" = "/tmp/@target_alias@-gdb" && \
+ rm -rf $RPM_BUILD_ROOT
diff --git a/scripts/gdb/target-gdb.add b/scripts/gdb/target-gdb.add
index e69de29bb2..5def2d93e9 100644
--- a/scripts/gdb/target-gdb.add
+++ b/scripts/gdb/target-gdb.add
@@ -0,0 +1,21 @@
+# =====================================================================
+# @target_alias@-gdb
+# =====================================================================
+
+%package -n @target_alias@-gdb
+Provides: @target_alias@-gdb
+Summary: rtems gdb for @target_alias@
+Group: rtems
+Requires: rtems-base-gdb
+
+%description -n @target_alias@-gdb
+
+RTEMS is an open source operating system for embedded systems.
+
+This is the GNU gdb for RTEMS targetting @target_alias@.
+
+%files -n @target_alias@-gdb
+%doc /opt/rtems/man/man1/@target_alias@-gdb.1
+
+%dir /opt/rtems/bin
+/opt/rtems/bin/@target_alias@-gdb@exe_ext@
diff --git a/scripts/rtems/.cvsignore b/scripts/rtems/.cvsignore
index a0b0091404..8e68a95411 100644
--- a/scripts/rtems/.cvsignore
+++ b/scripts/rtems/.cvsignore
@@ -1,3 +1,4 @@
+*.spec
Makefile
Makefile.in
rtems.spec
diff --git a/scripts/rtems/Makefile.am b/scripts/rtems/Makefile.am
index d6cce0214d..e8a8026821 100644
--- a/scripts/rtems/Makefile.am
+++ b/scripts/rtems/Makefile.am
@@ -2,11 +2,12 @@
## $Id$
##
-AUTOMAKE_OPTIONS = foreign
+AUTOMAKE_OPTIONS = foreign 1.4
MKBSPSPEC = $(SHELL) $(top_builddir)/mkbspspec
-MKBSPSPEC_DEPS = $(top_builddir)/mkbspspec rtems.spec.in $(top_builddir)/setup.cache
+MKBSPSPEC_DEPS = $(top_builddir)/mkbspspec rtems.spec.in \
+ $(top_builddir)/setup.cache
hppa1.1-rtems-simhppa-$(BSPVERS).spec: $(MKBSPSPEC_DEPS)
$(MKBSPSPEC) -cfg $(top_builddir)/setup.cache -o . hppa1.1-rtems simhppa
@@ -38,25 +39,19 @@ sh-rtemself-gensh1-$(BSPVERS).spec: $(MKBSPSPEC_DEPS)
sparc-rtems-erc32-$(BSPVERS).spec: $(MKBSPSPEC_DEPS)
$(MKBSPSPEC) -cfg $(top_builddir)/setup.cache -o . sparc-rtems erc32
-TEMPLATES = \
-rtems.spec.in
+TEMPLATES = rtems.spec.in
-RPM_SPECS_DATA = \
-hppa1.1-rtems-simhppa-$(BSPVERS).spec \
-i386-rtems-pc386-$(BSPVERS).spec \
-i960-rtems-cvme961-$(BSPVERS).spec \
-m68k-rtems-gen68360-$(BSPVERS).spec \
-m68k-rtemself-gen68360-$(BSPVERS).spec \
-mips64orion-rtems-p4600-$(BSPVERS).spec \
-powerpc-rtems-mcp750-$(BSPVERS).spec \
-sh-rtems-gensh1-$(BSPVERS).spec \
-sh-rtemself-gensh1-$(BSPVERS).spec \
-sparc-rtems-erc32-$(BSPVERS).spec
+RPM_SPECS_DATA = hppa1.1-rtems-simhppa-$(BSPVERS).spec \
+ i386-rtems-pc386-$(BSPVERS).spec i960-rtems-cvme961-$(BSPVERS).spec \
+ m68k-rtems-gen68360-$(BSPVERS).spec \
+ m68k-rtemself-gen68360-$(BSPVERS).spec \
+ mips64orion-rtems-p4600-$(BSPVERS).spec \
+ powerpc-rtems-mcp750-$(BSPVERS).spec sh-rtems-gensh1-$(BSPVERS).spec \
+ sh-rtemself-gensh1-$(BSPVERS).spec sparc-rtems-erc32-$(BSPVERS).spec
-noinst_DATA = \
-$(TEMPLATES)
+noinst_DATA = $(TEMPLATES)
-EXTRA_DIST = \
-$(TEMPLATES)
+EXTRA_DIST = $(TEMPLATES)
CLEANFILES = $(RPM_SPECS_DATA)
+include $(top_srcdir)/../automake/local.am
diff --git a/scripts/rtems/rtems.spec.in b/scripts/rtems/rtems.spec.in
index f2ba46395b..a4cabaf055 100644
--- a/scripts/rtems/rtems.spec.in
+++ b/scripts/rtems/rtems.spec.in
@@ -10,7 +10,7 @@ Vendor: OAR Corporation
Distribution: Linux
Name: rtems-@target_alias@-@bsp@
Release: @Release@
-Copyright: 1999 OARCorp
+License: GPL with special exception for linking with application program
Group: unsorted
Provides: rtems-@target_alias@-@bsp@
diff --git a/scripts/setup.def b/scripts/setup.def
index 62b02bf5ab..acb574d86b 100644
--- a/scripts/setup.def
+++ b/scripts/setup.def
@@ -7,13 +7,13 @@ binutils_version=2.9.5.0.24
binutils_patch_version=20000207
binutils_rpm_release=1
newlib_version=1.8.2
-newlib_patch_version=20000131
+newlib_patch_version=20000606
gcc_version=2.95.2
-gcc_patch_version=20000106
-gccnewlib_rpm_release=4
+gcc_patch_version=20000531
+gccnewlib_rpm_release=7
gdb_version=4.18
-gdb_patch_version=20000126
-gdb_rpm_release=2
-rtems_version=19991117
+gdb_patch_version=20000524
+gdb_rpm_release=4
+rtems_version=rtems-4.5.0-beta3a
rtems_rpm_release=1
rpm_build_root=/tmp