IGNOREPATH=/etc:/cdrom:/proc:/home:/var:/dev:/boot:/root:/tmp:/usr/local:/bin:/sbin:/mnt:/usr/src STRIPLIB=y STRIPBIN=y VERSION=3.3 PROGNAME="gcc $VERSION" DESC="\ gcc (Base GCC package with C support) \n\ \n\ GCC is the GNU Compiler Collection. \n\ \n\ This package contains those parts of the compiler collection needed to \n\ compile C code. Other packages add C++, Fortran, Objective-C, and \n\ Java support to the compiler core." BUILD=1 MAINTAINER="Mark Post " SOURCE=ftp://ftp.gnu.org/gnu/gcc/ PKGNAME=gcc-$VERSION-s390-$BUILD TAG=ADD compile() { # These are to install the docs for easy package splitting. DF=gcc-g77/ DX=gcc-gxx/ DJ=gcc-java/ DO=gcc-objc/ echo Unpacking tarball. Please wait... tar -yxf $CWD/gcc-$VERSION.tar.bz2 ( cd gcc-$VERSION # Fix perms/owners chown -R root.root . find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 754 -exec chmod 755 {} \; find . -perm 664 -exec chmod 644 {} \; # echo \*\*\*\* decl.c diff # cat $CWD/decl.c.diff | patch -p1 -E --backup --suffix=.orig echo \*\*\*\* s390.c.diff cat $CWD/s390.c.diff | patch -p1 -E --backup --suffix=.orig echo \*\*\*\* s390.c.1.70.2.9.diff cat $CWD/s390.c.1.70.2.9.diff | patch -p1 -E --backup --suffix=.orig2 # Get rid of the files the next patch will create, if they already exist from a # previous run of the build. rm -f gcc/config/s390/2064.md gcc/config/s390/2084.md # This patch was modified from the original IBM one, since one hunk was already # incorporated into the official source tree, and a few offsets changed. # The following patch requires that binutils be upgraded to support the new z990 opcodes # echo \*\*\*\* gcc-3.3-s390-june2003.diff echo \*\*\*\* gcc-3.3-s390-june2003.modified.diff # tar -zxvf $CWD/gcc-3.3-s390-june2003.tar.gz "*.diff" cat $CWD/gcc-3.3-s390-june2003.modified.diff | patch -p1 -E --backup --suffix=.orig echo \*\*\*\* ice.diff cat $CWD/ice.diff | patch -p0 -E --backup --suffix=.orig9 ) mkdir gcc.build.lnx cd gcc.build.lnx ../gcc-$VERSION/configure --prefix=/usr \ --enable-shared \ --enable-threads=posix \ --enable-__cxa_atexit \ --disable-checking \ --with-gnu-ld \ --verbose \ --target=s390-slackware-linux \ --host=s390-slackware-linux make -i BOOT_CFLAGS=-O2 STAGE1_CFLAGS=-O2 CFLAGS=-O2 CXXFLAGS=-O2 LIBCFLAGS='-O2 -g' \ LIBCXXFLAGS='-O2 -g -fno-implicit-templates' GCJFLAGS=-O2 bootstrap make info ( cd gcc make gnatlib # This wants a shared -ladd2line? #make gnatlib-shared make gnattools ) } install() { cd $TMP/gcc.build.lnx make install DESTDIR=/package-gcc make -i install-info DESTDIR=/package-gcc # We use the libiberty.a from the binutils package rm /package-gcc/usr/lib/libiberty.a # Fix a stupid security exposure introduced by libtool being brain dead ( cd /package-gcc/usr/lib for lib in libgcj.la libstdc++.la libsupc++.la; do sed -e 's%-L/tmp/[[:graph:]]*%%g' $lib > $lib.new cat $lib.new > $lib rm $lib.new done ) ( cd $TMP/gcc-$VERSION mkdir -p /package-gcc/usr/doc/gcc-$VERSION/gcc # Only the most recent ChangeLog... shouldn't be too big. :) cp -a BUGS COPYING COPYING.LIB ChangeLog FAQ INSTALL MAINTAINERS README *.html \ /package-gcc/usr/doc/gcc-$VERSION rm /package-gcc/usr/doc/gcc-$VERSION/gnats.html mkdir -p /package-gcc/usr/doc/${DF}gcc-${VERSION}/gcc/f ( cd gcc cp -a ABOUT* COPYING* LANG* NEWS README* SERVICE \ /package-gcc/usr/doc/gcc-$VERSION/gcc cd f cp -a BUGS NEWS README RELEASE-PREP \ /package-gcc/usr/doc/${DF}gcc-${VERSION}/gcc/f cd ../objc mkdir -p /package-gcc/usr/doc/${DO}gcc-${VERSION}/gcc/objc cp -a README /package-gcc/usr/doc/${DO}gcc-${VERSION}/gcc/objc ) mkdir -p /package-gcc/usr/doc/${DJ}gcc-${VERSION}/fastjar ( cd fastjar cp -a AUTHORS CHANGES COPYING ChangeLog NEWS README \ /package-gcc/usr/doc/${DJ}gcc-${VERSION}/fastjar ) mkdir -p /package-gcc/usr/doc/${DF}gcc-${VERSION}/libf2c mkdir -p /package-gcc/usr/doc/${DF}gcc-${VERSION}/libf2c/libF77 mkdir -p /package-gcc/usr/doc/${DF}gcc-${VERSION}/libf2c/libI77 mkdir -p /package-gcc/usr/doc/${DF}gcc-${VERSION}/libf2c/libU77 ( cd libf2c cp -a README TODO disclaimer.netlib permission.netlib readme.netlib \ /package-gcc/usr/doc/${DF}gcc-${VERSION}/libf2c ( cd libF77 cp -a Notice README.netlib \ /package-gcc/usr/doc/${DF}gcc-${VERSION}/libf2c/libF77 ) ( cd libI77 cp -a Notice README.netlib \ /package-gcc/usr/doc/${DF}gcc-${VERSION}/libf2c/libI77 ) ( cd libU77 cp -a COPYING.LIB PROJECTS README \ /package-gcc/usr/doc/${DF}gcc-${VERSION}/libf2c/libU77 ) ) mkdir -p /package-gcc/usr/doc/${DJ}gcc-${VERSION}/libjava ( cd libjava cp -a COPYING ChangeLog HACKING LIBGCJ_LICENSE NEWS README THANKS \ /package-gcc/usr/doc/${DJ}gcc-${VERSION}/libjava ) mkdir -p /package-gcc/usr/doc/${DO}gcc-${VERSION}/libobjc ( cd libobjc cp -a README README.threads THREADS THREADS.MACH \ /package-gcc/usr/doc/${DO}gcc-${VERSION}/libobjc ) mkdir -p /package-gcc/usr/doc/${DX}gcc-${VERSION}/libstdc++-v3 ( cd libstdc++-v3 cp -a README /package-gcc/usr/doc/${DX}gcc-${VERSION}/libstdc++-v3 cp -a docs/html/faq/index.html /package-gcc/usr/doc/${DX}gcc-${VERSION}/libstdc++-v3/faq.html ) ) ( cd /package-gcc/usr/info rm -f *.gz gzip -9 * ) ( cd /package-gcc/usr/man/ for dir in 1 7; do ( cd man$dir rm -f *.gz gzip -9 *.$dir ) done ) } attributes() { chown -R root.bin $PKG/package-gcc/usr/bin chmod 755 $PKG/package-gcc/usr/lib/libgcc_s.so.1 } special() { cd $PKG mv package-gcc/* ./ rmdir package-gcc # Save the build for the rest of the sub-packages ( cd .. cp -a $PKG package.save ) # Now, make all the tweaks so that this is a gcc-only package cp -a $CWD/README.SCO $PKG/usr/doc/gcc-$VERSION/ mkdir -p $PKG/lib ( cd $PKG/usr/bin/ rm -f addr2name.awk c++ g++ g77 gcj gcjh gij gnat* grepjar jar \ jcf-dump jv-convert jv-scan rmic rmiregistry \ s390-slackware-linux-c++ s390-slackware-linux-g++ \ s390-slackware-linux-gcj s390-slackware-linux-gcc \ s390-slackware-linux-gcc-$VERSION mv gcc gcc-$VERSION ) ( cd $PKG/usr/doc rm -rf $DF $DX $DJ $DO ) rm -rf $PKG/usr/include/c++/ $PKG/usr/include/gcj/ $PKG/usr/include/gnu/ \ $PKG/usr/include/java/ $PKG/usr/include/javax/ rm $PKG/usr/include/jni.h $PKG/usr/include/jvmpi.h rm $PKG/usr/info/g77.info.gz $PKG/usr/info/gcj.info.gz $PKG/usr/info/gnat* ( cd $PKG/usr/lib/gcc-lib/s390-slackware-linux/$VERSION/ rm cc1obj cc1plus f771 gnat1 jc1 jvgenmain rm -rf adainclude adalib ) ( cd $PKG/usr/lib/gcc-lib/s390-slackware-linux/$VERSION/include/ rm curses.h g2c.h gmp.h ncurses.h stdio.h rm -rf gcj/ ncurses/ objc/ root/ ) ( cd $PKG/usr/lib rm lib-org* libfrtbegin.a libg2c.* libgcj.* libobjc.* libstdc++.* libsupc++.* rm -rf security/ ) ( cd $PKG/usr/man/man1/ rm g++.1.gz g77.1.gz gcj.1.gz gcjh.1.gz gij.1.gz \ jcf-dump.1.gz jv-convert.1.gz jv-scan.1.gz \ rmic.1.gz rmiregistry.1.gz ) rm -rf $PKG/usr/share/java/ cd $CTL cat $CWD/slack-desc.gcc > slack-desc cat > doinst.sh << EOF ( cd lib ; rm -rf cpp ) ( cd lib ; ln -sf /usr/bin/cpp cpp ) ( cd usr/bin ; rm -rf cc ) ( cd usr/bin ; ln -sf gcc cc ) ( cd usr/bin ; rm -rf gcc ) ( cd usr/bin ; ln -sf gcc-$VERSION gcc ) ( cd usr/bin ; rm -rf s390-slackware-linux-gcc-$VERSION ) ( cd usr/bin ; ln -sf gcc-$VERSION s390-slackware-linux-gcc-$VERSION ) ( cd usr/bin ; rm -rf s390-slackware-linux-gcc ) ( cd usr/bin ; ln -sf gcc-$VERSION s390-slackware-linux-gcc ) ( cd usr/lib ; rm -rf libffi.so ) ( cd usr/lib ; ln -sf libffi-2.00-beta.so libffi.so ) ( cd usr/lib ; rm -rf libgcc_s.so ) ( cd usr/lib ; ln -sf libgcc_s.so.1 libgcc_s.so ) ( cd usr/man/man1 ; rm -rf cc.1.gz ) ( cd usr/man/man1 ; ln -sf gcc.1.gz cc.1.gz ) EOF } subpacks() { repack gcc-g++ repack gcc-g77 repack gcc-java repack gcc-objc repack gcc-gnat }