-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is an option, if some software needs an 'older' compiler to build. Callup: gcc5 gives you the C compiler, gxx5 calls g++, and now guess what fortran5 will call.
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#! /bin/bash | ||
|
||
PKG=gcc | ||
VERSION=5.5.0 | ||
BUILD=0 | ||
URL=http://ftp.gnu.org/gnu/gcc/gcc-${VERSION}/gcc-${VERSION}.tar.gz | ||
|
||
PREFIX=/pkg/$PKG-$VERSION-$BUILD | ||
#PREFIX=/dev/shm/pkg/$PKG-$VERSION-$BUILD | ||
|
||
set -xe | ||
umask 022 | ||
|
||
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp | ||
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR | ||
mkdir -p $BUILD_TMPDIR/home | ||
export TMPDIR=$BUILD_TMPDIR | ||
export HOME=$BUILD_TMPDIR/home | ||
|
||
exec </dev/null | ||
|
||
mkdir -p $PREFIX | ||
cat >$PREFIX/profile <<-EOF | ||
PATH=$PREFIX/bin:\$PATH | ||
EOF | ||
. $PREFIX/profile | ||
|
||
export MAKEFLAGS="-j $(nproc)" | ||
|
||
BUILDDIR=$PREFIX/build | ||
|
||
mkdir -p $BUILDDIR | ||
cd $BUILDDIR | ||
|
||
test -e gcc-${VERSION}.tar.gz || wget $URL | ||
test -d gcc-$VERSION || tar xvf gcc-${VERSION}.tar.gz | ||
cd gcc-$VERSION | ||
|
||
./configure \ | ||
--prefix=$PREFIX \ | ||
--enable-shared \ | ||
--enable-threads=posix \ | ||
--enable-__cxa_atexit \ | ||
--enable-clocale=gnu \ | ||
--enable-languages=c,fortran,c++,objc,obj-c++ \ | ||
--disable-multilib \ | ||
--with-system-zlib | ||
|
||
make | ||
make -k check 2>&1 | tee check.log | ||
make install | ||
|
||
cd $PREFIX | ||
mkdir -vp lib | ||
ln -sv ${PREFIX}/bin/cpp lib/ | ||
ln -sv gcc bin/cc | ||
|
||
install -v -dm755 lib/bfd-plugins | ||
ln -sfv ../../libexec/gcc/$(gcc -dumpmaschine)/$VERSION/liblto_plugin.so lib/bfd-plugins/ | ||
|
||
mv -v lib64/* lib/ | ||
rmdir -v lib64 | ||
|
||
mkdir -p share/gdb/auto-load/lib | ||
mv -v lib/*-gdb.py share/gdb/auto-load/lib | ||
|
||
# exit 1 # final test, inhibits 'closing' on success | ||
exit |