Permalink
Fetching contributors…
Cannot retrieve contributors at this time
executable file 60 lines (49 sloc) 1.21 KB
#!/bin/bash
#
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
VERSION=5.5.0
BUILD_VER=1
set -ex
PKG_NAME=gcc
CACHE_TARBALL="/var/nodist/${PKG_NAME}-${VERSION}-$(</opt/hhvm-distro-packaging/DISTRIBUTION)${BUILD_VER}.tar.bz2"
PKG_DIR=$(mktemp -d)
cd /tmp
if [ -e "$CACHE_TARBALL" ]; then
echo "Using ${CACHE_TARBALL}..."
cd /
tar xfv "$CACHE_TARBALL"
exit 0
fi
wget -q http://mirrors.ocf.berkeley.edu/gnu/gcc/gcc-$VERSION/gcc-$VERSION.tar.gz
tar zxf gcc-$VERSION.tar.gz
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
env
cd gcc-$VERSION
contrib/download_prerequisites
mkdir ../objdir
cd ../objdir
unset CFLAGS
unset CXXFLAGS
unset CFLAGS_FOR_BUILD
unset CXXFLAGS_FOR_BUILD
unset CFLAGS_FOR_TARGET
unset CXXFLAGS_FOR_TARGET
$(pwd)/../gcc-$VERSION/configure \
--prefix=/opt/hhvm-build-deps \
--enable-languages=c,c++ \
--disable-multilib \
--with-default-libstdcxx-abi=gcc4-compatible \
--disable-libstdcxx-dual-abi
make -j8
make install "DESTDIR=${PKG_DIR}"
cd "${PKG_DIR}"
mkdir -p "$(dirname "$CACHE_TARBALL")"
tar jcf "$CACHE_TARBALL" *
cd /
tar xfv "$CACHE_TARBALL"