tests: Add bundle action test with buffer realloc.
[cascardo/ovs.git] / build-aux / cccl
index f6972d4..afa0a6b 100644 (file)
@@ -33,10 +33,6 @@ EOF
     exit $1
 }
 
-# Put /usr/bin last in the path, to avoid clashes with MSVC's link
-# Ugly workaround, but should work
-PATH=`echo $PATH | sed -e "s#/usr/bin:##" | sed -e "s#/bin:##"`:/usr/bin
-
 case $MACHTYPE in
     *-msys)
         slash="-"
@@ -49,7 +45,7 @@ esac
 # We'll assume cl to start out
 prog=cl
 # opts specifies the command line to pass to the MSVC program
-clopt="${slash}nologo"
+clopt="${slash}nologo ${slash}FS"
 linkopt="${slash}nologo"
 # gotparam is 0 if we didn't ever see a param, in which case we show usage()
 gotparam=
@@ -93,18 +89,23 @@ EOF
         linkopt="$linkopt ${slash}DEBUG"
         ;;
 
+    -O0)
+        clopt="$clopt ${slash}Od ${slash}D_DEBUG"
+        ;;
+
+    -O2)
+        clopt="$clopt ${slash}O2"
+        ;;
+
     -L*)
         path=`echo "$1" | sed 's/-L//'`
-        linkopt="$linkopt /LIBPATH:$path"
+        linkopt="$linkopt ${slash}LIBPATH:$path"
+        cl_linkopt="${slash}link ${slash}LIBPATH:\"$path\""
         ;;
 
     -l*)
         lib=`echo "$1" | sed 's/-l//'`
-    if [ $lib != "dnsapi" -a $lib != "ws2_32" -a $lib != "wsock32" ]; then
-      lib="lib$lib.lib"
-    else
-      lib="$lib.lib"
-    fi
+        lib="$lib.lib"
 
         clopt="$clopt $lib"
         linkopt="$linkopt $lib"
@@ -147,6 +148,14 @@ EOF
         #ignore warnings
         ;;
 
+    -Q*)
+        #ignore link warnings
+        ;;
+
+    -fno-strict-aliasing*)
+        #ignore aliasing
+        ;;
+
     -isystem)
         shift
         clopt="$clopt -I$1"
@@ -192,11 +201,13 @@ fi
 
 # choose which opts we built up based on which program will actually run
 if test x$prog = xcl ; then
-    opts=$clopt
+    opts="$clopt $cl_linkopt"
 else
     opts=$linkopt
 fi
 
-echo "$prog $opts"
+if test x$V = x1 ; then
+    echo "$prog $opts"
+fi
 exec $prog $opts
 exit 0