mirror of
git://git.savannah.gnu.org/libtool.git
synced 2024-11-21 01:40:57 +08:00
Add MSVC support.
* libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER) (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) [mingw, cygwin]: Add support for the Microsoft C/C++ Compiler (cl) relying on help from the compile script in Automake. * NEWS: Add note of the above.
This commit is contained in:
parent
57a4a21e9c
commit
1ac3ced59d
@ -1,3 +1,12 @@
|
||||
2010-06-24 Peter Rosin <peda@lysator.liu.se>
|
||||
|
||||
Add MSVC support.
|
||||
* libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER)
|
||||
(_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) [mingw, cygwin]: Add
|
||||
support for the Microsoft C/C++ Compiler (cl) relying on help
|
||||
from the compile script in Automake.
|
||||
* NEWS: Add note of the above.
|
||||
|
||||
2010-07-01 Gary V. Vaughan <gary@gnu.org>
|
||||
|
||||
Skip `enhanced shell option appending' test when not available.
|
||||
|
4
NEWS
4
NEWS
@ -7,6 +7,10 @@ New in 2.2.12 2010-08-??: git version 2.2.11a, Libtool team:
|
||||
- On non-cygwin Windows systems, we now lookup potential library
|
||||
file names without regard to file name case.
|
||||
|
||||
* Changes in supported systems or compilers:
|
||||
- Initial support for the Microsoft C/C++ Compiler, with help from
|
||||
the compile script in unreleased Automake 1.12.
|
||||
|
||||
New in 2.2.10 2010-06-10: git version 2.2.9a, Libtool team:
|
||||
|
||||
* New features:
|
||||
|
104
libltdl/m4/libtool.m4
vendored
104
libltdl/m4/libtool.m4
vendored
@ -2198,8 +2198,9 @@ cygwin* | mingw* | pw32* | cegcc*)
|
||||
need_version=no
|
||||
need_lib_prefix=no
|
||||
|
||||
case $GCC,$host_os in
|
||||
yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
|
||||
case $GCC,$cc_basename in
|
||||
yes,*)
|
||||
# gcc
|
||||
library_names_spec='$libname.dll.a'
|
||||
# DLL is installed to $(libdir)/../bin by postinstall_cmds
|
||||
postinstall_cmds='base_file=`basename \${file}`~
|
||||
@ -2232,13 +2233,42 @@ m4_if([$1], [],[
|
||||
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
|
||||
;;
|
||||
esac
|
||||
dynamic_linker='Win32 ld.exe'
|
||||
;;
|
||||
|
||||
*,cl*)
|
||||
# Native MSVC
|
||||
libname_spec='$name'
|
||||
soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
|
||||
library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}.lib'
|
||||
sys_lib_search_path_spec="$LIB"
|
||||
if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
|
||||
# It is most probably a Windows format PATH.
|
||||
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
|
||||
else
|
||||
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
|
||||
fi
|
||||
# FIXME: find the short name or the path components, as spaces are
|
||||
# common. (e.g. "Program Files" -> "PROGRA~1")
|
||||
# DLL is installed to $(libdir)/../bin by postinstall_cmds
|
||||
postinstall_cmds='base_file=`basename \${file}`~
|
||||
dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
|
||||
dldir=$destdir/`dirname \$dlpath`~
|
||||
test -d \$dldir || mkdir -p \$dldir~
|
||||
$install_prog $dir/$dlname \$dldir/$dlname'
|
||||
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
|
||||
dlpath=$dir/\$dldll~
|
||||
$RM \$dlpath'
|
||||
shlibpath_overrides_runpath=yes
|
||||
dynamic_linker='Win32 link.exe'
|
||||
;;
|
||||
|
||||
*)
|
||||
# Assume MSVC wrapper
|
||||
library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
|
||||
dynamic_linker='Win32 ld.exe'
|
||||
;;
|
||||
esac
|
||||
dynamic_linker='Win32 ld.exe'
|
||||
# FIXME: first we should search . and the directory the executable is in
|
||||
shlibpath_var=PATH
|
||||
;;
|
||||
@ -4250,8 +4280,13 @@ m4_if([$1], [CXX], [
|
||||
_LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
|
||||
;;
|
||||
cygwin* | mingw* | cegcc*)
|
||||
case $cc_basename in
|
||||
cl*) ;;
|
||||
*)
|
||||
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
|
||||
;;
|
||||
@ -4794,6 +4829,35 @@ _LT_EOF
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
case $cc_basename in
|
||||
cl*)
|
||||
# Native MSVC
|
||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
||||
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
|
||||
_LT_TAGVAR(always_export_symbols, $1)=yes
|
||||
_LT_TAGVAR(file_list_spec, $1)='@'
|
||||
# Tell ltmain to make .lib files, not .a files.
|
||||
libext=lib
|
||||
# Tell ltmain to make .dll files, not .so files.
|
||||
shrext_cmds=".dll"
|
||||
# FIXME: Setting linknames here is a bad hack.
|
||||
_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
|
||||
sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
|
||||
else
|
||||
sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
|
||||
fi~
|
||||
$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs @$output_objdir/$soname.exp -Wl,-DLL~
|
||||
linknames='
|
||||
# The linker will not automatically build a static lib if we build a DLL.
|
||||
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
|
||||
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
||||
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
|
||||
# Don't use ranlib
|
||||
_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
|
||||
;;
|
||||
*)
|
||||
# Assume MSVC wrapper
|
||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
||||
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
|
||||
# Tell ltmain to make .lib files, not .a files.
|
||||
@ -4809,6 +4873,8 @@ _LT_EOF
|
||||
_LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
|
||||
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
darwin* | rhapsody*)
|
||||
_LT_DARWIN_LINKER_FEATURES($1)
|
||||
@ -5738,6 +5804,36 @@ if test "$_lt_caught_CXX_error" != yes; then
|
||||
;;
|
||||
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
case $GXX,$cc_basename in
|
||||
,cl* | no,cl*)
|
||||
# Native MSVC
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
||||
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
|
||||
_LT_TAGVAR(always_export_symbols, $1)=yes
|
||||
_LT_TAGVAR(file_list_spec, $1)='@'
|
||||
# Tell ltmain to make .lib files, not .a files.
|
||||
libext=lib
|
||||
# Tell ltmain to make .dll files, not .so files.
|
||||
shrext_cmds=".dll"
|
||||
# FIXME: Setting linknames here is a bad hack.
|
||||
_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
|
||||
_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
|
||||
$SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
|
||||
else
|
||||
$SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
|
||||
fi~
|
||||
$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs @$output_objdir/$soname.exp -Wl,-DLL~
|
||||
linknames='
|
||||
# The linker will not automatically build a static lib if we build a DLL.
|
||||
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
|
||||
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
||||
# Don't use ranlib
|
||||
_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
|
||||
;;
|
||||
*)
|
||||
# g++
|
||||
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
|
||||
# as there is no search path for DLLs.
|
||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
|
||||
@ -5761,6 +5857,8 @@ if test "$_lt_caught_CXX_error" != yes; then
|
||||
_LT_TAGVAR(ld_shlibs, $1)=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
_LT_DARWIN_LINKER_FEATURES($1)
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user