make/toolchain.sh

Tue, 13 Aug 2019 22:03:19 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 13 Aug 2019 22:03:19 +0200
changeset 209
a6d8181a8127
parent 207
27f8a41882a7
child 260
4779a6fb4fbe
permissions
-rw-r--r--

replace source with . in configure script and fix toolchain detection

204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 #!/bin/sh
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 #
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 # toolchain detection
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 #
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 C_COMPILERS="cc gcc clang suncc"
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 CPP_COMPILERS="CC g++ clang++ sunCC"
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 unset CC_ARG_CHECKED
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 unset TOOLCHAIN_DETECTION_ERROR
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 unset TOOLCHAIN_NAME
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 check_c_compiler()
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 {
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 cat > $TEMP_DIR/test.c << __EOF__
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 /* test file */
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 #include <stdio.h>
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 int main(int argc, char **argv) {
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 #if defined(__GNUC__)
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 printf("gcc\n");
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 #elif defined(__clang__)
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 printf("clang\n");
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 #elif defined(__sun)
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 printf("suncc\n");
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 #else
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 printf("unknown\n");
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 #endif
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 return 0;
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28 }
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 __EOF__
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 rm -f $TEMP_DIR/checkcc
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 $1 -o $TEMP_DIR/checkcc $CFLAGS $LDFLAGS $TEMP_DIR/test.c 2> /dev/null
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 if [ $? -ne 0 ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 return 1
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 return 0
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 }
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 check_cpp_compiler()
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40 {
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 cat > $TEMP_DIR/test.cpp << __EOF__
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42 /* test file */
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 #include <iostream>
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 int main(int argc, char **argv) {
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 #if defined(__GNUC__)
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 std::cout << "gcc" << std::endl;
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 #elif defined(__clang__)
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 std::cout << "clang" << std::endl;
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 #elif defined(__sun)
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 std::cout << "suncc" << std::endl;
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 #else
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 std::cout << "unknown" << std::endl;
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 #endif
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 return 0;
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 }
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56 __EOF__
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57 rm -f $TEMP_DIR/checkcc
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58 $1 -o $TEMP_DIR/checkcc $CXXFLAGS $LDFLAGS $TEMP_DIR/test.cpp 2> /dev/null
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60 if [ $? -ne 0 ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 return 1
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 return 0
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 }
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65
207
27f8a41882a7 more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 206
diff changeset
66 printf "detect C compiler... "
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 for COMP in $C_COMPILERS
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 do
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 check_c_compiler $COMP
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 if [ $? -ne 0 ]; then
206
f5bdca63bbe7 fix some incompabilities in configure
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 204
diff changeset
72 if [ ! -z "$CC" ]; then
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 if [ $COMP = $CC ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74 echo "$CC is not a working C Compiler"
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 TOOLCHAIN_DETECTION_ERROR="error"
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 break
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
77 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 else
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80 TOOLCHAIN_NAME=`$TEMP_DIR/checkcc`
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81 if [ $COMP = "cc" ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82 # we have found a working compiler, but in case
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83 # the compiler is gcc or clang, we try to use
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 # these commands and not 'cc'
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 TOOLCHAIN_NAME=`$TEMP_DIR/checkcc`
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 if [ $TOOLCHAIN_NAME = "gcc" ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87 check_c_compiler "gcc"
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88 if [ $? -eq 0 ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 COMP=gcc
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 if [ $TOOLCHAIN_NAME = "clang" ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93 check_c_compiler "clang"
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94 if [ $? -eq 0 ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95 COMP=clang
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 TOOLCHAIN_NAME=`$TEMP_DIR/checkcc`
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101 TOOLCHAIN_CC=$COMP
209
a6d8181a8127 replace source with . in configure script and fix toolchain detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 207
diff changeset
102 echo $COMP
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 break
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105 done
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106 if [ -z $TOOLCHAIN_CC ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107 echo "not found"
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110 printf "detect C++ compiler... "
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112 for COMP in $CPP_COMPILERS
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113 do
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114 check_cpp_compiler $COMP
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 if [ $? -ne 0 ]; then
209
a6d8181a8127 replace source with . in configure script and fix toolchain detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 207
diff changeset
116 if [ ! -z "$CXX" ]; then
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117 if [ $COMP = $CXX ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118 echo "$CC is not a working C++ Compiler"
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 TOOLCHAIN_DETECTION_ERROR="error"
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120 break
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123 else
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 if [ $COMP = "CC" ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125 # we have found a working compiler, but in case
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126 # the compiler is gcc or clang, we try to use
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127 # these commands and not 'cc'
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 TOOLCHAIN_NAME=`$TEMP_DIR/checkcc`
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129 if [ $TOOLCHAIN_NAME = "gcc" ]; then
209
a6d8181a8127 replace source with . in configure script and fix toolchain detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 207
diff changeset
130 check_cpp_compiler "g++"
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131 if [ $? -eq 0 ]; then
209
a6d8181a8127 replace source with . in configure script and fix toolchain detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 207
diff changeset
132 COMP=g++
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135 if [ $TOOLCHAIN_NAME = "clang" ]; then
209
a6d8181a8127 replace source with . in configure script and fix toolchain detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 207
diff changeset
136 check_cpp_compiler "clang++"
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137 if [ $? -eq 0 ]; then
209
a6d8181a8127 replace source with . in configure script and fix toolchain detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 207
diff changeset
138 COMP=clang++
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
141 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143 TOOLCHAIN_NAME=`$TEMP_DIR/checkcc`
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144 TOOLCHAIN_CXX=$COMP
209
a6d8181a8127 replace source with . in configure script and fix toolchain detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 207
diff changeset
145 echo $COMP
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
146 break
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
147 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148 done
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149 if [ -z $TOOLCHAIN_CXX ]; then
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 echo "not found"
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153 TOOLCHAIN_LD=$TOOLCHAIN_CC
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154
207
27f8a41882a7 more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 206
diff changeset
155 if [ -z "$TOOLCHAIN_NAME" ]; then
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
156 TOOLCHAIN_DETECTION_ERROR="error"
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157 else
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
158 cat >> $TEMP_DIR/config.mk << __EOF__
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159 # toolchain
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160 __EOF__
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161 echo "CC = ${TOOLCHAIN_CC}" >> $TEMP_DIR/config.mk
206
f5bdca63bbe7 fix some incompabilities in configure
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 204
diff changeset
162 if [ ! -z "$TOOLCHAIN_CXX" ]; then
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163 echo "CXX = ${TOOLCHAIN_CXX}" >> $TEMP_DIR/config.mk
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165 echo "LD = ${TOOLCHAIN_LD}" >> $TEMP_DIR/config.mk
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166
207
27f8a41882a7 more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 206
diff changeset
167 cat "make/${TOOLCHAIN_NAME}.mk" > /dev/null 2>&1
27f8a41882a7 more buildsystem fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 206
diff changeset
168 if [ $? -eq 0 ]; then
204
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169 echo "include \$(BUILD_ROOT)/make/${TOOLCHAIN_NAME}.mk" >> $TEMP_DIR/config.mk
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170 fi
e870a7c8f223 replace old build system with uwproj
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171 fi

mercurial