summaryrefslogtreecommitdiffstats
path: root/scripts-ada
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-01-26 19:56:54 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-01-26 19:56:54 +0000
commit64ab2e9eeb87a3ea1c48cea6d74647155f5e0e44 (patch)
tree6fa94e466a217c7bebb855ccd0e52174e5d02c18 /scripts-ada
parentNo longer incorrectly references mips. (diff)
downloadrtems-64ab2e9eeb87a3ea1c48cea6d74647155f5e0e44.tar.bz2
First cut at adding RPM scripts for building GNAT/RTEMS RPMs.
Diffstat (limited to '')
-rw-r--r--scripts-ada/Makefile.am28
-rw-r--r--scripts-ada/README5
-rw-r--r--scripts-ada/TODO6
-rw-r--r--scripts-ada/binutils/Makefile.am61
-rw-r--r--scripts-ada/binutils/binutils.spec.in187
-rw-r--r--scripts-ada/buildall.in192
-rw-r--r--scripts-ada/configure.in51
-rw-r--r--scripts-ada/gdb/Makefile.am59
-rw-r--r--scripts-ada/gdb/gdb.spec.in144
-rw-r--r--scripts-ada/gnatnewlib/Makefile.am61
-rw-r--r--scripts-ada/gnatnewlib/gnatnewlib.spec.in296
-rwxr-xr-xscripts-ada/install-sh251
-rwxr-xr-xscripts-ada/missing190
-rw-r--r--scripts-ada/mkbinutilspec.in62
-rw-r--r--scripts-ada/mkbspspec.in62
-rw-r--r--scripts-ada/mkgdbspec.in88
-rw-r--r--scripts-ada/mkgnatnewlibspec.in71
-rwxr-xr-xscripts-ada/mkinstalldirs40
-rw-r--r--scripts-ada/mkrpms32
-rw-r--r--scripts-ada/mkspec19
-rwxr-xr-xscripts-ada/setup104
-rw-r--r--scripts-ada/setup.def17
22 files changed, 2026 insertions, 0 deletions
diff --git a/scripts-ada/Makefile.am b/scripts-ada/Makefile.am
new file mode 100644
index 0000000000..82d4c9e667
--- /dev/null
+++ b/scripts-ada/Makefile.am
@@ -0,0 +1,28 @@
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = . binutils gnatnewlib gdb rtems
+
+noinst_SCRIPTS = \
+setup \
+buildall \
+mkbinutilspec \
+mkbspspec \
+mkgnatnewlibspec \
+mkgdbspec \
+mkrpms \
+mkspec
+
+TEMPLATES =
+
+noinst_DATA = \
+setup.def $(TEMPLATES)
+
+EXTRA_DIST = \
+$(noinst_DATA) \
+$(noinst_SCRIPTS)
+
+CONFIGURE_DEPENDENCIES = setup.cache
+setup.cache: setup.def
+ cp setup.def $@
+
+DISTCLEANFILES = setup.cache
diff --git a/scripts-ada/README b/scripts-ada/README
new file mode 100644
index 0000000000..fa00e62420
--- /dev/null
+++ b/scripts-ada/README
@@ -0,0 +1,5 @@
+#
+# $Id$
+#
+
+This directory contains the scripts used to build RPMS for GNAT/RTEMS.
diff --git a/scripts-ada/TODO b/scripts-ada/TODO
new file mode 100644
index 0000000000..f51576d11f
--- /dev/null
+++ b/scripts-ada/TODO
@@ -0,0 +1,6 @@
+#
+# $Id$
+#
+
+There is plenty left to do on this :)
+
diff --git a/scripts-ada/binutils/Makefile.am b/scripts-ada/binutils/Makefile.am
new file mode 100644
index 0000000000..83556b88b5
--- /dev/null
+++ b/scripts-ada/binutils/Makefile.am
@@ -0,0 +1,61 @@
+## $Id$
+
+AUTOMAKE_OPTIONS = foreign
+
+MKBINUTILSSPEC = $(SHELL) $(top_builddir)/mkbinutilspec
+
+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
+
+i386-rtems-$(BINUTILSVERS).spec: $(MKBINUTILSSPEC_DEPS)
+ $(MKBINUTILSSPEC) -cfg $(top_builddir)/setup.cache -o . i386-rtems
+
+i960-rtems-$(BINUTILSVERS).spec: $(MKBINUTILSSPEC_DEPS)
+ $(MKBINUTILSSPEC) -cfg $(top_builddir)/setup.cache -o . i960-rtems
+
+m68k-rtems-$(BINUTILSVERS).spec: $(MKBINUTILSSPEC_DEPS)
+ $(MKBINUTILSSPEC) -cfg $(top_builddir)/setup.cache -o . m68k-rtems
+
+m68k-rtemself-$(BINUTILSVERS).spec: $(MKBINUTILSSPEC_DEPS)
+ $(MKBINUTILSSPEC) -cfg $(top_builddir)/setup.cache -o . m68k-rtemself
+
+mips64orion-rtems-$(BINUTILSVERS).spec: $(MKBINUTILSSPEC_DEPS)
+ $(MKBINUTILSSPEC) -cfg $(top_builddir)/setup.cache -o . mips64orion-rtems
+
+powerpc-rtems-$(BINUTILSVERS).spec: $(MKBINUTILSSPEC_DEPS)
+ $(MKBINUTILSSPEC) -cfg $(top_builddir)/setup.cache -o . powerpc-rtems
+
+sh-rtems-$(BINUTILSVERS).spec: $(MKBINUTILSSPEC_DEPS)
+ $(MKBINUTILSSPEC) -cfg $(top_builddir)/setup.cache -o . sh-rtems
+
+sh-rtemself-$(BINUTILSVERS).spec: $(MKBINUTILSSPEC_DEPS)
+ $(MKBINUTILSSPEC) -cfg $(top_builddir)/setup.cache -o . sh-rtemself
+
+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)
+
+EXTRA_DIST = \
+$(TEMPLATES)
+
+CLEANFILES = $(RPM_SPECS_DATA)
diff --git a/scripts-ada/binutils/binutils.spec.in b/scripts-ada/binutils/binutils.spec.in
new file mode 100644
index 0000000000..2795d11a09
--- /dev/null
+++ b/scripts-ada/binutils/binutils.spec.in
@@ -0,0 +1,187 @@
+#
+# spec file for binutils package targetting rtems
+#
+# Copyright (c) 1999 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@
+Copyright: 1999 OARCorp
+
+Provides: rtems-base-binutils @target_alias@-binutils
+
+Autoreqprov: on
+Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com
+Prefix: /opt
+
+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.
+
+%package -n 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.
+
+%package -n @target_alias@-binutils
+Summary: rtems binutils for @target_alias@
+Group: rtems
+Requires: rtems-base-binutils
+
+%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@.
+
+Authors:
+--------
+ Joel Sherrill (joel@oarcorp.com)
+ ...
+
+%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
+
+%post
+ 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
+ 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
+
+%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-ada/buildall.in b/scripts-ada/buildall.in
new file mode 100644
index 0000000000..845c493caa
--- /dev/null
+++ b/scripts-ada/buildall.in
@@ -0,0 +1,192 @@
+#! /bin/sh
+#
+# Generate all the specs and then cycle through building them.
+#
+
+RTEMS_DIR=`dirname $0`
+CFG=./setup.cache
+dst=@RPM_SPECSdir@
+
+usage()
+{
+ echo "$0 [options] <target_alias>"
+ echo " options:"
+ echo " -cfg <setup.cache>"
+ echo " -o <rpm-spec-dir>"
+ exit 1 ;
+}
+
+while test $# -ge 1; do
+ case $1 in
+ -cfg)
+ test $# -ge 2 || usage
+ shift
+ CFG=$1
+ shift
+ ;;
+ -o)
+ test $# -ge 2 || usage
+ shift
+ dst=$1
+ shift
+ ;;
+ -*)
+ echo "invalid option $1";
+ usage
+ ;;
+ *)
+ TARGETS="${TARGETS} $1"
+ shift
+ ;;
+ esac
+done
+
+# 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 \
+# powerpc-rtems sh-rtems sh-rtemself sparc-rtems"
+
+# This is the full buildable set.
+if [ "X${TARGETS}" = "X" ] ; then
+ TARGETS="i386-rtems i960-rtems m68k-rtems \
+ mips64orion-rtems powerpc-rtems sh-rtems sparc-rtems"
+fi
+
+. $CFG
+
+binutils=${binutils_version}
+gcc=${gcc_version}
+gdb=${gdb_version}
+newlib=${newlib_version}
+# also use binutils_rpm_release
+buildroot=/tmp
+
+testing=no
+do_binutils=yes
+do_gnatnewlib=yes
+do_gdb=yes
+
+#
+# Now get started
+#
+start=`date`
+
+echo PATH=$PATH
+
+if [ ${testing} = yes ] ; then
+ ECHO=echo
+fi
+
+installed_count=`rpm -qa | grep 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:
+ echo
+ rpm -qa | grep rtems
+ echo
+ echo Please remove these and restart this script.
+ exit 1
+fi
+
+echo Copying specs files.
+if [ ${testing} = no ] ; then
+ cd ${RTEMS_DIR}
+
+ # ./configure || exit 1
+ make || exit 1
+
+ # Now generate all the specs
+ for target in ${TARGETS}
+ do
+ tspecs=`find . -name "${target}*"`
+ if [ "X${tspecs}" = "X" ] ; then
+ echo RPM specifications were not generated for ${tspec}.
+ exit 1
+ fi
+ ${ECHO} cp -r ${tspecs} ${dst}
+ done
+fi
+
+# clean up a bit before we start
+cd ${dst}
+test -d log || mkdir log
+
+# do all the tools
+for target in ${TARGETS}
+do
+ if [ ${do_binutils} = yes ] ; then
+ logfile=log/${target}-binutils
+ specfile=${dst}/${target}-binutils-${binutils}.spec
+ echo "rpm -ba ${specfile} >${logfile} 2>&1"
+ if [ ${testing} = no ] ; then
+ rpm -ba ${specfile} >${logfile} 2>&1
+ fi
+ ${ECHO} rm -rf ${dst}/../BUILD/${target}-binutils*
+ ${ECHO} rm -rf ${buildroot}/opt/rtems
+ else
+ echo Skipping binutils for ${target}
+ fi
+
+ #
+ # build gcc/newlib
+ #
+
+ if [ ${do_gnatnewlib} = yes ] ; then
+ # 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
+ if [ ! -f ${binutils_rpm} ] ; then
+ echo There is no RPM for binutils for ${target}.
+ echo Looked for ${binutils_rpm}.
+ fi
+ ${ECHO} rpm -i ${base_binutils_rpm}
+ ${ECHO} rpm -i ${binutils_rpm}
+
+ logfile=log/${target}-gnatnewlib
+ specfile=${dst}/${target}-gcc-${gcc}-newlib-${newlib}.spec
+ echo "rpm -ba ${specfile} >${logfile} 2>&1"
+ if [ ${testing} = no ] ; then
+ rpm -ba ${specfile} >${logfile} 2>&1
+ fi
+ ${ECHO} rm -rf ${dst}/../BUILD/${target}-gcc*
+ ${ECHO} rm -rf ${buildroot}/opt/rtems
+
+ echo uninstalling binutils for ${target}
+ if [ ${testing} = no ] ; then
+ rpm -e `rpm -qa | grep rtems`
+ rm -rf /opt/rtems/*
+ fi
+ else
+ echo Skipping gcc/newlib for ${target}
+ fi
+
+ #
+ # build gdb
+ #
+
+ if [ ${do_gdb} = yes ] ; then
+ # now build gdb
+ logfile=log/${target}-gdb
+ specfile=${dst}/${target}-gdb-${gdb}.spec
+ echo "rpm -ba ${specfile} >${logfile} 2>&1"
+ if [ ${testing} = no ] ; then
+ rpm -ba ${specfile} >${logfile} 2>&1
+ fi
+ ${ECHO} rm -rf ${dst}/../BUILD/${target}-gdb*
+ ${ECHO} rm -rf ${buildroot}/opt/rtems
+ else
+ echo Skipping gdb for ${target}
+ fi
+
+done
+
+# Now we are done
+
+stop=`date`
+
+echo
+echo "Started: " $start
+echo "Finished: " $stop
+exit 0
diff --git a/scripts-ada/configure.in b/scripts-ada/configure.in
new file mode 100644
index 0000000000..d09ed57f4b
--- /dev/null
+++ b/scripts-ada/configure.in
@@ -0,0 +1,51 @@
+## $Id$
+
+AC_INIT(binutils)
+AM_INIT_AUTOMAKE(scripts,20000125-0,no)
+
+AC_EXEEXT
+
+test -f ./setup.cache || cp ${srcdir}/setup.def ./setup.cache
+. ./setup.cache
+
+# Some linux distributions use /usr/src/packages
+# redhat uses /usr/src/redhat
+# others might use /usr/src
+AC_MSG_CHECKING(for rpm SPECS directory)
+if test -d /usr/src/packages/SPECS;
+then
+ RPM_SPECSdir=/usr/src/packages/SPECS;
+elif test -d /usr/src/redhat/SPECS;
+then
+ RPM_SPECSdir=/usr/src/redhat/SPECS;
+elif test -d /usr/src/SPECS/;
+then
+ RPM_SPECSdir=/usr/src/SPECS;
+fi
+if test x"$RPM_SPECSdir" = x"" ; then
+AC_MSG_ERROR(not found)
+fi
+AC_MSG_RESULT($RPM_SPECSdir)
+AC_SUBST(RPM_SPECSdir)
+
+GCCNEWLIBVERS="gcc-${gcc_version}-newlib-${newlib_version}"
+AC_SUBST(GCCNEWLIBVERS)
+BINUTILSVERS="binutils-${binutils_version}"
+AC_SUBST(BINUTILSVERS)
+GDBVERS="gdb-${gdb_version}"
+AC_SUBST(GDBVERS)
+BSPVERS="${rtems_version}"
+AC_SUBST(RTEMS_VERSION)
+AC_SUBST(BSPVERS)
+
+AC_OUTPUT(
+Makefile
+buildall
+mkbinutilspec
+mkgnatnewlibspec
+mkgdbspec
+mkbspspec
+binutils/Makefile
+gnatnewlib/Makefile
+gdb/Makefile
+)
diff --git a/scripts-ada/gdb/Makefile.am b/scripts-ada/gdb/Makefile.am
new file mode 100644
index 0000000000..74782485cb
--- /dev/null
+++ b/scripts-ada/gdb/Makefile.am
@@ -0,0 +1,59 @@
+AUTOMAKE_OPTIONS = foreign
+
+MKGDBSPEC = $(SHELL) $(top_builddir)/mkgdbspec
+
+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
+
+i386-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS)
+ $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . i386-rtems
+
+i960-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS)
+ $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . i960-rtems
+
+m68k-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS)
+ $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . m68k-rtems
+
+m68k-rtemself-$(GDBVERS).spec: $(MKGDBSPEC_DEPS)
+ $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . m68k-rtemself
+
+mips64orion-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS)
+ $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . mips64orion-rtems
+
+powerpc-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS)
+ $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . powerpc-rtems
+
+sh-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS)
+ $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . sh-rtems
+
+sh-rtemself-$(GDBVERS).spec: $(MKGDBSPEC_DEPS)
+ $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . sh-rtemself
+
+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)
+
+EXTRA_DIST = \
+$(TEMPLATES)
+
+CLEANFILES = $(RPM_SPECS_DATA)
diff --git a/scripts-ada/gdb/gdb.spec.in b/scripts-ada/gdb/gdb.spec.in
new file mode 100644
index 0000000000..0e8c005556
--- /dev/null
+++ b/scripts-ada/gdb/gdb.spec.in
@@ -0,0 +1,144 @@
+#
+# 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@
+Copyright: 1999 OARCorp
+Group: rtems
+Provides: rtems-base-gdb @target_alias@-gdb
+
+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
+#
+# 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@.
+
+%package -n 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.
+
+%package -n @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@.
+
+Authors:
+--------
+ Joel Sherrill (joel@oarcorp.com)
+ ...
+
+
+%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
+
+%post
+ 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
+ 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
+
+%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*
+
+%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-ada/gnatnewlib/Makefile.am b/scripts-ada/gnatnewlib/Makefile.am
new file mode 100644
index 0000000000..60d7f0cc93
--- /dev/null
+++ b/scripts-ada/gnatnewlib/Makefile.am
@@ -0,0 +1,61 @@
+## $Id$
+
+AUTOMAKE_OPTIONS = foreign
+
+MKGNATNEWLIBSPEC = $(SHELL) $(top_builddir)/mkgnatnewlibspec
+
+MKGNATNEWLIBSPEC_DEPS = \
+ $(top_builddir)/mkgnatnewlibspec gnatnewlib.spec.in $(top_builddir)/setup.cache
+
+hppa1.1-rtems-$(GNATNEWLIBVERS).spec: $(MKGNATNEWLIBSPEC_DEPS)
+ $(MKGNATNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . hppa1.1-rtems
+
+i386-rtems-$(GNATNEWLIBVERS).spec: $(MKGNATNEWLIBSPEC_DEPS)
+ $(MKGNATNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . i386-rtems
+
+i960-rtems-$(GNATNEWLIBVERS).spec: $(MKGNATNEWLIBSPEC_DEPS)
+ $(MKGNATNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . i960-rtems
+
+m68k-rtems-$(GNATNEWLIBVERS).spec: $(MKGNATNEWLIBSPEC_DEPS)
+ $(MKGNATNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . m68k-rtems
+
+m68k-rtemself-$(GNATNEWLIBVERS).spec: $(MKGNATNEWLIBSPEC_DEPS)
+ $(MKGNATNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . m68k-rtemself
+
+mips64orion-rtems-$(GNATNEWLIBVERS).spec: $(MKGNATNEWLIBSPEC_DEPS)
+ $(MKGNATNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . mips64orion-rtems
+
+powerpc-rtems-$(GNATNEWLIBVERS).spec: $(MKGNATNEWLIBSPEC_DEPS)
+ $(MKGNATNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . powerpc-rtems
+
+sh-rtems-$(GNATNEWLIBVERS).spec: $(MKGNATNEWLIBSPEC_DEPS)
+ $(MKGNATNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . sh-rtems
+
+sh-rtemself-$(GNATNEWLIBVERS).spec: $(MKGNATNEWLIBSPEC_DEPS)
+ $(MKGNATNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . sh-rtemself
+
+sparc-rtems-$(GNATNEWLIBVERS).spec: $(MKGNATNEWLIBSPEC_DEPS)
+ $(MKGNATNEWLIBSPEC) -cfg $(top_builddir)/setup.cache -o . sparc-rtems
+
+TEMPLATES = \
+gnatnewlib.spec.in
+
+RPM_SPECS_DATA = \
+hppa1.1-rtems-$(GNATNEWLIBVERS).spec \
+i386-rtems-$(GNATNEWLIBVERS).spec \
+i960-rtems-$(GNATNEWLIBVERS).spec \
+m68k-rtems-$(GNATNEWLIBVERS).spec \
+m68k-rtemself-$(GNATNEWLIBVERS).spec \
+mips64orion-rtems-$(GNATNEWLIBVERS).spec \
+powerpc-rtems-$(GNATNEWLIBVERS).spec \
+sh-rtems-$(GNATNEWLIBVERS).spec \
+sh-rtemself-$(GNATNEWLIBVERS).spec \
+sparc-rtems-$(GNATNEWLIBVERS).spec
+
+noinst_DATA = \
+$(TEMPLATES)
+
+EXTRA_DIST = \
+$(TEMPLATES)
+
+CLEANFILES = $(RPM_SPECS_DATA)
diff --git a/scripts-ada/gnatnewlib/gnatnewlib.spec.in b/scripts-ada/gnatnewlib/gnatnewlib.spec.in
new file mode 100644
index 0000000000..dae219949f
--- /dev/null
+++ b/scripts-ada/gnatnewlib/gnatnewlib.spec.in
@@ -0,0 +1,296 @@
+#
+# spec file for building gcc for rtems
+#
+# Copyright (c) 1999 OARCorp, Huntsville, AL
+#
+# please send bugfixes or comments to joel@OARcorp.com
+#
+
+Vendor: OAR Corporation
+Distribution: Linux
+Name: @target_alias@-gnat-gcc-newlib
+Summary: gnat, gcc, and newlib C Library for @target_alias@.
+Group: rtems
+Release: @Release@
+Copyright: 1999 OARCorp
+
+Provides: rtems-base-gnat @target_alias@-gnat
+Requires: @target_alias@-binutils
+
+Autoreqprov: on
+Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com
+
+Version: gnat@gnat_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
+Source2: ftp://cs.nyu.edu/pub/gnat/gnat-@gnat_version@.tar.gz
+Patch0: gcc-@gcc_version@-gnatrtems-@gcc_patch_version@.diff
+Patch1: newlib-@newlib_version@-rtems-@newlib_patch_version@.diff
+Buildroot: /tmp
+
+#
+# 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, 1, 2
+
+%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/SOURCES directory ($RPM_SOURCE_DIR).
+ Or you can try the ftp options of rpm :-)
+
+%package -n rtems-base-gnat
+Summary: base package for rtems gnat, gcc, and newlib C Library
+Group: rtems
+
+%description -n rtems-base-gnat
+
+RTEMS is an open source operating system for embedded systems.
+
+This is the files for gnat, gcc, and newlib that are shared by all targets.
+
+%package -n @target_alias@-gnat
+Summary: rtems gnat, gcc, and newlib C Library for @target_alias@
+Group: rtems
+Requires: @target_alias@-binutils rtems-base-gcc
+
+%description -n @target_alias@-gnat
+RTEMS is an open source operating system for embedded systems.
+
+This is gnat, gcc, and newlib C Library for @target_alias@.
+
+
+%prep
+# untar the sources inside @target_alias@-gcc-newlib
+%setup -c -n @target_alias@-gcc-newlib -a 0 -a 1 -a 2
+
+%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
+
+ cp -r ../gnat-@gnat_version@-src/src/ada gcc-@gcc_version@
+
+%patch2 -p0
+
+ touch gcc-@gcc_version@/ada/treeprs.ads
+ touch gcc-@gcc_version@/ada/a-[es]info.h
+ touch gcc-@gcc_version@/ada/nmake.ad[bs]
+
+%build
+ cd build
+ ../gcc-@gcc_version@/configure --target=@target_alias@ \
+ --with-gnu-as --with-gnu-ld --with-newlib --verbose \
+ --prefix=/opt/rtems
+
+ # for now we are building all the languages
+ # '--enable-languages=c,c++'
+
+ make all
+ make info
+
+# Since gcc now finds the RTEMS limits.h, this should not be needed
+# cd gcc
+# rm -f stmp-multilib
+# find . -name "*.a" -print | xargs -e rm -f
+#
+# make all
+# cd ..
+
+%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="$RPM_BUILD_ROOT/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@"
+ find $TGTDIR \
+ \( -type d -a ! -path "$TGTDIR/include*" \) -print | \
+ sed -e "s,^$RPM_BUILD_ROOT,%dir ,g" >> dirs
+
+ # 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 $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
+
+%files -n @target_alias@-gcc -f build/files.gcc
+%dir /opt/rtems/info
+%doc /opt/rtems/info/dir
+%doc /opt/rtems/info/cpp.info*
+%doc /opt/rtems/info/gcc.info*
+%doc /opt/rtems/info/libc.info*
+%doc /opt/rtems/info/libm.info*
+
+%dir /opt/rtems/man
+%dir /opt/rtems/man/man1
+%doc /opt/rtems/man/man1/cccp.1
+%doc /opt/rtems/man/man1/@target_alias@-gcc.1
+%doc /opt/rtems/man/man1/@target_alias@-g++.1
+
+%dir /opt/rtems/bin
+/opt/rtems/bin/cpp@exe_ext@
+/opt/rtems/bin/gcov@exe_ext@
+/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
+
+%dir /opt/rtems/include
+/opt/rtems/include/g++-3
+/opt/rtems/@target_alias@
+
+%post -n @target_alias@-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 @target_alias@-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
+
+
+%files -n @target_alias@-chill -f build/files.chill
+%dir /opt/rtems/bin
+/opt/rtems/bin/@target_alias@-chill@exe_ext@
+
+%dir /opt/rtems/info
+%doc /opt/rtems/info/dir
+%doc /opt/rtems/info/chill.info*
+
+%post -n @target_alias@-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 @target_alias@-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
+
+
+%files -n @target_alias@-gcj -f build/files.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@
+/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@
+
+
+%files -n @target_alias@-g77 -f build/files.g77
+%dir /opt/rtems/bin
+/opt/rtems/bin/@target_alias@-g77@exe_ext@
+
+%dir /opt/rtems/info
+%doc /opt/rtems/info/g77.info*
+
+%dir /opt/rtems/man
+%dir /opt/rtems/man/man1
+%doc /opt/rtems/man/man1/@target_alias@-g77.1
+
+/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/f771@exe_ext@
+
+%post -n @target_alias@-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 @target_alias@-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
+
+
+%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-ada/install-sh b/scripts-ada/install-sh
new file mode 100755
index 0000000000..e9de23842d
--- /dev/null
+++ b/scripts-ada/install-sh
@@ -0,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/scripts-ada/missing b/scripts-ada/missing
new file mode 100755
index 0000000000..7789652e87
--- /dev/null
+++ b/scripts-ada/missing
@@ -0,0 +1,190 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+case "$1" in
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing - GNU libit 0.0"
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+ aclocal)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acinclude.m4' or \`configure.in'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`configure.in'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acconfig.h' or \`configure.in'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ fi
+ touch $file
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequirements for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/scripts-ada/mkbinutilspec.in b/scripts-ada/mkbinutilspec.in
new file mode 100644
index 0000000000..d2adf3bd56
--- /dev/null
+++ b/scripts-ada/mkbinutilspec.in
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# Usage: mkbinutilspec CPU
+#
+
+RTEMS_DIR=`dirname $0`/@top_srcdir@
+
+CFG=setup.cache
+dst=@RPM_SPECSdir@
+exe_ext=@EXEEXT@
+
+usage()
+{
+ echo "$0 [options] <target_alias>"
+ echo " options:"
+ echo " -cfg <setup.cache>"
+ 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
+
+. ./$CFG
+
+specfile=${dst}/$target_alias-binutils-${binutils_version}.spec
+
+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%@binutils_version@%${binutils_version}%g" \
+ -e "s%@binutils_patch_version@%${binutils_patch_version}%g" \
+ -e "s%@exe_ext@%${exe_ext}%g" \
+< ${RTEMS_DIR}/binutils/binutils.spec.in \
+> ${specfile}
+
+echo Generated ${specfile}
diff --git a/scripts-ada/mkbspspec.in b/scripts-ada/mkbspspec.in
new file mode 100644
index 0000000000..02edf02dc8
--- /dev/null
+++ b/scripts-ada/mkbspspec.in
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+
+RTEMS_DIR=`dirname $0`/@top_srcdir@
+RTEMS_VERSION=@RTEMS_VERSION@
+
+CFG=setup.cache
+dst=@RPM_SPECSdir@
+exe_ext=@EXEEXT@
+
+usage()
+{
+ echo "$0 [options] <target_alias> <bsp>"
+ echo " options:"
+ echo " -cfg <setup.cache>"
+ echo " -o <rpm-spec-dir>"
+ exit 1 ;
+}
+
+while test $# -ge 3; do
+case $1 in
+-cfg)
+ shift
+ CFG=$1
+ shift
+ ;;
+-o)
+ shift
+ dst=$1
+ shift
+ ;;
+-*)
+ echo "invalid option $1";
+ usage
+ ;;
+esac
+done
+
+if test ! $# -eq 2;
+then
+ echo "Invalid number of arguments"
+ usage
+fi
+
+# target to build for
+target_alias=$1
+bsp=$2
+
+. ./$CFG
+
+specfile=${dst}/$target_alias-$bsp-${rtems_version}.spec
+
+sed -e "s%@Release@%${rtems_rpm_release}%g" \
+ -e "s%@bsp@%${bsp}%g" \
+ -e "s%@rtems_version@%${rtems_version}%g" \
+ -e "s%@rpm_build_root@%${rpm_build_root}%g" \
+ -e "s%@target_alias@%${target_alias}%g" \
+ -e "s%@exe_ext@%${exe_ext}%g" \
+< ${RTEMS_DIR}/rtems/rtems.spec.in \
+> ${specfile}
+
+echo Generated ${specfile}
diff --git a/scripts-ada/mkgdbspec.in b/scripts-ada/mkgdbspec.in
new file mode 100644
index 0000000000..1b38b83a4c
--- /dev/null
+++ b/scripts-ada/mkgdbspec.in
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# Usage: mkgdbspec CPU
+#
+
+RTEMS_DIR=`dirname $0`/@top_srcdir@
+
+CFG=setup.cache
+dst=@RPM_SPECSdir@
+exe_ext=@EXEEXT@
+
+usage()
+{
+ echo "$0 [options] <target_alias>"
+ echo " options:"
+ echo " -cfg <setup.cache>"
+ 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
+
+. ./$CFG
+
+specfile=${dst}/$target_alias-gdb-${gdb_version}.spec
+
+case ${target_alias} in
+ powerpc*)
+ extra_configure_arguments="--enable-sim --enable-sim-powerpc --enable-sim-timebase --enable-sim-hardware"
+ # Enabling this causes the program image to be huge and causes
+ # some gcc/hosts combinations to run out of memory.
+ # --enable-sim-inline
+ ;;
+ sparc*)
+ extra_configure_arguments="--enable-sim"
+ ;;
+ *)
+ ;;
+esac
+
+sed -e "s%@Release@%${gdb_rpm_release}%g" \
+ -e "s%@rpm_build_root@%${rpm_build_root}%g" \
+ -e "s%@target_alias@%${target_alias}%g" \
+ -e "s%@gdb_version@%${gdb_version}%g" \
+ -e "s%@gdb_patch_version@%${gdb_patch_version}%g" \
+ -e "s%@extra_configure_arguments@%${extra_configure_arguments}%g" \
+ -e "s%@exe_ext@%${exe_ext}%g" \
+< ${RTEMS_DIR}/gdb/gdb.spec.in \
+> ${specfile}
+
+case ${target_alias} in
+ powerpc*)
+ echo "/opt/rtems/bin/${target_alias}-run${exe_ext}"
+ ;;
+ sparc*)
+ echo "/opt/rtems/bin/${target_alias}-run${exe_ext}"
+ echo "/opt/rtems/bin/${target_alias}-sis${exe_ext}"
+ ;;
+ *) ;;
+esac >> ${specfile}
+
+echo Generated ${specfile}
diff --git a/scripts-ada/mkgnatnewlibspec.in b/scripts-ada/mkgnatnewlibspec.in
new file mode 100644
index 0000000000..cea5cc1b03
--- /dev/null
+++ b/scripts-ada/mkgnatnewlibspec.in
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# Usage: mktoolspec CPU
+#
+
+RTEMS_DIR=`dirname $0`/@top_srcdir@
+
+CFG=setup.cache
+dst=@RPM_SPECSdir@
+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}/gnatnewlib/gnatnewlib.spec.in
+
+while test $# -ge 2; do
+case $1 in
+-cfg)
+ shift
+ CFG=$1
+ shift
+ ;;
+-o)
+ shift
+ dst=$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
+
+specfile=${dst}/$target_alias-gcc-${gcc_version}-newlib-${newlib_version}.spec
+
+sed -e "s%@Release@%${gnatnewlib_rpm_release}%g" \
+ -e "s%@target_alias@%${target_alias}%g" \
+ -e "s%@rpm_build_root@%${rpm_build_root}%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" \
+ -e "s%@exe_ext@%${exe_ext}%g" \
+< ${specsrc} \
+> ${specfile}
+
+echo Generated ${specfile}.
diff --git a/scripts-ada/mkinstalldirs b/scripts-ada/mkinstalldirs
new file mode 100755
index 0000000000..6b3b5fc5d4
--- /dev/null
+++ b/scripts-ada/mkinstalldirs
@@ -0,0 +1,40 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id$
+
+errstatus=0
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
diff --git a/scripts-ada/mkrpms b/scripts-ada/mkrpms
new file mode 100644
index 0000000000..72e9bae494
--- /dev/null
+++ b/scripts-ada/mkrpms
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+#
+# A simple shell script to build several rpms in a row.
+#
+# Used for testing rtems.spec.in
+#
+
+# 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
+
+./mkspec pc386 i386-rtems
+rpm -ba $dst/rtems-i386-rtems-pc386.spec
+
+./mkspec gensh1 sh-rtemself
+rpm -ba $dst/rtems-sh-rtemself-gensh1.spec
+
+./mkspec mcp750 powerpc-rtems
+rpm -ba $dst/rtems-powerpc-rtems-mcp750.spec
+
+
diff --git a/scripts-ada/mkspec b/scripts-ada/mkspec
new file mode 100644
index 0000000000..93d8f25017
--- /dev/null
+++ b/scripts-ada/mkspec
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+
+RTEMS_DIR=`dirname $0`
+RTEMS_VERSION=`grep Version ${RTEMS_DIR}/../VERSION | \
+sed -e 's%RTEMS[ ]*Version[ ]*\(.*\)[ ]*%\1%g'`
+
+target_alias=$1
+bsp=$2
+release=0
+
+#${RTEMS_DIR}/scripts/mkbspspec $bsp $target_alias
+#${RTEMS_DIR}/scripts/mkbinutilspec $target_alias
+#${RTEMS_DIR}/scripts/mkgnatnewlibspec $target_alias
+#${RTEMS_DIR}/scripts/mkgdbspec $target_alias
+./mkbinutilspec $target_alias
+./mkgnatnewlibspec $target_alias
+./mkgdbspec $target_alias
+
diff --git a/scripts-ada/setup b/scripts-ada/setup
new file mode 100755
index 0000000000..cc0f1d4e18
--- /dev/null
+++ b/scripts-ada/setup
@@ -0,0 +1,104 @@
+#!/bin/bash
+
+CFG=setup.cache
+
+# RTEMS tools setup
+
+if test ! -f ./$CFG;
+then
+ echo -n "restoring default setup.cache .."
+ cp ./setup.def ./$CFG
+ echo " done"
+fi
+
+echo -n "loading setup from ./$CFG .."
+. ./$CFG
+echo " done"
+echo
+
+menu_setup()
+{
+while true;
+do
+ echo
+ echo " GNAT/RTEMS Source packages setup"
+ echo
+ echo "0 binutils version : $binutils_version"
+ echo "1 binutils patch version : $binutils_patch_version"
+ echo "2 binutils rpm release : $binutils_rpm_release"
+ echo "3 gcc version : $gcc_version"
+ echo "4 gcc patch version : $gcc_patch_version"
+ echo "5 gnat version : $gnat_version"
+ echo "6 gnat patch version : $gnat_patch_version"
+ echo "7 newlib version : $newlib_version"
+ echo "8 newlib patch version : $newlib_patch_version"
+ echo "9 gnat/newlib rpm release : $gccnewlib_rpm_release"
+ echo "a gdb version : $gdb_version"
+ echo "b gdb patch version : $gdb_patch_version"
+ echo "c gdb rpm release : $gdb_rpm_release"
+ echo "d rtems version : $rtems_version"
+ echo "e rtems rpm release : $rtems_rpm_release"
+ echo "f rpm build root : $rpm_build_root"
+ echo
+
+ echo -n "[0-9a-f] or any other key to quit >"
+ read sel
+ case $sel in
+ 0) echo -n "BINUTILS source >" ; read binutils_version ;;
+ 1) echo -n "BINUTILS patch version >" ; read binutils_patch_version ;;
+ 2) echo -n "BINUTILS RPM release >" ; read binutils_rpm_release ;;
+ 3) echo -n "GCC source >" ; read gcc_version ;;
+ 4) echo -n "GCC patch version>" ; read gcc_patch_version ;;
+ 5) echo -n "GNAT source >" ; read gnat_version ;;
+ 6) echo -n "GNAT patch version>" ; read gnat_patch_version ;;
+ 7) echo -n "NEWLIB source >" ; read newlib_version ;;
+ 8) echo -n "NEWLIB patch version>" ; read newlib_patch_version ;;
+ 9) echo -n "GNAT/NEWLIB RPM release >" ; read gnatnewlib_rpm_release ;;
+ a) echo -n "GDB source >" ; read gdb_version ;;
+ b) echo -n "GDB patch version>" ; read gdb_patch_version ;;
+ c) echo -n "GDB RPM release >" ; read gdb_rpm_release ;;
+ d) echo -n "RTEMS source >" ; read rtems_version ;;
+ e) echo -n "RTEMS RPM release >" ; read rtems_rpm_release ;;
+ f) echo -n "RPM build root >" ; read rpm_build_root ;;
+ *)
+ return 0 ;;
+ esac
+done
+}
+
+
+save_setup()
+{
+echo -n "saving setup to $CFG .."
+
+echo "# RTEMS tools setup" > $CFG
+echo "binutils_version=$binutils_version" >> $CFG
+echo "binutils_patch_version=$binutils_patch_version" >> $CFG
+echo "binutils_rpm_release=$binutils_rpm_release" >> $CFG
+echo "newlib_version=$newlib_version" >> $CFG
+echo "newlib_patch_version=$newlib_patch_version" >> $CFG
+echo "gcc_version=$gcc_version" >> $CFG
+echo "gcc_patch_version=$gcc_patch_version" >> $CFG
+echo "gnat_version=$gcc_version" >> $CFG
+echo "gnat_patch_version=$gcc_patch_version" >> $CFG
+echo "gnatnewlib_rpm_release=$gccnewlib_rpm_release" >> $CFG
+echo "gdb_version=$gdb_version" >> $CFG
+echo "gdb_patch_version=$gdb_patch_version" >> $CFG
+echo "gdb_rpm_release=$gdb_rpm_release" >> $CFG
+echo "rtems_version=$rtems_version" >> $CFG
+echo "rtems_rpm_release=$rtems_rpm_release" >> $CFG
+echo "rpm_build_root=$rpm_build_root" >> $CFG
+
+echo " done"
+test -f Makefile || ./configure
+}
+
+menu_setup
+
+echo
+echo -n "Save setup [y|n] >"
+read sel
+case $sel in
+''|y*|Y*) save_setup ;;
+*) ;;
+esac
diff --git a/scripts-ada/setup.def b/scripts-ada/setup.def
new file mode 100644
index 0000000000..951e01486c
--- /dev/null
+++ b/scripts-ada/setup.def
@@ -0,0 +1,17 @@
+# RTEMS tools setup
+binutils_version=2.9.5.0.22
+binutils_patch_version=20000114
+binutils_rpm_release=1
+newlib_version=1.8.2
+newlib_patch_version=20000104
+gcc_version=2.8.1
+gcc_patch_version=20000106
+gnat_version=3.12p
+gnat_patch_version=20000126
+gnatnewlib_rpm_release=2
+gdb_version=4.17
+gdb_patch_version=20000126
+gdb_rpm_release=1
+rtems_version=19991117
+rtems_rpm_release=1
+rpm_build_root=/tmp