fix compiler flag generation

Tue, 13 Aug 2019 22:15:36 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 13 Aug 2019 22:15:36 +0200
changeset 13
cdf8bf4549c4
parent 12
a775e493d340
child 14
87fea7ab27de

fix compiler flag generation

test/configure file | annotate | diff | comparison | revisions
test/make/configure.vm file | annotate | diff | comparison | revisions
test/make/toolchain.sh file | annotate | diff | comparison | revisions
--- a/test/configure	Tue Aug 13 21:54:17 2019 +0200
+++ b/test/configure	Tue Aug 13 22:15:36 2019 +0200
@@ -232,7 +232,7 @@
 
 # Toolchain detection
 # this will insert make vars to config.mk
-source make/toolchain.sh
+. make/toolchain.sh
 
 # add user specified flags to config.mk
 echo >> $TEMP_DIR/config.mk
--- a/test/make/configure.vm	Tue Aug 13 21:54:17 2019 +0200
+++ b/test/make/configure.vm	Tue Aug 13 22:15:36 2019 +0200
@@ -317,7 +317,7 @@
 
 # Toolchain detection
 # this will insert make vars to config.mk
-source make/toolchain.sh
+. make/toolchain.sh
 
 # add user specified flags to config.mk
 echo >> $TEMP_DIR/config.mk
@@ -370,12 +370,12 @@
         #if( $flags.exec )
         $flags.value > /dev/null
         if [ $? -eq 0 ]; then
-            $flags.varName="$flags.varName `$flags.value`"
+            $flags.varName="$$flags.varName `$flags.value`"
         else
             break
         fi
         #else
-        $flags.varName="$flags.varName $flags.value"    
+        $flags.varName="$$flags.varName $flags.value"    
         #end
         #end
         #foreach( $test in $sub.tests )
@@ -444,13 +444,13 @@
         #if( $flags.exec )
         $flags.value > /dev/null
         if [ $? -ne 0 ]; then
-            $flags.varName="$flags.varName `$flags.value`"
+            $flags.varName="$$flags.varName `$flags.value`"
         else
             ERROR=1
             break
         fi
         #else
-        $flags.varName="$flags.varName $flags.value"    
+        $flags.varName="$$flags.varName $flags.value"    
         #end
         #end
 		#if ( $dependency.make.length() > 0 )
--- a/test/make/toolchain.sh	Tue Aug 13 21:54:17 2019 +0200
+++ b/test/make/toolchain.sh	Tue Aug 13 22:15:36 2019 +0200
@@ -99,7 +99,7 @@
 		
 		TOOLCHAIN_NAME=`$TEMP_DIR/checkcc`
         TOOLCHAIN_CC=$COMP
-        echo $TOOLCHAIN_NAME 
+        echo $COMP
         break
     fi
 done
@@ -113,7 +113,7 @@
 do
     check_cpp_compiler $COMP
     if [ $? -ne 0 ]; then
-		if [[ ! -z $CXX ]]; then
+		if [ ! -z "$CXX" ]; then
         	if [ $COMP = $CXX ]; then
                 echo "$CC is not a working C++ Compiler"
                 TOOLCHAIN_DETECTION_ERROR="error"
@@ -127,22 +127,22 @@
 		   # these commands and not 'cc'
 		   TOOLCHAIN_NAME=`$TEMP_DIR/checkcc`
 		   if [ $TOOLCHAIN_NAME = "gcc" ]; then
-		       check_c_compiler "gcc"
+		       check_cpp_compiler "g++"
 			   if [ $? -eq 0 ]; then
-			       COMP=gcc
+			       COMP=g++
 			   fi
 		   fi
 		   if [ $TOOLCHAIN_NAME = "clang" ]; then
-		       check_c_compiler "clang"
+		       check_cpp_compiler "clang++"
 			   if [ $? -eq 0 ]; then
-			       COMP=clang
+			       COMP=clang++
 			   fi
 		   fi
 		fi
 		
 		TOOLCHAIN_NAME=`$TEMP_DIR/checkcc`
         TOOLCHAIN_CXX=$COMP
-        echo $TOOLCHAIN_NAME 
+        echo $COMP
         break
     fi
 done

mercurial