From: Peter Rosin Date: Sat, 2 Aug 2008 12:54:10 +0000 (+0200) Subject: MSVC doesn't support the -l option. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=452faf96f7b06e9eccee01553d95c45080d1cc29;p=thirdparty%2Flibtool.git MSVC doesn't support the -l option. 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. --- diff --git a/ChangeLog b/ChangeLog index e1e3bc839..eac2eb4cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-08-02 Peter Rosin + + 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 MSVC needs a hint to force it to compile either as C or C++. diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index b89812a6d..7020c3364 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -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 diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 9c4a7700a..9c4b71fbd 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -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])