-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change installs GCC 10.4.0 on the following build images: - deb-arm - deb-x64 - rpm-arm64 - rpm-x64 - suse-x64 We chose to provide our own GCC version, because the GCC versions available as part of CentOS 6, openSUSE 42.1 and Ubuntu 14.04 weren't recent enough to build OpenSCAP and some of its dependencies. We chose GCC 10.4.0, because it was the most recent version that could be built using the GCC versions available on our distributions. GCC 11 and upper include libcody, which is written in C++11 and requires a more recent GCC version to be built. This change is the result of a collaborative work between Sylvain Baubeau, Pierre Guilleminot and David du Colombier. Co-authored-by: Sylvain Baubeau <[email protected]> Co-authored-by: Pierre Guilleminot <[email protected]>
- Loading branch information
1 parent
8c1c831
commit 3801a23
Showing
6 changed files
with
102 additions
and
5 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,58 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
GCC_VERSION=10.4.0 | ||
GCC_SHA256=ab1974017834430de27fd803ade4389602a7d6ca1362496c57bef384b2a4cb07 | ||
PREFIX="${PREFIX:-/usr}" | ||
|
||
prepare_sources() { | ||
local archive=$1 | ||
local extension="${archive##*.}" | ||
local tar_arg | ||
|
||
case $extension in | ||
xz) | ||
tar_arg=J | ||
;; | ||
bz2) | ||
tar_arg=j | ||
;; | ||
gz) | ||
tar_arg=z | ||
;; | ||
*) | ||
echo "Unsupported archive format $extension" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
tar x${tar_arg}f ${archive} | ||
} | ||
|
||
compile_with_autoconf() { | ||
[ -e /etc/redhat-release ] && configure_args="--libdir=$PREFIX/lib64" || true | ||
./configure --prefix=$PREFIX $configure_args $* | ||
cpu_count=$(grep process /proc/cpuinfo | wc -l) | ||
make -j $cpu_count --silent | ||
make install | ||
} | ||
|
||
url="https://mirrors.kernel.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz" | ||
archive=$(basename $url) | ||
[ ! -e "$archive" ] && curl -LO $url || true | ||
echo "${GCC_SHA256} ${archive}" | sha256sum --check | ||
|
||
prepare_sources $(basename $url) | ||
cd "gcc-${GCC_VERSION}" | ||
|
||
contrib/download_prerequisites | ||
|
||
compile_with_autoconf \ | ||
--disable-nls \ | ||
--enable-languages=c,c++ \ | ||
--disable-multilib | ||
|
||
cd - | ||
|
||
rm -rf "gcc-${GCC_VERSION}" "gcc-${GCC_VERSION}.tar.gz" |
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
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
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
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
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