]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
MSVC doesn't support the -l option.
authorPeter Rosin <peda@lysator.liu.se>
Sat, 2 Aug 2008 12:54:10 +0000 (14:54 +0200)
committerPeter Rosin <peda@lysator.liu.se>
Tue, 13 Jan 2009 09:03:58 +0000 (10:03 +0100)
MSVC doesn't support the -l option, instead it expects the exact
library file name. Retain the -l option as long as possible as
libtool recognizes -l internally. Then, as late as possible
transform the -l option to an exact file name (-lfoo ->
foo.lib).
* libltdl/m4/libtool.m4: Add tag variable dashl_xform which
specifies how to transform -l options for the linker.
* libltdl/config/ltmain.m4sh (func_mode_link): Transform -l
options using dashl_xform right before creating the
program or library.

ChangeLog
libltdl/config/ltmain.m4sh
libltdl/m4/libtool.m4

index e1e3bc8397193c8f5a29704a3cbe46a385c0acae..eac2eb4cfee34291fae88d6a1284a73c03675331 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-08-02  Peter Rosin  <peda@lysator.liu.se>
+
+       MSVC doesn't support the -l option, instead it expects the exact
+       library file name. Retain the -l option as long as possible as
+       libtool recognizes -l internally. Then, as late as possible
+       transform the -l option to an exact file name (-lfoo ->
+       foo.lib).
+       * libltdl/m4/libtool.m4: Add tag variable dashl_xform which
+       specifies how to transform -l options for the linker.
+       * libltdl/config/ltmain.m4sh (func_mode_link): Transform -l
+       options using dashl_xform right before creating the
+       program or library.
+
 2008-08-02  Peter Rosin  <peda@lysator.liu.se>
 
        MSVC needs a hint to force it to compile either as C or C++.
index b89812a6dd0461d2fafc2624096d144e04406f8e..7020c3364e7b61d222c5073eb1f90b1aa6e3fb5f 100644 (file)
@@ -5812,6 +5812,13 @@ func_mode_link ()
              *) tmp_libs="$tmp_libs $deplib" ;;
              esac
              ;;
+           -l*)
+             if test -n "$dashl_xform" -a "$linkmode" = prog; then
+               func_stripname '-l' '' "$deplib"
+               deplib=`func_echo_all "$func_stripname_result" | $SED -e $dashl_xform`
+             fi
+             tmp_libs="$tmp_libs $deplib"
+             ;;
            *) tmp_libs="$tmp_libs $deplib" ;;
            esac
          done
@@ -6459,6 +6466,9 @@ EOF
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
                         $SED -e 10q |
                         $EGREP "$file_magic_regex" > /dev/null; then
+                       if test -n "$dashl_xform"; then
+                         a_deplib=`func_echo_all "$name" | $SED -e $dashl_xform`
+                       fi
                        newdeplibs="$newdeplibs $a_deplib"
                        a_deplib=""
                        break 2
index 9c4a7700a720917c8e1c7d1b6b1f104126a5f94d..9c4b71fbd2e6fe53b9298da35cc1f9b378e6baf1 100644 (file)
@@ -5245,6 +5245,8 @@ _LT_TAGDECL([], [dashL_envvar_spec], [1],
     [When moving paths with dashL_envvar, prepend this to each path])
 _LT_TAGDECL([], [compile_tag], [1],
     [Add tag specific option for the compiler])
+_LT_TAGDECL([], [dashl_xform], [1],
+    [Transform -l options for the linker])
 dnl FIXME: Not yet implemented
 dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
 dnl    [Compiler flag to generate thread safe objects])