test/make/configure.vm

changeset 11
215b49563679
parent 9
ebdecbbb2f79
child 12
a775e493d340
--- a/test/make/configure.vm	Tue Aug 13 21:37:01 2019 +0200
+++ b/test/make/configure.vm	Tue Aug 13 21:49:10 2019 +0200
@@ -244,6 +244,16 @@
     done
     return 1
 }
+isnotplatform()
+{
+    for p in $PLATFORM
+    do
+        if [ $p = $1 ]; then
+            return 1
+        fi
+    done
+    return 0
+}
 
 # generate config.mk and config.h
 cat > $TEMP_DIR/config.mk << __EOF__
@@ -334,7 +344,7 @@
     while true
     do
     	#if( $sub.platform )
-    	if ! isplatform "${sub.platform}"; then
+    	if isnotplatform "${sub.platform}"; then
             break
         fi
     	#end
@@ -352,19 +362,19 @@
         if ! $PKG_CONFIG $pkg.getPkgConfigParam() ; then
             break
         fi
-        CFLAGS+=" `$PKG_CONFIG --cflags $pkg.getPkgConfigParam()`"
-        LDFLAGS+=" `$PKG_CONFIG --libs $pkg.getPkgConfigParam()`"
+        CFLAGS="$CFLAGS `$PKG_CONFIG --cflags $pkg.getPkgConfigParam()`"
+        LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs $pkg.getPkgConfigParam()`"
         #end
         #foreach( $flags in $sub.flags )
         #if( $flags.exec )
         $flags.value > /dev/null
         if [ $? -eq 0 ]; then
-            $flags.varName+=" `$flags.value`"
+            $flags.varName="$flags.varName `$flags.value`"
         else
             break
         fi
         #else
-        $flags.varName+="$flags.value"    
+        $flags.varName="$flags.varName $flags.value"    
         #end
         #end
         #foreach( $test in $sub.tests )
@@ -399,7 +409,7 @@
 while true
 do
 	#if( $dependency.platform )
-    if ! isplatform "${dependency.platform}"; then
+    if isnotplatform "${dependency.platform}"; then
         break
     fi
     #end
@@ -424,21 +434,21 @@
             break
         fi
         echo yes
-        CFLAGS+=" `$PKG_CONFIG --cflags $pkg.getPkgConfigParam()`"
-        LDFLAGS+=" `$PKG_CONFIG --libs $pkg.getPkgConfigParam()`"
+        CFLAGS="$CFLAGS `$PKG_CONFIG --cflags $pkg.getPkgConfigParam()`"
+        LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs $pkg.getPkgConfigParam()`"
         #end
         
         #foreach( $flags in $dependency.flags )
         #if( $flags.exec )
         $flags.value > /dev/null
         if [ $? -ne 0 ]; then
-            $flags.varName+=" `$flags.value`"
+            $flags.varName="$flags.varName `$flags.value`"
         else
             ERROR=1
             break
         fi
         #else
-        $flags.varName+="$flags.value"    
+        $flags.varName="$flags.varName $flags.value"    
         #end
         #end
 		#if ( $dependency.make.length() > 0 )
@@ -485,7 +495,7 @@
 		return 1
 	fi
 	#foreach( $def in $val.defines )
-		CFLAGS+=" ${def.toFlags()}"
+		CFLAGS="$CFLAGS ${def.toFlags()}"
 	#end
 	#if( $val.hasMake() )
 	cat >> $TEMP_DIR/make.mk << __EOF__
@@ -517,7 +527,7 @@
 #foreach( $dependency in $target.dependencies )
 dependency_$dependency
 if [ $? -ne 0 ]; then
-	DEPENDENCIES_FAILED+="${dependency} "
+	DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} "
 	ERROR=1
 fi
 #end

mercurial