Check if compilers are able to compile 'hello, world'
This commit is contained in:
parent
04eaf11b15
commit
c11d91e753
@ -198,7 +198,26 @@ install -d -m 755 %buildroot%sysroot/usr/lib
|
||||
%add_findprov_skiplist %sysroot/* %prefix/lib/gcc/%target/%gcc_branch/*
|
||||
%add_debuginfo_skiplist %sysroot/* %prefix/lib/gcc/%target/%gcc_branch/*
|
||||
|
||||
find %buildroot
|
||||
%check
|
||||
|
||||
cat > hello.c <<EOF
|
||||
#include <stdio.h>
|
||||
int main(int argc, char** argv) {
|
||||
printf("Hello, %%s!\n", argc > 1 ? argv[1] : "world");
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
cat > hello.cpp <<EOF
|
||||
#include <iostream>
|
||||
int main(int argc, char** argv) {
|
||||
std::cout << "Hello, " << (argc > 1 ? argv[1] : "world") << "!" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
%buildroot%prefix/bin/%target-gcc -o hello_c hello.c || exit 2
|
||||
%buildroot%prefix/bin/%target-g++ -o hello_cpp hello.cpp || exit 3
|
||||
|
||||
%files
|
||||
%_bindir/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user