pkg(gcc-10.2.0): Add c, c++ and D via gcc 10.2.0

This commit is contained in:
Thomas Hobson 2021-03-13 23:12:50 +13:00
parent 3bec1c3499
commit f852b60b69
No known key found for this signature in database
GPG Key ID: 9F1FD9D87950DB6F
8 changed files with 83 additions and 0 deletions

25
packages/gcc/10.2.0/build.sh vendored Executable 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-10.2.0/gcc-10.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 --disable-multilib --disable-bootstrap
make -j$(nproc)
make install -j$(nproc)
cd ../
rm -rf build obj

25
packages/gcc/10.2.0/compile vendored Normal file
View File

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

4
packages/gcc/10.2.0/environment vendored Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH

6
packages/gcc/10.2.0/metadata.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"language": "gcc",
"version": "10.2.0",
"aliases": ["c","g++","c++","cpp","gdc","d"],
"author": "Thomas Hobson <git@hexf.me>"
}

6
packages/gcc/10.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/10.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/10.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/10.2.0/test.d vendored Normal file
View File

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