Deal with libpath
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
diff --git a/msvcc.sh b/msvcc.sh
index bdb1256..3195765 100755
--- a/msvcc.sh
+++ b/msvcc.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+!/bin/sh
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
@@ -44,12 +44,14 @@
args_orig=$@
args="-nologo -W3"
+linkargs=
static_crt=
debug_crt=
cl="cl"
ml="ml"
safeseh="-safeseh"
output=
+libpaths=
while [ $# -gt 0 ]
do
@@ -160,22 +162,22 @@ do
;;
-L)
p=$(cygpath -m $2)
- args="$args /LIBPATH:$p"
+ linkargs="$linkargs /LIBPATH:$p"
shift 2
;;
-L*)
p=$(cygpath -m ${1#-L})
- args="$args /LIBPATH:$p"
+ linkargs="$linkargs /LIBPATH:$p"
shift 1
;;
-l*)
IFS_save="$IFS"
IFS=\;
found=
- for d in $LIB; do
- d="$(echo $d | sed -e 's,\\,/,g')"
- if [ -f "$d/lib${1#-l}.lib" ]; then
- found="lib${1#-l}.lib"
+ for d in $libpaths; do
+ d=`cygpath $d`
+ if [ -f "$d/lib${1#-l}.a" ]; then
+ found="lib${1#-l}.a"
break;
fi
done
@@ -244,9 +246,18 @@ done
# by MSVC. Add back those optimizations if this is an optimized build.
# NOTE: These arguments must come after all others.
if [ -n "$opt" ]; then
- args="$args -link -OPT:REF -OPT:ICF -INCREMENTAL:NO"
+ linkargs="$linkargs -OPT:REF -OPT:ICF -INCREMENTAL:NO"
fi
+if [ -n "$linkargs" ]; then
+ args="$args /link $linkargs"
+fi
+
+echo *******************************************************************************************
+echo $args
+echo *******************************************************************************************
+
+
if [ -n "$static_crt" ]; then
md=-MT
else