111 |
111 |
112 for COMP in $CPP_COMPILERS |
112 for COMP in $CPP_COMPILERS |
113 do |
113 do |
114 check_cpp_compiler $COMP |
114 check_cpp_compiler $COMP |
115 if [ $? -ne 0 ]; then |
115 if [ $? -ne 0 ]; then |
116 if [[ ! -z $CXX ]]; then |
116 if [ ! -z "$CXX" ]; then |
117 if [ $COMP = $CXX ]; then |
117 if [ $COMP = $CXX ]; then |
118 echo "$CC is not a working C++ Compiler" |
118 echo "$CC is not a working C++ Compiler" |
119 TOOLCHAIN_DETECTION_ERROR="error" |
119 TOOLCHAIN_DETECTION_ERROR="error" |
120 break |
120 break |
121 fi |
121 fi |
125 # we have found a working compiler, but in case |
125 # we have found a working compiler, but in case |
126 # the compiler is gcc or clang, we try to use |
126 # the compiler is gcc or clang, we try to use |
127 # these commands and not 'cc' |
127 # these commands and not 'cc' |
128 TOOLCHAIN_NAME=`$TEMP_DIR/checkcc` |
128 TOOLCHAIN_NAME=`$TEMP_DIR/checkcc` |
129 if [ $TOOLCHAIN_NAME = "gcc" ]; then |
129 if [ $TOOLCHAIN_NAME = "gcc" ]; then |
130 check_c_compiler "gcc" |
130 check_cpp_compiler "g++" |
131 if [ $? -eq 0 ]; then |
131 if [ $? -eq 0 ]; then |
132 COMP=gcc |
132 COMP=g++ |
133 fi |
133 fi |
134 fi |
134 fi |
135 if [ $TOOLCHAIN_NAME = "clang" ]; then |
135 if [ $TOOLCHAIN_NAME = "clang" ]; then |
136 check_c_compiler "clang" |
136 check_cpp_compiler "clang++" |
137 if [ $? -eq 0 ]; then |
137 if [ $? -eq 0 ]; then |
138 COMP=clang |
138 COMP=clang++ |
139 fi |
139 fi |
140 fi |
140 fi |
141 fi |
141 fi |
142 |
142 |
143 TOOLCHAIN_NAME=`$TEMP_DIR/checkcc` |
143 TOOLCHAIN_NAME=`$TEMP_DIR/checkcc` |
144 TOOLCHAIN_CXX=$COMP |
144 TOOLCHAIN_CXX=$COMP |
145 echo $TOOLCHAIN_NAME |
145 echo $COMP |
146 break |
146 break |
147 fi |
147 fi |
148 done |
148 done |
149 if [ -z $TOOLCHAIN_CXX ]; then |
149 if [ -z $TOOLCHAIN_CXX ]; then |
150 echo "not found" |
150 echo "not found" |