Skip to content

Commit

Permalink
cccl: Handle library paths for one shot compilation.
Browse files Browse the repository at this point in the history
When one wishes to compile and link a program with an
external library in one shot, additional
option "-link" is expected after all the other options. For example,

$ cl -I/c/OpenSSL-Win32/include 3.c -link -LIBPATH:"C:/OpenSSL-Win32/lib"

This is needed in an upcoming commit to compile conftest.c in autoconf.

Signed-off-by: Gurucharan Shetty <[email protected]>
  • Loading branch information
shettyg committed Jan 31, 2014
1 parent 20bd44f commit b73d3fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build-aux/cccl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ EOF

-L*)
path=`echo "$1" | sed 's/-L//'`
linkopt="$linkopt /LIBPATH:$path"
linkopt="$linkopt ${slash}LIBPATH:\"$path\""
cl_linkopt="${slash}link ${slash}LIBPATH:\"$path\""
;;

-l*)
Expand Down Expand Up @@ -188,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
Expand Down

0 comments on commit b73d3fe

Please sign in to comment.