pkg(gcc-10.2.0): Add c, c++ and D via gcc 10.2.0
This commit is contained in:
parent
3bec1c3499
commit
f852b60b69
|
@ -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
|
|
@ -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
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Put 'export' statements here for environment variables
|
||||
export PATH=$PWD/bin:$PATH
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"language": "gcc",
|
||||
"version": "10.2.0",
|
||||
"aliases": ["c","g++","c++","cpp","gdc","d"],
|
||||
"author": "Thomas Hobson <git@hexf.me>"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Put instructions to run the runtime
|
||||
|
||||
shift # Discard main filename
|
||||
./a.out $*
|
|
@ -0,0 +1,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf("OK");
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
#include <iostream>
|
||||
|
||||
int main(void) {
|
||||
printf("OK");
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
import std.stdio;
|
||||
|
||||
void main() {
|
||||
writeln("OK");
|
||||
}
|
Loading…
Reference in New Issue