make/toolchain.sh

Sun, 23 Nov 2025 13:15:19 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 23 Nov 2025 13:15:19 +0100
changeset 1508
dfc0ddd9571e
parent 1492
cc83ce484bf7
permissions
-rw-r--r--

optimize sorted insertion by using the infimum instead of the supremum

The reason is that the supremum returns the equal element with the smallest index, and we want the largest.
Therefore, we use the infimum, which already gives us the largest index when there are equal elements, and increase the index by one. The infimum is also guaranteed to exist in that case.

753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 #!/bin/sh
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 # toolchain detection
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1470
diff changeset
6 TAIL="tail"
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
7 if isplatform "bsd" && notisplatform "openbsd"; then
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
8 C_COMPILERS="clang gcc cc"
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
9 CPP_COMPILERS="clang++ g++ CC"
1470
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
10 elif isplatform "solaris"; then
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
11 C_COMPILERS="cc suncc gcc clang"
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
12 CPP_COMPILERS="CC sunCC g++ clang++"
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
13 if [ -f /usr/xpg4/bin/tail ]; then
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
14 TAIL=/usr/xpg4/bin/tail
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
15 fi
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
16 else
1470
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
17 C_COMPILERS="gcc clang cc"
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
18 CPP_COMPILERS="g++ clang++ c++"
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
19 fi
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
20 unset TOOLCHAIN
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 unset TOOLCHAIN_NAME
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 unset TOOLCHAIN_CC
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23 unset TOOLCHAIN_CXX
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25 check_c_compiler()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
26 {
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1470
diff changeset
27 if ! command -v "$1" >/dev/null 2>&1 ; then
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
28 return 1
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
29 fi
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
30 cat > "$TEMP_DIR/test.c" << __EOF__
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
31 /* test file */
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
32 #include <stdio.h>
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1470
diff changeset
33 int main(void) {
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
34 #if defined(_MSC_VER)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
35 printf("toolchain:msc\n");
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
36 #elif defined(__clang__)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
37 printf("toolchain:clang gnuc\n");
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
38 #elif defined(__GNUC__)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
39 printf("toolchain:gcc gnuc\n");
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
40 #elif defined(__sun)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
41 printf("toolchain:suncc\n");
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
42 #else
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
43 printf("toolchain:unknown\n");
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
44 #endif
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
45 printf("wsize:%d\n", (int)sizeof(void*)*8);
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
46 #ifdef __STDC_VERSION__
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1470
diff changeset
47 printf("stdcversion:%ld\n", (long int)__STDC_VERSION__);
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
48 #endif
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
49 return 0;
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
50 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
51 __EOF__
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
52 rm -f "$TEMP_DIR/checkcc"
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
53 $1 -o "$TEMP_DIR/checkcc" $CFLAGS $LDFLAGS "$TEMP_DIR/test.c" 2> /dev/null
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
54 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
55
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
56 check_cpp_compiler()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
57 {
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1470
diff changeset
58 if ! command -v "$1" >/dev/null 2>&1 ; then
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
59 return 1
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
60 fi
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
61 cat > "$TEMP_DIR/test.cpp" << __EOF__
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
62 /* test file */
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
63 #include <iostream>
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1470
diff changeset
64 int main(void) {
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
65 #if defined(_MSC_VER)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
66 std::cout << "toolchain:msc" << std::endl;
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
67 #elif defined(__clang__)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
68 std::cout << "toolchain:clang gnuc" << std::endl;
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
69 #elif defined(__GNUC__)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
70 std::cout << "toolchain:gcc gnuc" << std::endl;
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
71 #elif defined(__sun)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
72 std::cout << "toolchain:suncc" << std::endl;
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
73 #else
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
74 std::cout << "toolchain:unknown" << std::endl;
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
75 #endif
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
76 std::cout << "wsize:" << sizeof(void*)*8 << std::endl;
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
77 return 0;
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
78 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
79 __EOF__
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
80 rm -f "$TEMP_DIR/checkcc"
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
81 $1 -o "$TEMP_DIR/checkcc" $CXXFLAGS $LDFLAGS "$TEMP_DIR/test.cpp" 2> /dev/null
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
82 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
83
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
84 parse_toolchain_properties()
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
85 {
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
86 info_file="$1"
1470
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
87 TOOLCHAIN=`grep '^toolchain:' "$info_file" | $TAIL -c +11`
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
88 TOOLCHAIN_NAME=`echo "$TOOLCHAIN" | cut -f1 -d' ' -`
1470
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
89 TOOLCHAIN_WSIZE=`grep '^wsize:' "$info_file" | $TAIL -c +7`
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
90 }
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
91
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
92 detect_c_compiler()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
93 {
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
94 if [ -n "$TOOLCHAIN_CC" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
95 return 0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
96 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
97 printf "detect C compiler... "
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
98 if [ -n "$CC" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
99 if check_c_compiler "$CC"; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
100 TOOLCHAIN_CC=$CC
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
101 "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
102 parse_toolchain_properties "$TEMP_DIR/checkcc_out"
1470
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
103 TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | $TAIL -c +13`
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
104 echo "$CC"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
105 return 0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
106 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
107 echo "$CC is not a working C compiler"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
108 return 1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
109 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
110 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
111 for COMP in $C_COMPILERS
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
112 do
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
113 if check_c_compiler "$COMP"; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
114 TOOLCHAIN_CC=$COMP
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
115 "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
116 parse_toolchain_properties "$TEMP_DIR/checkcc_out"
1470
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
117 TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | $TAIL -c +13`
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
118 echo "$COMP"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
119 return 0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
120 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
121 done
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
122 echo "not found"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
123 return 1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
124 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
125 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
126
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
127 detect_cpp_compiler()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
128 {
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
129 if [ -n "$TOOLCHAIN_CXX" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
130 return 0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
131 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
132 printf "detect C++ compiler... "
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
133
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
134 if [ -n "$CXX" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
135 if check_cpp_compiler "$CXX"; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
136 TOOLCHAIN_CXX=$CXX
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
137 "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
138 parse_toolchain_properties "$TEMP_DIR/checkcc_out"
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
139 echo "$CXX"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
140 return 0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
141 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
142 echo "$CXX is not a working C++ compiler"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
143 return 1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
144 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
145 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
146 for COMP in $CPP_COMPILERS
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
147 do
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
148 if check_cpp_compiler "$COMP"; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
149 TOOLCHAIN_CXX=$COMP
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
150 "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
151 parse_toolchain_properties "$TEMP_DIR/checkcc_out"
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
152 echo "$COMP"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
153 return 0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
154 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
155 done
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
156 echo "${TOOLCHAIN_CXX:-"not found"}"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
157 return 1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
158 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
159 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
160
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
161 write_toolchain_defaults()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
162 {
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
163 echo "# toolchain" >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
164 if [ -n "$TOOLCHAIN_CC" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
165 echo "CC = ${TOOLCHAIN_CC}" >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
166 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
167 if [ -n "$TOOLCHAIN_CXX" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
168 echo "CXX = ${TOOLCHAIN_CXX}" >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
169 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
170 echo >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
171 if [ -f "make/${TOOLCHAIN_NAME}.mk" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
172 cat "make/${TOOLCHAIN_NAME}.mk" >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
173 elif [ -f "make/cc.mk" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
174 cat "make/cc.mk" >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
175 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
176 echo "!!! WARNING !!! Default toolchain flags not found. Configuration might be incomplete."
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
177 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
178 }

mercurial