Sun, 10 Nov 2024 13:54:55 +0100
Added tag v1.4.2 for changeset d11c154e33e1
68
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
1 | #!/bin/sh |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
2 | # |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
3 | # toolchain detection |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
4 | # |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
5 | |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
6 | C_COMPILERS="gcc clang suncc cc" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
7 | CPP_COMPILERS="g++ clang++ sunCC CC" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
8 | unset TOOLCHAIN_NAME |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
9 | unset TOOLCHAIN_CC |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
10 | unset TOOLCHAIN_CXX |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
11 | |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
12 | check_c_compiler() |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
13 | { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
14 | cat > "$TEMP_DIR/test.c" << __EOF__ |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
15 | /* test file */ |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
16 | #include <stdio.h> |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
17 | int main(int argc, char **argv) { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
18 | #if defined(__clang__) |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
19 | printf("clang\n"); |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
20 | #elif defined(__GNUC__) |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
21 | printf("gcc\n"); |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
22 | #elif defined(__sun) |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
23 | printf("suncc\n"); |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
24 | #else |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
25 | printf("unknown\n"); |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
26 | #endif |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
27 | return 0; |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
28 | } |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
29 | __EOF__ |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
30 | rm -f "$TEMP_DIR/checkcc" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
31 | $1 -o "$TEMP_DIR/checkcc" $CFLAGS $LDFLAGS "$TEMP_DIR/test.c" 2> /dev/null |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
32 | } |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
33 | |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
34 | check_cpp_compiler() |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
35 | { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
36 | cat > "$TEMP_DIR/test.cpp" << __EOF__ |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
37 | /* test file */ |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
38 | #include <iostream> |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
39 | int main(int argc, char **argv) { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
40 | #if defined(__clang__) |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
41 | std::cout << "clang" << std::endl; |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
42 | #elif defined(__GNUC__) |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
43 | std::cout << "gcc" << std::endl; |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
44 | #elif defined(__sun) |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
45 | std::cout << "suncc" << std::endl; |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
46 | #else |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
47 | std::cout << "cc" << std::endl; |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
48 | #endif |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
49 | return 0; |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
50 | } |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
51 | __EOF__ |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
52 | rm -f "$TEMP_DIR/checkcc" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
53 | $1 -o "$TEMP_DIR/checkcc" $CXXFLAGS $LDFLAGS "$TEMP_DIR/test.cpp" 2> /dev/null |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
54 | } |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
55 | |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
56 | create_libtest_source() |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
57 | { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
58 | # $1: filename |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
59 | # $2: optional include |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
60 | cat > "$TEMP_DIR/$1" << __EOF__ |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
61 | /* libtest file */ |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
62 | int main(int argc, char **argv) { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
63 | return 0; |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
64 | } |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
65 | __EOF__ |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
66 | if [ -n "$2" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
67 | echo "#include <$2>" >> "$TEMP_DIR/$1" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
68 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
69 | } |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
70 | |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
71 | check_c_lib() |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
72 | { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
73 | # $1: libname |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
74 | # $2: optional include |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
75 | if [ -z "$TOOLCHAIN_CC" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
76 | return 1 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
77 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
78 | create_libtest_source "test.c" "$2" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
79 | rm -f "$TEMP_DIR/checklib" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
80 | $TOOLCHAIN_CC -o "$TEMP_DIR/checklib" $CFLAGS $LDFLAGS "-l$1" "$TEMP_DIR/test.c" 2> /dev/null |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
81 | } |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
82 | |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
83 | check_cpp_lib() |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
84 | { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
85 | # $1: libname |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
86 | # $2: optional include |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
87 | if [ -z "$TOOLCHAIN_CXX" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
88 | return 1 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
89 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
90 | create_libtest_source "test.cpp" "$2" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
91 | rm -f "$TEMP_DIR/checklib" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
92 | $TOOLCHAIN_CXX -o "$TEMP_DIR/checklib" $CXXFLAGS $LDFLAGS "-l$1" "$TEMP_DIR/test.cpp" 2> /dev/null |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
93 | } |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
94 | |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
95 | check_lib() |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
96 | { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
97 | # $1: libname |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
98 | # $2: optional include |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
99 | if [ -n "$TOOLCHAIN_CC" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
100 | check_c_lib "$1" "$2" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
101 | elif [ -n "$TOOLCHAIN_CXX" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
102 | check_cpp_lib "$1" "$2" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
103 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
104 | } |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
105 | |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
106 | detect_c_compiler() |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
107 | { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
108 | if [ -n "$TOOLCHAIN_CC" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
109 | return 0 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
110 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
111 | printf "detect C compiler... " |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
112 | if [ -n "$CC" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
113 | if check_c_compiler "$CC"; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
114 | TOOLCHAIN_CC=$CC |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
115 | TOOLCHAIN_NAME=`"$TEMP_DIR/checkcc"` |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
116 | echo "$CC" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
117 | return 0 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
118 | else |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
119 | echo "$CC is not a working C compiler" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
120 | return 1 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
121 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
122 | else |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
123 | for COMP in $C_COMPILERS |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
124 | do |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
125 | if check_c_compiler "$COMP"; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
126 | TOOLCHAIN_CC=$COMP |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
127 | TOOLCHAIN_NAME=`"$TEMP_DIR/checkcc"` |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
128 | echo "$COMP" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
129 | return 0 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
130 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
131 | done |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
132 | echo "not found" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
133 | return 1 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
134 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
135 | } |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
136 | |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
137 | detect_cpp_compiler() |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
138 | { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
139 | if [ -n "$TOOLCHAIN_CXX" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
140 | return 0 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
141 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
142 | printf "detect C++ compiler... " |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
143 | |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
144 | if [ -n "$CXX" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
145 | if check_cpp_compiler "$CXX"; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
146 | TOOLCHAIN_CXX=$CXX |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
147 | TOOLCHAIN_NAME=`"$TEMP_DIR/checkcc"` |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
148 | echo "$CXX" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
149 | return 0 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
150 | else |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
151 | echo "$CXX is not a working C++ compiler" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
152 | return 1 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
153 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
154 | else |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
155 | for COMP in $CPP_COMPILERS |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
156 | do |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
157 | if check_cpp_compiler "$COMP"; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
158 | TOOLCHAIN_CXX=$COMP |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
159 | TOOLCHAIN_NAME=`"$TEMP_DIR/checkcc"` |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
160 | echo "$COMP" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
161 | return 0 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
162 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
163 | done |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
164 | echo "${TOOLCHAIN_CXX:-"not found"}" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
165 | return 1 |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
166 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
167 | } |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
168 | |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
169 | write_toolchain_defaults() |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
170 | { |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
171 | echo "# toolchain" >> "$1" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
172 | if [ -n "$TOOLCHAIN_CC" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
173 | echo "CC = ${TOOLCHAIN_CC}" >> "$1" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
174 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
175 | if [ -n "$TOOLCHAIN_CXX" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
176 | echo "CXX = ${TOOLCHAIN_CXX}" >> "$1" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
177 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
178 | echo >> "$1" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
179 | if [ -f "make/${TOOLCHAIN_NAME}.mk" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
180 | cat "make/${TOOLCHAIN_NAME}.mk" >> "$1" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
181 | elif [ -f "make/cc.mk" ]; then |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
182 | cat "make/cc.mk" >> "$1" |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
183 | else |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
184 | echo "!!! WARNING !!! Default toolchain flags not found. Configuration might be incomplete." |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
185 | fi |
ae763178ee1e
replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
186 | } |