summaryrefslogtreecommitdiff
path: root/msvcc.sh
diff options
context:
space:
mode:
authorAnthony Green <green@moxielogic.com>2018-03-27 11:14:56 -0400
committerAnthony Green <green@moxielogic.com>2018-03-27 11:14:56 -0400
commitd78c5f64f834c24a769bee78cfb7db4d468b6b21 (patch)
treef6f9d8d9e375f1e0d126cdb8b6f09928cad2fdab /msvcc.sh
parentf318bb63c5dc623d5a69ffc4a59a330050cac567 (diff)
downloadlibffi-d78c5f64f834c24a769bee78cfb7db4d468b6b21.tar.gz
Deal with libpath
Diffstat (limited to 'msvcc.sh')
-rwxr-xr-xmsvcc.sh27
1 files changed, 19 insertions, 8 deletions
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