From c86d8e7f37286f5d6a5ae3fe7a8fd57eeab36017 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Wed, 29 Jan 2003 14:06:02 +0000 Subject: 2003-01-29 Ralf Corsepius * ChangeLog: Fix yesterday's entry. * gdb/target-gdb.add: %defattr(-,root,root). Use %{_prefix} instead of /opt/rtems. Misc. minor changes. * gdb/gdb.add: Use %{_prefix} instead of /opt/rtems. Remove stray unpackaged files. Use %{_defaultbuildroot} instead of hard-coded values. configure --disable-nls. Misc. minor changes. Add BuildPreReq: ncurses-devel. * gdb/base-gdb.add: %defattr(-,root,root). Use %{_prefix} instead of /opt/rtems. Misc. minor changes. * gdb/mkspec.in: New. * gdb/Makefile.am: Reflect addition of gdb/mkspec.in. * gcc3newlib/mkspec.in: Fix usage. * gcc3newlib/gccnewlib.add: Use %{_defaultbuildroot} instead of hard-coded values. Update copyright notice. * mkgdbspec.in: Removed. * Makefile.am: Remove mkgdbspec. * configure.ac: Remove mkgdbspec. Add gdb/mkspec. --- scripts/gdb/Makefile.am | 39 ++++++++++++------------ scripts/gdb/base-gdb.add | 32 +++++++++++-------- scripts/gdb/gdb.add | 34 +++++++++++++++------ scripts/gdb/mkspec.in | 76 ++++++++++++++++++++++++++++++++++++++++++++++ scripts/gdb/target-gdb.add | 12 ++++++-- 5 files changed, 149 insertions(+), 44 deletions(-) create mode 100644 scripts/gdb/mkspec.in (limited to 'scripts/gdb') diff --git a/scripts/gdb/Makefile.am b/scripts/gdb/Makefile.am index d3c35b7e7a..7ab0826f5c 100644 --- a/scripts/gdb/Makefile.am +++ b/scripts/gdb/Makefile.am @@ -2,65 +2,66 @@ ## $Id$ ## - -MKGDBSPEC = $(SHELL) $(top_builddir)/mkgdbspec +MKSPEC = $(SHELL) ./mkspec SUBPACKAGES = gdb.add base-gdb.add target-gdb.add +noinst_DATA = gdb.spec.in + gdb.spec.in: $(SUBPACKAGES) cat $^ > $@ CLEANFILES = gdb.spec.in -MKGDBSPEC_DEPS = $(top_builddir)/mkgdbspec gdb.spec.in \ +MKGDBSPEC_DEPS = $(top_builddir)/mkspec gdb.spec.in \ $(top_builddir)/setup.cache arm-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . arm-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache arm-rtems > $@ c4x-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . c4x-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache c4x-rtems > $@ h8300-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . h8300-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache h8300-rtems > $@ hppa1.1-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . hppa1.1-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache hppa1.1-rtems > $@ i386-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . i386-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache i386-rtems > $@ i386-RTEMS-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . i386-RTEMS + $(MKSPEC) -cfg $(top_builddir)/setup.cache i386-RTEMS > $@ i960-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . i960-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache i960-rtems > $@ m68k-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . m68k-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache m68k-rtems > $@ mips64orion-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . mips64orion-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache mips64orion-rtems > $@ mips-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . mips-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache mips-rtems > $@ mipstx39-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . mipstx39-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache mipstx39-rtems > $@ powerpc-RTEMS-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . powerpc-RTEMS + $(MKSPEC) -cfg $(top_builddir)/setup.cache powerpc-RTEMS > $@ powerpc-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . powerpc-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache powerpc-rtems > $@ sh-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . sh-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache sh-rtems > $@ sh-rtemself-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . sh-rtemself + $(MKSPEC) -cfg $(top_builddir)/setup.cache sh-rtemself > $@ sparc-rtems-$(GDBVERS).spec: $(MKGDBSPEC_DEPS) - $(MKGDBSPEC) -cfg $(top_builddir)/setup.cache -o . sparc-rtems + $(MKSPEC) -cfg $(top_builddir)/setup.cache sparc-rtems > $@ RPM_SPECS_DATA = \ arm-rtems-$(GDBVERS).spec c4x-rtems-$(GDBVERS).spec \ diff --git a/scripts/gdb/base-gdb.add b/scripts/gdb/base-gdb.add index 0c26569bbe..5698484788 100644 --- a/scripts/gdb/base-gdb.add +++ b/scripts/gdb/base-gdb.add @@ -14,26 +14,34 @@ 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 +%defattr(-,root,root) -%dir /opt/rtems/info -%doc /opt/rtems/info/gdb.info* -%doc /opt/rtems/info/mmalloc.info* +%dir %{_prefix}/info +%doc %{_prefix}/info/gdb.info* +%doc %{_prefix}/info/mmalloc.info* +# FIXME: When had gdbint and stabs been introduced? +%if "@gdb_version@" >= "5.0" +%doc %{_prefix}/info/gdbint.info* +%doc %{_prefix}/info/stabs.info* +%endif # gdb 4.18 installed this, gdb 5.0 does not -# %doc /opt/rtems/info/readline.info* +%if "@gdb_version@" < "5.0" +%doc %{_prefix}/info/readline.info* +%endif -%dir /opt/rtems/man -%dir /opt/rtems/man/man1 +%dir %{_prefix}/man +%dir %{_prefix}/man/man1 -%dir /opt/rtems/include +%dir %{_prefix}/include # We install libbfd from binutils -# /opt/rtems/include/bfd.h -# /opt/rtems/include/bfdlink.h +# %{_prefix}/include/bfd.h +# %{_prefix}/include/bfdlink.h -%dir /opt/rtems/lib +%dir %{_prefix}/lib # We install libbfd from binutils -# /opt/rtems/lib/libbfd* +# %{_prefix}/lib/libbfd* # We use libiberty from gcc -# /opt/rtems/lib/libiberty* +# %{_prefix}/lib/libiberty* %post -n rtems-base-gdb if test -d $RPM_INSTALL_PREFIX/rtems/info; diff --git a/scripts/gdb/gdb.add b/scripts/gdb/gdb.add index 55f0143a93..3e2ef9ec40 100644 --- a/scripts/gdb/gdb.add +++ b/scripts/gdb/gdb.add @@ -6,7 +6,8 @@ # please send bugfixes or comments to joel@OARcorp.com # -# neededforbuild -- nothing +%define _prefix @prefix@ +%define _defaultbuildroot %{_tmppath}/%{name}-%{version} Vendor: OAR Corporation Distribution: Linux @@ -24,7 +25,11 @@ Source0: ftp://ftp.gnu.org/pub/gnu/gdb-@gdb_version@.tar.gz Patch0: gdb-@gdb_version@-rtems-base-@gdb_patch_version@.diff Patch1: gdb-@gdb_version@-rtems-cg-@gdb_patch_version@.diff Patch2: gdb-@gdb_version@-rtems-rdbg-@gdb_patch_version@.diff -Buildroot: /tmp/@target_alias@-gdb +Buildroot: %{_defaultbuildroot} + +%if "%{_vendor}" == "redhat" +BuildPreReq: ncurses-devel +%endif # # The original sources are not included in the source RPM. @@ -46,7 +51,6 @@ 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 @@ -59,22 +63,32 @@ cd gdb-@gdb_version@ test -d build || mkdir build cd build ../gdb-@gdb_version@/configure --target=@target_alias@ \ - --verbose --prefix=/opt/rtems @extra_configure_arguments@ + --verbose --prefix=%{_prefix} @extra_configure_arguments@ \ + --disable-nls make all make info %install cd build - make prefix=$RPM_BUILD_ROOT/opt/rtems install - make prefix=$RPM_BUILD_ROOT/opt/rtems install-info + make prefix=$RPM_BUILD_ROOT%{_prefix} install + make prefix=$RPM_BUILD_ROOT%{_prefix} install-info + + # host files + rm -rf $RPM_BUILD_ROOT%{_prefix}/include/*.h + rm -rf $RPM_BUILD_ROOT%{_prefix}/lib/lib*a + # These come from other packages + rm -rf $RPM_BUILD_ROOT%{_prefix}/info/bfd* + rm -rf $RPM_BUILD_ROOT%{_prefix}/info/configure* + rm -rf $RPM_BUILD_ROOT%{_prefix}/info/standards* + # 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 + gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info 2>/dev/null + gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-? 2>/dev/null + gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-?? 2>/dev/null %clean # let rpm --clean remove BuildRoot iif using the default BuildRoot - test "$RPM_BUILD_ROOT" = "/tmp/@target_alias@-gdb" && \ + test "$RPM_BUILD_ROOT" = "%{_defaultbuildroot}" && \ rm -rf $RPM_BUILD_ROOT diff --git a/scripts/gdb/mkspec.in b/scripts/gdb/mkspec.in new file mode 100644 index 0000000000..e3b17339ac --- /dev/null +++ b/scripts/gdb/mkspec.in @@ -0,0 +1,76 @@ +#!/bin/sh +# +# Usage: mkspec CPU +# + +RTEMS_DIR=`dirname $0`/@top_srcdir@ + +CFG=../setup.cache +exe_ext=@EXEEXT@ + +specsrc=${RTEMS_DIR}/gdb/gdb.spec.in + +usage() +{ + echo "$0 [options] " + echo " options:" + echo " -cfg " + echo " -a " + exit 1 ; +} + +while test $# -ge 2; do +case $1 in +-cfg) + shift + CFG=$1 + shift + ;; +-a) # alternate specs file + shift + specsrc=$1 + shift + ;; +-*) + echo "invalid option $1"; + usage + ;; +esac +done + +if test ! $# -eq 1; +then + echo "Invalid number of arguments" + usage +fi + +# target to build for +target_alias=$1 + +. ./$CFG + +case ${target_alias} in + arm* | d10v* | d30v* | erc32* | fr30* | h8300* | h8500* | hppa1.1* | \ + i960* | m32r* | mcore* | mips* | mn10200* | mn10300* | sh* | sparc*| \ + v850* | w65* | z8k*) + extra_configure_arguments="--enable-sim" + ;; + 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 + ;; + *) + ;; +esac + +sed -e "s%@Release\@%${gdb_rpm_release}%g" \ + -e "s,@rpm_build_root\@,${rpm_build_root},g" \ + -e "s%@prefix\@%@prefix@%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" \ +< ${specsrc} diff --git a/scripts/gdb/target-gdb.add b/scripts/gdb/target-gdb.add index 5def2d93e9..294fbd1d9e 100644 --- a/scripts/gdb/target-gdb.add +++ b/scripts/gdb/target-gdb.add @@ -15,7 +15,13 @@ 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 +%defattr(-,attr,attr) +%doc %{_prefix}/man/man1/@target_alias@-gdb.1* +%doc %{_prefix}/man/man1/@target_alias@-run.1* -%dir /opt/rtems/bin -/opt/rtems/bin/@target_alias@-gdb@exe_ext@ +%dir %{_prefix}/bin +%{_prefix}/bin/@target_alias@-gdb@exe_ext@ +%{_prefix}/bin/@target_alias@-run@exe_ext@ +%if "@target_alias@" == "sparc-rtems" +%{_prefix}/bin/@target_alias@-sis@exe_ext@ +%endif -- cgit v1.2.3