make/toolchain.sh

Sun, 30 Nov 2025 15:05:21 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 30 Nov 2025 15:05:21 +0100
changeset 1530
77cb6540d9d8
parent 1523
b5c32391802f
permissions
-rw-r--r--

replace dist-clean target with a proper distclean target

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 {
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
27 if command -v "$1" >/dev/null 2>&1 ; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
28 :
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
29 else
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
30 return 1
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
31 fi
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
32 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
33 /* test file */
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
34 #include <stdio.h>
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1470
diff changeset
35 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
36 #if defined(_MSC_VER)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
37 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
38 #elif defined(__clang__)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
39 printf("toolchain:clang gnuc\n");
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
40 #elif defined(__GNUC__)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
41 printf("toolchain:gcc gnuc\n");
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
42 #elif defined(__sun)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
43 printf("toolchain:suncc\n");
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
44 #else
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
45 printf("toolchain:unknown\n");
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
46 #endif
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
47 printf("wsize:%d\n", (int)sizeof(void*)*8);
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
48 #ifdef __STDC_VERSION__
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1470
diff changeset
49 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
50 #endif
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
51 return 0;
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
52 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
53 __EOF__
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
54 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
55 $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
56 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
57
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
58 check_cpp_compiler()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
59 {
1523
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
60 if command -v "$1" >/dev/null 2>&1 ; then
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
61 :
b5c32391802f update uwproj and fix pkgconfigdir location on BSD
Mike Becker <universe@uap-core.de>
parents: 1492
diff changeset
62 else
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
63 return 1
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
64 fi
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
65 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
66 /* test file */
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
67 #include <iostream>
1492
cc83ce484bf7 update uwproj
Mike Becker <universe@uap-core.de>
parents: 1470
diff changeset
68 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
69 #if defined(_MSC_VER)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
70 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
71 #elif defined(__clang__)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
72 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
73 #elif defined(__GNUC__)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
74 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
75 #elif defined(__sun)
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
76 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
77 #else
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
78 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
79 #endif
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
80 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
81 return 0;
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 __EOF__
815
b0c4750cecd8 update uwproj and check toolchain dependency for coverage flags - fixes #345
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
84 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
85 $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
86 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
87
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
88 parse_toolchain_properties()
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
89 {
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
90 info_file="$1"
1470
c1a144db699f update uwproj (incl. fix of toolchain.sh)
Mike Becker <universe@uap-core.de>
parents: 1330
diff changeset
91 TOOLCHAIN=`grep '^toolchain:' "$info_file" | $TAIL -c +11`
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
92 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
93 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
94 }
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
95
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
96 detect_c_compiler()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
97 {
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
98 if [ -n "$TOOLCHAIN_CC" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
99 return 0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
100 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
101 printf "detect C compiler... "
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
102 if [ -n "$CC" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
103 if check_c_compiler "$CC"; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
104 TOOLCHAIN_CC=$CC
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
105 "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
106 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
107 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
108 echo "$CC"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
109 return 0
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 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
112 return 1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
113 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
114 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
115 for COMP in $C_COMPILERS
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
116 do
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
117 if check_c_compiler "$COMP"; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
118 TOOLCHAIN_CC=$COMP
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
119 "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
120 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
121 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
122 echo "$COMP"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
123 return 0
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 done
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
126 echo "not found"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
127 return 1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
128 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
129 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
130
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
131 detect_cpp_compiler()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
132 {
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
133 if [ -n "$TOOLCHAIN_CXX" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
134 return 0
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
135 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
136 printf "detect C++ compiler... "
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
137
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
138 if [ -n "$CXX" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
139 if check_cpp_compiler "$CXX"; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
140 TOOLCHAIN_CXX=$CXX
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
141 "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
142 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
143 echo "$CXX"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
144 return 0
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 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
147 return 1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
148 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
149 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
150 for COMP in $CPP_COMPILERS
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
151 do
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
152 if check_cpp_compiler "$COMP"; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
153 TOOLCHAIN_CXX=$COMP
1310
ca52ea73a4ca update uwproj
Mike Becker <universe@uap-core.de>
parents: 815
diff changeset
154 "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
1330
caa66055b025 apply latest uwproj fixes
Mike Becker <universe@uap-core.de>
parents: 1310
diff changeset
155 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
156 echo "$COMP"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
157 return 0
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 done
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
160 echo "${TOOLCHAIN_CXX:-"not found"}"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
161 return 1
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
162 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
163 }
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
164
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
165 write_toolchain_defaults()
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
166 {
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
167 echo "# toolchain" >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
168 if [ -n "$TOOLCHAIN_CC" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
169 echo "CC = ${TOOLCHAIN_CC}" >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
170 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
171 if [ -n "$TOOLCHAIN_CXX" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
172 echo "CXX = ${TOOLCHAIN_CXX}" >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
173 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
174 echo >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
175 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
176 cat "make/${TOOLCHAIN_NAME}.mk" >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
177 elif [ -f "make/cc.mk" ]; then
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
178 cat "make/cc.mk" >> "$1"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
179 else
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
180 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
181 fi
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
182 }

mercurial