2018-05-13 23:12:30 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e -x
|
|
|
|
|
|
|
|
source default-config
|
|
|
|
|
|
|
|
# TODO Install from PPA on older Ubuntu
|
|
|
|
|
2018-05-14 18:49:51 +00:00
|
|
|
./install-os-packages.sh ${COMPILER}-${COMPILER_PACKAGE_VERSION}
|
|
|
|
|
|
|
|
if [[ "$COMPILER" == "gcc" ]]; then
|
|
|
|
if command -v gcc-${COMPILER_PACKAGE_VERSION}; then export CC=gcc-${COMPILER_PACKAGE_VERSION} CXX=g++-${COMPILER_PACKAGE_VERSION};
|
|
|
|
elif command -v gcc${COMPILER_PACKAGE_VERSION}; then export CC=gcc${COMPILER_PACKAGE_VERSION} CXX=g++${COMPILER_PACKAGE_VERSION};
|
|
|
|
elif command -v gcc; then export CC=gcc CXX=g++;
|
|
|
|
fi
|
|
|
|
elif [[ "$COMPILER" == "clang" ]]; then
|
|
|
|
if command -v clang-${COMPILER_PACKAGE_VERSION}; then export CC=clang-${COMPILER_PACKAGE_VERSION} CXX=clang++-${COMPILER_PACKAGE_VERSION};
|
|
|
|
elif command -v clang${COMPILER_PACKAGE_VERSION}; then export CC=clang${COMPILER_PACKAGE_VERSION} CXX=clang++${COMPILER_PACKAGE_VERSION};
|
|
|
|
elif command -v clang; then export CC=clang CXX=clang++;
|
2018-05-13 23:12:30 +00:00
|
|
|
fi
|
|
|
|
else
|
2018-05-14 18:49:51 +00:00
|
|
|
die "Unknown compiler specified"
|
2018-05-13 23:12:30 +00:00
|
|
|
fi
|