Updated to `GCC 12.2.0`

This commit is contained in:
RVG|lory 2023-04-07 23:03:27 +02:00 committed by GitHub
parent 86d897d580
commit 96b7fab22a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 107 additions and 0 deletions

25
packages/gcc/12.2.0/build.sh vendored Normal file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Put instructions to build your package in here
[[ -d "bin" ]] && exit 0
PREFIX=$(realpath $(dirname $0))
mkdir -p build obj
cd build
curl "https://ftp.gnu.org/gnu/gcc/gcc-12.2.0/gcc-12.2.0.tar.gz" -o gcc.tar.gz
tar xzf gcc.tar.gz --strip-components=1
./contrib/download_prerequisites
cd ../obj
# === autoconf based ===
../build/configure --prefix "$PREFIX" --enable-languages=c,c++,d,fortran --disable-multilib --disable-bootstrap
make -j$(nproc)
make install -j$(nproc)
cd ../
rm -rf build obj

29
packages/gcc/12.2.0/compile vendored Normal file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Put instructions to compile source code, remove this file if the language does not require this stage
case "${PISTON_LANGUAGE}" in
c)
rename 's/$/\.c/' "$@" # Add .c extension
gcc -std=c11 *.c -lm
;;
c++)
rename 's/$/\.cpp/' "$@" # Add .cpp extension
g++ -std=c++17 *.cpp
;;
d)
rename 's/.code$/\.d/' "$@" # Add .d extension
gdc *.d
;;
fortran)
rename 's/.code$/\.f90/' "$@" # Add .f90 extension
gfortran *.f90
;;
*)
echo "How did you get here? (${PISTON_LANGUAGE})"
exit 1
;;
esac
chmod +x a.out

5
packages/gcc/12.2.0/environment vendored Normal file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH
export LD_LIBRARY_PATH="$PWD/lib:$PWD/lib64" # Need this to properly link Fortran

22
packages/gcc/12.2.0/metadata.json vendored Normal file
View File

@ -0,0 +1,22 @@
{
"language": "gcc",
"version": "12.2.0",
"provides": [
{
"language": "c",
"aliases": ["gcc"]
},
{
"language": "c++",
"aliases": ["cpp", "g++"]
},
{
"language": "d",
"aliases": ["gdc"]
},
{
"language": "fortran",
"aliases": ["fortran", "f90"]
}
]
}

6
packages/gcc/12.2.0/run vendored Normal file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Put instructions to run the runtime
shift # Discard main filename
./a.out "$@"

6
packages/gcc/12.2.0/test.c vendored Normal file
View File

@ -0,0 +1,6 @@
#include <stdio.h>
int main(void) {
printf("OK");
return 0;
}

6
packages/gcc/12.2.0/test.cpp vendored Normal file
View File

@ -0,0 +1,6 @@
#include <iostream>
int main(void) {
printf("OK");
return 0;
}

5
packages/gcc/12.2.0/test.d vendored Normal file
View File

@ -0,0 +1,5 @@
import std.stdio;
void main() {
writeln("OK");
}

3
packages/gcc/12.2.0/test.f90 vendored Normal file
View File

@ -0,0 +1,3 @@
program test
print "(a)", 'OK'
end program test