make/toolchain.sh

Sun, 30 Nov 2025 22:22:12 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 30 Nov 2025 22:22:12 +0100
changeset 87
84f94d476934
parent 86
db21aab20169
permissions
-rw-r--r--

update uwproj and fix echos in Makefile

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

mercurial