2011-01-03 10:48:06 +00:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
#Framework, welches ein komplettes Linux System aus den Sourcen erstellt
|
|
|
|
|
#dieses Framework wird im CVS Repository
|
|
|
|
|
#:pserver:cvs.compuextreme.de:/Data/cvs zur Verf<72>gung gestellt
|
|
|
|
|
#
|
|
|
|
|
#Lage dieser Datei im Archiv: $HeadURL$
|
|
|
|
|
#
|
|
|
|
|
#(c) 2003 Harald Kueller, Germany
|
|
|
|
|
#This program is free software; you can redistribute it and/or
|
|
|
|
|
#modify ist under the terms of the GNU General Public License
|
|
|
|
|
#as published by the Free Software Foundation; either version
|
|
|
|
|
#2 of the License, 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.
|
|
|
|
|
#
|
|
|
|
|
#Dies ist ein Module zur Verwendung mit genpkg. Die Erzeugung eines
|
|
|
|
|
#Viitor Linux Packetes wird <20>ber die Funktionen premk, mk und postmk
|
|
|
|
|
#gesteuert. premk() dient zur Vorbereitung des Sourcecodes. Hier k<>nnen
|
|
|
|
|
#diverse <20>nderungen am sourcecode (mit awk/sed usw.) vorgenommen werden
|
|
|
|
|
#mk() umfasst die source Konfiguration und das <20>bersetzten des source
|
|
|
|
|
#codes. Auch die Installation mu<6D> von mk erledigt werden. Hier gild dass
|
|
|
|
|
#die Installation immer nach $TMPROOT erfolgen soll (meisst kann das mit
|
|
|
|
|
#"make DESTDIR=$TMPROOT install" angestossen werden). postmk kann
|
|
|
|
|
#vor der packeterstellung noch einiges am installationtree <20>ndern. postmk
|
|
|
|
|
#l<>uft nachdem die Packetabh<62>ngigkeiten erstellt wurden.
|
|
|
|
|
#Das Verhalten von genpkg kann <20>ber die Variable MKPKG gesteuert werden.
|
|
|
|
|
#Hier m<>ssen FLAGS zur Steuerung gesetzt werden. Folgende Flags werden
|
|
|
|
|
#erkannt:
|
|
|
|
|
#
|
|
|
|
|
# 1 : Package Erzeugung erzwingen. Packet wird, auch wenn es schon
|
|
|
|
|
# vorhanden ist, ohne weitere r<>ckfragen neu Erzeugt.
|
|
|
|
|
# 2 : Package Installation erzwingen. Installpkg wird mit -f aufgerufen.
|
|
|
|
|
# Das bewirkt, das installpkg keine r<>ckfragen bei der installation
|
|
|
|
|
# Stellt, und das packet in jedemfall (neu) installiert.
|
|
|
|
|
# 4 : Sourcepacket nicht nach MAKEDIR entpacken. Ist dieses Flag gesetzt
|
|
|
|
|
# muss sich das Module selber um das Entpacken der sourcedateien k<>mmern.
|
|
|
|
|
# vor allem wichtig bei Packeten, f<>r die es keine source.tgz gibt
|
|
|
|
|
# (z.B. aus dem CVS generierte Packete).
|
|
|
|
|
# 8 : Erstellung des Packetes aus $TMPROOT wird unterdr<64>ckt. Dies ist bei
|
|
|
|
|
# manchen Sonderf<72>llen m<>glich - wenn sich z.B. der Packetnamen nicht
|
|
|
|
|
# aus dem Namen des sourcearchives ableiten l<>sst. Packet sollte in
|
|
|
|
|
# so einem Fall in der postmk() Funktion erstellt werden.
|
|
|
|
|
# 16 : Packet wird nicht installiert. Bei Packeten wie tar oder bash kann
|
|
|
|
|
# die installation mittelst installpkg probleme machen.
|
|
|
|
|
# 32 : Dependics File so erzeugen, das die Abh<62>ngigkeiten bei der installation
|
|
|
|
|
# erf<72>llt sein m<>ssen. installpkg bricht in so einem fall bei fehlenden
|
|
|
|
|
# packeten die installation ab, und gibt nicht "nur" warnmeldungen aus.
|
|
|
|
|
# Wichtig bei packeten mit postinstallroutine, die software aus dem
|
|
|
|
|
# frisch installierten Packet verwendet (wie z.B. postgresql)
|
|
|
|
|
# 64 : sourcetree aufr<66>umen nach packeterstellung unterbinden.
|
|
|
|
|
# 128 : Patches zu den Sourcen nicht einspielen - Module muss sich darum
|
|
|
|
|
# k<>mmern
|
|
|
|
|
|
2011-02-24 11:11:43 +00:00
|
|
|
|
#Module zur Erstellung des Packetes: gcc
|
|
|
|
|
#Quelle der Source Archive: ftp.gnu.org
|
2011-01-03 10:48:06 +00:00
|
|
|
|
#Kurzbeschreibung:
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#Letzte <20>nderung von: $Author$
|
|
|
|
|
#Datum der letzten <20>nderung: $Date$
|
2011-02-24 11:11:43 +00:00
|
|
|
|
#Version der Datei: $Rev$
|
2011-01-03 10:48:06 +00:00
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
SRCPATH=Base/Development
|
|
|
|
|
|
|
|
|
|
(( MKPKG = $MKPKG | 8 ))
|
|
|
|
|
(( MKPKG = $MKPKG | 16 ))
|
|
|
|
|
|
|
|
|
|
premk() {
|
|
|
|
|
if [ ${MK64BIT} == "true" ]; then
|
|
|
|
|
LIBDIR=lib64
|
|
|
|
|
else
|
|
|
|
|
LIBDIR=lib
|
|
|
|
|
fi
|
|
|
|
|
ARCH=`echo $TARGET|cut -d"-" -f 1`
|
|
|
|
|
if [ "$ARCH" == "sparc64" ]; then
|
|
|
|
|
OUTFILE="gcc/config/sparc/linux.h gcc/config/sparc/linux64.h"
|
|
|
|
|
else
|
|
|
|
|
OUTFILE="gcc/config/linux.h"
|
|
|
|
|
fi
|
|
|
|
|
for i in $OUTFILE; do
|
2011-02-24 08:55:45 +00:00
|
|
|
|
echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/" \n\n' >>$i
|
2011-01-03 10:48:06 +00:00
|
|
|
|
echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >>$i
|
|
|
|
|
echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >>$i
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
cp -v gcc/Makefile.in{,.orig}
|
|
|
|
|
sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \
|
|
|
|
|
gcc/Makefile.in.orig > gcc/Makefile.in
|
|
|
|
|
if [ ! -f /tmp/crossgcc_stage1 ]; then
|
|
|
|
|
touch /tools/include/limits.h
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -f /lib/cpp ]; then
|
|
|
|
|
ln -sf ../usr/bin/cpp /lib/cpp
|
|
|
|
|
fi
|
|
|
|
|
mkdir ../build-gcc
|
|
|
|
|
cd ../build-gcc
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mk() {
|
|
|
|
|
if [ ! -f /tmp/crossgcc_stage1 ]; then
|
|
|
|
|
AR=ar \
|
|
|
|
|
LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
|
|
|
|
|
../gcc*/configure --prefix=/cross-tools \
|
|
|
|
|
--build=$HOSTSYS \
|
|
|
|
|
--host=$HOSTSYS \
|
|
|
|
|
--target=$TARGET \
|
|
|
|
|
--with-sysroot=${LFS} \
|
|
|
|
|
--with-local-prefix=/tools \
|
|
|
|
|
--disable-nls \
|
|
|
|
|
--disable-shared \
|
|
|
|
|
--with-mpfr=/cross-tools \
|
|
|
|
|
--with-gmp=/cross-tools \
|
2011-02-24 08:55:45 +00:00
|
|
|
|
--with-ppl=/cross-tools \
|
|
|
|
|
--with-cloog=/cross-tools \
|
2011-01-03 10:48:06 +00:00
|
|
|
|
--without-headers \
|
|
|
|
|
--with-newlib \
|
|
|
|
|
--disable-decimal-float \
|
|
|
|
|
--disable-libgomp \
|
|
|
|
|
--disable-libmudflap \
|
|
|
|
|
--disable-libssp \
|
|
|
|
|
--disable-threads \
|
|
|
|
|
--enable-languages=c
|
2011-02-24 08:55:45 +00:00
|
|
|
|
make -j $NUMCPU all-gcc all-target-libgcc
|
|
|
|
|
make -j $NUMCPU install-gcc install-target-libgcc
|
2011-01-03 10:48:06 +00:00
|
|
|
|
else
|
|
|
|
|
AR=ar \
|
|
|
|
|
LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
|
|
|
|
|
../gcc*/configure --prefix=/cross-tools \
|
|
|
|
|
--build=$HOSTSYS \
|
|
|
|
|
--target=$TARGET \
|
|
|
|
|
--host=$HOSTSYS \
|
|
|
|
|
--with-sysroot=${LFS} \
|
|
|
|
|
--with-local-prefix=/tools \
|
|
|
|
|
--disable-nls \
|
|
|
|
|
--enable-shared \
|
|
|
|
|
--enable-languages=c,c++ \
|
|
|
|
|
--enable-__cxa_atexit \
|
|
|
|
|
--with-mpfr=/cross-tools \
|
|
|
|
|
--with-gmp=/cross-tools \
|
|
|
|
|
--enable-c99 \
|
2011-02-24 08:55:45 +00:00
|
|
|
|
--with-ppl=/cross-tools \
|
|
|
|
|
--with-cloog=/cross-tools \
|
2011-01-03 10:48:06 +00:00
|
|
|
|
--enable-long-long \
|
|
|
|
|
--enable-threads=posix
|
|
|
|
|
make -j $NUMCPU AS_FOR_TARGET="${TARGET}-as" \
|
|
|
|
|
LD_FOR_TARGET="${TARGET}-ld"
|
|
|
|
|
make -j $NUMCPU install
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
postmk() {
|
|
|
|
|
cd ../gcc*
|
|
|
|
|
rm -r ../build-gcc
|
|
|
|
|
if [ ! -f /tmp/crossgcc_stage1 ]; then
|
|
|
|
|
touch /tmp/crossgcc_stage1
|
|
|
|
|
else
|
|
|
|
|
rm /tmp/crossgcc_stage1
|
|
|
|
|
fi
|
|
|
|
|
}
|