Deal with libpath

This commit is contained in:
Anthony Green
2018-03-27 11:14:56 -04:00
parent f318bb63c5
commit d78c5f64f8

View File

@@ -1,4 +1,4 @@
#!/bin/sh !/bin/sh
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
@@ -44,12 +44,14 @@
args_orig=$@ args_orig=$@
args="-nologo -W3" args="-nologo -W3"
linkargs=
static_crt= static_crt=
debug_crt= debug_crt=
cl="cl" cl="cl"
ml="ml" ml="ml"
safeseh="-safeseh" safeseh="-safeseh"
output= output=
libpaths=
while [ $# -gt 0 ] while [ $# -gt 0 ]
do do
@@ -160,22 +162,22 @@ do
;; ;;
-L) -L)
p=$(cygpath -m $2) p=$(cygpath -m $2)
args="$args /LIBPATH:$p" linkargs="$linkargs /LIBPATH:$p"
shift 2 shift 2
;; ;;
-L*) -L*)
p=$(cygpath -m ${1#-L}) p=$(cygpath -m ${1#-L})
args="$args /LIBPATH:$p" linkargs="$linkargs /LIBPATH:$p"
shift 1 shift 1
;; ;;
-l*) -l*)
IFS_save="$IFS" IFS_save="$IFS"
IFS=\; IFS=\;
found= found=
for d in $LIB; do for d in $libpaths; do
d="$(echo $d | sed -e 's,\\,/,g')" d=`cygpath $d`
if [ -f "$d/lib${1#-l}.lib" ]; then if [ -f "$d/lib${1#-l}.a" ]; then
found="lib${1#-l}.lib" found="lib${1#-l}.a"
break; break;
fi fi
done done
@@ -244,9 +246,18 @@ done
# by MSVC. Add back those optimizations if this is an optimized build. # by MSVC. Add back those optimizations if this is an optimized build.
# NOTE: These arguments must come after all others. # NOTE: These arguments must come after all others.
if [ -n "$opt" ]; then if [ -n "$opt" ]; then
args="$args -link -OPT:REF -OPT:ICF -INCREMENTAL:NO" linkargs="$linkargs -OPT:REF -OPT:ICF -INCREMENTAL:NO"
fi fi
if [ -n "$linkargs" ]; then
args="$args /link $linkargs"
fi
echo *******************************************************************************************
echo $args
echo *******************************************************************************************
if [ -n "$static_crt" ]; then if [ -n "$static_crt" ]; then
md=-MT md=-MT
else else