%define target m68hc05 %define gcc_version 4.2.0 Summary: GNU Toolchain for m68hc05 Name: %{target}-gnu Version: 0.0.1 Release: 1.20080801git%{?dist} Epoch: 0 License: GPLv2+ and LGPLv2+ and BSD and MIT and Copyright only Group: Development/Languages URL: http://www.auto.tuwien.ac.at/~mkoegler/index.php/bcu # The last release is from 2005, but development in git is more recent. # The sources can be packaged by using the following commands: # git-clone http://www.auto.tuwien.ac.at/~mkoegler/git/%{target}-gnu.git # rm -rf %{target}-gnu/.git # tar cvfj %{target}-gnu-$(date +%Y%m%d)git.tar.bz2 m68hc05-gnu Source0: %{target}-gnu-20080801git.tar.bz2 Source1: README.fedora Patch0: %{target}-Makefile.patch Patch1: %{target}-configure.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: texinfo, gettext, flex, bison, ncurses-devel %description GNU Toolchain for %{target} %package -n %{target}-gcc Summary: Cross Compiling GNU GCC targeted at %{target} Group: Development/Languages License: GPLv2+ Requires: %{target}-binutils = %{version}-%{release} %description -n %{target}-gcc This is a Cross Compiling version of GNU GCC, which can be used to compile for the %{target} platform, instead of for the native %{_arch} platform. %package -n %{target}-g++ Summary: Cross Compiling GNU G++ targeted at %{target} Group: Development/Languages License: GPLv2+ Requires: %{target}-gcc = %{version}-%{release} %description -n %{target}-g++ This package contains the Cross Compiling version of g++, which can be used to compile c++ code for the %{target} platform, instead of for the native %{_arch} platform. Please do keep in mind, that this is a very experimental version of %{target}-g++. Try to avoid using rtti and exceptions, similarly libstdc++ is not available yet. %package -n %{target}-binutils Summary: Cross Compiling GNU binutils targeted at %{target} Group: Development/Tools License: GPLv2+ %description -n %{target}-binutils This is a Cross Compiling version of GNU binutils, which can be used to assemble and link binaries for the %{target} platform, instead of for the native %{_arch} platform. This package supports relaxation and section movement. %package -n %{target}-gdb Summary: GDB for debugging %{target} binaries Group: Development/Tools License: GPLv2+ %description -n %{target}-gdb This is a special version of GDB, the GNU Project debugger, for debugging %{target} binaries. GDB allows you to see what is going on inside another program while it executes or what another program was doing at the moment it crashed. This package contains a simultor for the processor core without any IO in order to faciliate debugging. %package -n %{target}-runtime Summary: Runtime files for the %{target} simulator Group: Development/Tools License: BSD and LGPLv2+ and MIT and Copyright only %description -n %{target}-runtime Runtime environment (newlib) to compile for the simultor. use -lsim -lc -lsim to link for it. %package -n %{target}-dejagnu Summary: Support files for using dejagnu on programs targeted at %{target} Group: Development/Tools License: GPLv2+ Requires: dejagnu, %{target}-gdb, %{target}-gcc, %target}-runtime %description -n %{target}-dejagnu These are support files for dejagnu, which can be used to test binaries for the %{target} platform, instead of for the native %{_arch} platform. Use RUNTESTFLAGS=--target_board=%{target}-sim as an argument to dejagnu. %prep %setup -q -n %{name} %patch0 -p 1 -b .werror %patch1 -p 1 -b .configure cp %{SOURCE1} README.fedora pushd gcc sed -i 's/VERSUFFIX " %{target}"/VERSUFFIX " %{target} (Fedora %{version}-%{release})"/' \ version.c popd # Extract %%__os_install_post into os_install_post~ cat << \EOF > os_install_post~ %__os_install_post EOF # Generate customized brp-*scripts cat os_install_post~ | while read a x y; do case $a in # Prevent brp-strip* from trying to handle foreign binaries */brp-strip*) b=$(basename $a) sed -e 's,find %{buildroot},find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b chmod a+x $b ;; esac done sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ < os_install_post~ > os_install_post %build MAKEINFO=makeinfo; export MAKEINFO #CFLAGS="$(echo %{optflags} | sed -e 's/-m32//; s/-march=i386//; s/-mtune=generic//;') -D_GNU_SOURCE" \ CFLAGS="%{optflags}" \ ./configure --enable-languages=c,c++ --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man \ --disable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext \ --enable-gdbtk=no --disable-newlib-io-float --target=%{target} # -D_GNU_SOURCE" \ make #%%{?_smp_mflags} %install rm -rf %{buildroot} mkdir -p %{buildroot}/usr/share/dejagnu/baseboards cp dejagnu-m68hc05/baseboards/%{target}-sim.exp %{buildroot}/usr/share/dejagnu/baseboards/m68hc05-sim.exp make install DESTDIR=%{buildroot} # we don't want these as we are a cross version rm -r %{buildroot}%{_infodir} rm -r %{buildroot}%{_mandir}/man7 rm %{buildroot}%{_mandir}/man1/%{target}-c++filt.1 rm %{buildroot}%{_mandir}/man1/%{target}-dlltool.1 rm %{buildroot}%{_mandir}/man1/%{target}-gcov.1 rm %{buildroot}%{_mandir}/man1/%{target}-nlmconv.1 rm %{buildroot}%{_mandir}/man1/%{target}-windres.1 rm %{buildroot}/usr/bin/%{target}-c++filt rm %{buildroot}/usr/bin/%{target}-gcov rm %{buildroot}/usr/lib/libiberty.a rm %{buildroot}/usr/lib/lib%{target}-sim.a #%find_lang gcc #%find_lang cpplib #%find_lang binutils #%find_lang gprof #%find_lang ld #cat cpplib.lang >> gcc.lang #cat gprof.lang ld.lang >> binutils.lang # wipe not needed locale files #find %{buildroot}%{_datadir}/locale -name 'gas.mo' -or -name 'opcodes.mo' -or -name 'bfd.mo' | xargs rm -f # Wipe this, it conflicts with the locally installed files from the host gcc rm -rf %{buildroot}%{_datadir}/locale %define __os_install_post . ./os_install_post #%%define __os_install_post /usr/lib/rpm/redhat/brp-compress %clean rm -rf %{buildroot} %files -n %{target}-gcc %defattr(-,root,root,-) %doc README.fedora gcc/COPYING* README %{_bindir}/%{target}-gcc %{_bindir}/%{target}-cpp %{_bindir}/%{target}-gcc-%{gcc_version} %{_bindir}/%{target}-gccbug %dir %{_libdir}/gcc %dir %{_libdir}/gcc/%{target} %{_libdir}/gcc/%{target}/%{gcc_version} %dir %{_libexecdir}/gcc %dir %{_libexecdir}/gcc/%{target} %{_libexecdir}/gcc/%{target}/%{gcc_version} %{_mandir}/man1/%{target}-gcc.1* %{_mandir}/man1/%{target}-cpp.1* %{_prefix}/%{target}/bin/gcc %exclude %{_libexecdir}/gcc/%{target}/%{gcc_version}/cc1plus %files -n %{target}-g++ %doc README.fedora gcc/COPYING* README %defattr(-,root,root,-) %{_bindir}/%{target}-?++ %{_prefix}/%{target}/bin/g++ %{_prefix}/%{target}/bin/c++ %{_libexecdir}/gcc/%{target}/%{gcc_version}/cc1plus %{_mandir}/man1/%{target}-g++.1* %files -n %{target}-binutils %doc README.fedora COPYING binutils/README %defattr(-,root,root,-) %{_bindir}/%{target}-addr2line %{_bindir}/%{target}-ar %{_bindir}/%{target}-as %{_bindir}/%{target}-ld %{_bindir}/%{target}-gprof %{_bindir}/%{target}-nm %{_bindir}/%{target}-objcopy %{_bindir}/%{target}-objdump %{_bindir}/%{target}-ranlib %{_bindir}/%{target}-readelf %{_bindir}/%{target}-size %{_bindir}/%{target}-strings %{_bindir}/%{target}-strip %{_prefix}/%{target}/bin/as %{_prefix}/%{target}/bin/ar %{_prefix}/%{target}/bin/ld %{_prefix}/%{target}/bin/nm %{_prefix}/%{target}/bin/objdump %{_prefix}/%{target}/bin/ranlib %{_prefix}/%{target}/bin/strip %{_prefix}/%{target}/lib/ldscripts %{_mandir}/man1/%{target}-addr2line.1* %{_mandir}/man1/%{target}-ar.1* %{_mandir}/man1/%{target}-as.1* %{_mandir}/man1/%{target}-ld.1* %{_mandir}/man1/%{target}-gprof.1* %{_mandir}/man1/%{target}-nm.1* %{_mandir}/man1/%{target}-objcopy.1* %{_mandir}/man1/%{target}-objdump.1* %{_mandir}/man1/%{target}-ranlib.1* %{_mandir}/man1/%{target}-readelf.1* %{_mandir}/man1/%{target}-size.1* %{_mandir}/man1/%{target}-strings.1* %{_mandir}/man1/%{target}-strip.1* %files -n %{target}-gdb %doc README.fedora gdb/COPYING gdb/README %defattr(-,root,root,-) %{_bindir}/%{target}-gdb %{_bindir}/%{target}-gdbtui %{_bindir}/%{target}-run %{_mandir}/man1/%{target}-gdb.1* %{_mandir}/man1/%{target}-gdbtui.1* %{_mandir}/man1/%{target}-run.1* %files -n %{target}-runtime %doc README.fedora COPYING.NEWLIB newlib/README %defattr(-,root,root,-) %{_prefix}/%{target}/include %{_prefix}/%{target}/lib/*.a %{_prefix}/%{target}/lib/crt0.o %files -n %{target}-dejagnu %defattr(-,root,root,-) %{_datadir}/dejagnu/baseboards/m68hc05-sim.exp %changelog * Sat Aug 2 2008 Andreas Thienemann - 0.0.1-20080801git-1 - Initial FE package