Package: m681x-gcc
Version: 3.3.6
Revision: 3
Maintainer: Carl van Denzen <cvdenzen@users.sourceforge.net>
Recommends: m6811-binutils,m6811-gdb,m6811-newlib
Replaces: m6811-gcc,m6812-gcc
Conflicts: m6811-gcc,m6812-gcc
HomePage: http://m68hc11.serveftp.org/
Source: mirror:gnu:/gcc/gcc-%v/gcc-%v.tar.bz2
Source-Checksum: SHA256(1c1aa533c67e9da5e55ed4f5736258dc753466bd716bdae3fb88fb66e6ff1d7f)
Source2: http://m68hc11.serveftp.org/m68hc1x-builder-3.1.tar.gz
Source2-Checksum: SHA256(cdab236bd9ff65002b5e8f83a620898b43a80e95a3e9f9182e586356b088b1bd)
DescPort: <<
Avoided using /sw/m6811. Its lib & include folders have been moved to /sw/share/m6811 and the binaries are put into /sw/bin.
All files that are not recognizable as m6811 files renamed to m6811-xxx to avoid clashes with other potential toolchains.
--with-as=%p/bin/m6811-elf-as added, I do not know why it is needed when not building into /usr/local, but it solves a  problem.
Somehow nls does not work: configure sees the /sw/include/libintl.h, but during link phase, the /sw/lib/libintl.a is not found. My simple solution was to disable nls.
TODO: Native Language Support.
TODO: Find a solution for shared gcc files gccbug and gcov ?
<<
PatchScript: <<
patch -p1 < ../m68hc1x-builder-3.1/gcc-3.3.6-m68hc1x-20060122.diffs
<<
CompileScript: <<
#!/bin/bash -ev
# Extract TARGET and PROGRAM_PREFIX from the fink package name
# m6811-xxxx -> m6811-elf cq m6811-elf- cq m6811 (machine)
SOURCEDIR=$(pwd)
for x in 1 2 ; do
#
# 681$x
#
MACHINE=%n;MACHINE=${MACHINE%%x-*}$x
TARGET=${MACHINE}-elf;PROGRAM_PREFIX=$TARGET-
echo $TARGET $MACHINE $PROGRAM_PREFIX
#
# gcc does not compile in the source directory. Compile directory will be the current directory with a suffix.
#
cd $SOURCEDIR
BUILDDIR=build.${MACHINE}
mkdir ${BUILDDIR}
cd ${BUILDDIR}
${SOURCEDIR}/configure --target=$TARGET --prefix=%i/share/$MACHINE --bindir=%i/bin --mandir=%i/share/man --infodir=%i/share/info --enable-languages=c --program-prefix=$PROGRAM_PREFIX --with-local-prefix=%i/include/local --with-as=%p/bin/m6811-elf-as --with-ld=%p/bin/m6811-elf-ld --disable-nls
make
done
<<
InstallScript: <<
#!/bin/bash -ev
# Extract TARGET and PROGRAM_PREFIX from the fink package name
# m6811-xxxx -> m6811-elf cq m6811-elf- cq m6811 (machine)
SOURCEDIR=$(pwd)
for x in 1 2 ; do
#
# 681$x
#
MACHINE=%{n};MACHINE=${MACHINE%%x-*}$x
TARGET=${MACHINE}-elf;PROGRAM_PREFIX=$TARGET-
cd $SOURCEDIR
BUILDDIR=build.${MACHINE}
cd ${BUILDDIR}
make install
/usr/bin/find -E %i -regex ".*/libiberty.a" -exec rm -f {} \;
#
# Rename the files xxx.info into m6811-elf-xxx.info cq m6812-elf-xx.info to avoid name clashes with other binutils packages and these two packages (m6811 and m6812)
# The files of the m6811 should not be renamed, hence the inverted grep.
#
for i in $(/usr/bin/find -E %d -regex ".*/.*\.info(-[0-9]+)?|.*/man[0-9]+/[^/]+" -print|grep --invert-match /${MACHINE%%%%?});do echo $i ${i%%/*} ${i##*/} ;mv $i ${i%%/*}/$PROGRAM_PREFIX${i##*/};done
done
<<
DocFiles: BUGS bugs.html COPYING FAQ faq.html MAINTAINERS README
InfoDocs: m6811-elf-cpp.info m6811-elf-cppinternals.info m6811-elf-gcc.info m6812-elf-cpp.info m6812-elf-cppinternals.info m6812-elf-gcc.info
Description: For Motorola 68hc11/12 micro controllers
License: GPL
#Homepage: http://gcc.gnu.org/
BuildDepends: m681x-binutils (>=2.16-1)