cccl: Handle library paths for one shot compilation.
[cascardo/ovs.git] / build-aux / cccl
index c614ecb..0c7f3d9 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="-"
@@ -90,11 +86,13 @@ EOF
     -g[0-9] | -g)
         # cl only supports one debugging level
         clopt="$clopt ${slash}Zi"
+        linkopt="$linkopt ${slash}DEBUG"
         ;;
 
     -L*)
         path=`echo "$1" | sed 's/-L//'`
-        linkopt="$linkopt /LIBPATH:$path"
+        linkopt="$linkopt ${slash}LIBPATH:\"$path\""
+        cl_linkopt="${slash}link ${slash}LIBPATH:\"$path\""
         ;;
 
     -l*)
@@ -191,7 +189,7 @@ 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