#!/usr/bin/env bash
set -ex
git clone --depth=2 https://github.com/gap-system/gap.git $GAPROOT
cd $GAPROOT
./autogen.sh
./configure
make -j4 V=1
make bootstrap-pkg-full
GAPROOT="$(cd .. && pwd)"
if [[ $ABI == 32 ]]
then
CONFIGFLAGS="CFLAGS=-m32 LDFLAGS=-m32 LOPTS=-m32 CXXFLAGS=-m32"
fi
cd pkg
cd guava-*
./configure
make
cd ..
cd io-*
./autogen.sh
./configure $CONFIGFLAGS
make -j4 V=1
cd ..
cd profiling-*
./autogen.sh
if [[ $CC = clang ]]
then
export CXX=clang++
fi
./configure $CONFIGFLAGS
make -j4 V=1
cd ..