src/main/resources/make/toolchain.sh

changeset 132
e0478362c2cf
parent 105
4b3e655339cb
equal deleted inserted replaced
131:7241d072ace4 132:e0478362c2cf
15 unset TOOLCHAIN_CC 15 unset TOOLCHAIN_CC
16 unset TOOLCHAIN_CXX 16 unset TOOLCHAIN_CXX
17 17
18 check_c_compiler() 18 check_c_compiler()
19 { 19 {
20 command -v $1 2>&1 >/dev/null
21 if [ $? -ne 0 ]; then
22 return 1
23 fi
20 cat > "$TEMP_DIR/test.c" << __EOF__ 24 cat > "$TEMP_DIR/test.c" << __EOF__
21 /* test file */ 25 /* test file */
22 #include <stdio.h> 26 #include <stdio.h>
23 int main(int argc, char **argv) { 27 int main(int argc, char **argv) {
24 #if defined(_MSC_VER) 28 #if defined(_MSC_VER)
39 $1 -o "$TEMP_DIR/checkcc" $CFLAGS $LDFLAGS "$TEMP_DIR/test.c" 2> /dev/null 43 $1 -o "$TEMP_DIR/checkcc" $CFLAGS $LDFLAGS "$TEMP_DIR/test.c" 2> /dev/null
40 } 44 }
41 45
42 check_cpp_compiler() 46 check_cpp_compiler()
43 { 47 {
48 command -v $1 2>&1 >/dev/null
49 if [ $? -ne 0 ]; then
50 return 1
51 fi
44 cat > "$TEMP_DIR/test.cpp" << __EOF__ 52 cat > "$TEMP_DIR/test.cpp" << __EOF__
45 /* test file */ 53 /* test file */
46 #include <iostream> 54 #include <iostream>
47 int main(int argc, char **argv) { 55 int main(int argc, char **argv) {
48 #if defined(_MSC_VER) 56 #if defined(_MSC_VER)

mercurial