diff options
author | Anthony Green <green@moxielogic.com> | 2018-03-27 11:14:56 -0400 |
---|---|---|
committer | Anthony Green <green@moxielogic.com> | 2018-03-27 11:14:56 -0400 |
commit | d78c5f64f834c24a769bee78cfb7db4d468b6b21 (patch) | |
tree | f6f9d8d9e375f1e0d126cdb8b6f09928cad2fdab /msvcc.sh | |
parent | f318bb63c5dc623d5a69ffc4a59a330050cac567 (diff) | |
download | libffi-d78c5f64f834c24a769bee78cfb7db4d468b6b21.tar.gz |
Deal with libpath
Diffstat (limited to 'msvcc.sh')
-rwxr-xr-x | msvcc.sh | 27 |
1 files changed, 19 insertions, 8 deletions
@@ -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 |