Ooops, exported the wrong thing from git... Sorry for the noise. Here's the intended patch
Cheers, Peter
commit 1e1a3cb447ee0d725d6cd8249358d9d5595a039b Author: Peter Rosin <peda@lysator.liu.se> Date: Tue Jun 22 11:07:22 2010 +0200 MSVC needs a hint to force it to compile either as C or C++. * libltdl/m4/libtool.m4: Add tag variable compile_tag to enable tag specific compiler options that are bad in the linking phase. * libltdl/config/ltmain.m4sh: Add the tag specific options to the compile command line. * doc/libtool.texi (libtool script contents): Document new variable. diff --git a/ChangeLog b/ChangeLog index 18e346d..2320bb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2010-06-22 Peter Rosin <peda@lysator.liu.se> + + MSVC needs a hint to force it to compile either as C or C++. + * libltdl/m4/libtool.m4: Add tag variable compile_tag to + enable tag specific compiler options that are bad in the + linking phase. + * libltdl/config/ltmain.m4sh: Add the tag specific options + to the compile command line. + * doc/libtool.texi (libtool script contents): Document + new variable. + 2010-06-21 Gary V. Vaughan <gary@gnu.org> Ensure getopts.m4sh is compatible with Autoconf-2.61 and newer. diff --git a/doc/libtool.texi b/doc/libtool.texi index 7ae2c66..94d9268 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -5910,6 +5910,11 @@ Whether libtool should build static libraries on this system. Set to @samp{yes} or @samp{no}. @end defvar +@defvar compile_tag +Add tag specific option for the compiler. Normally disabled (i.e. +@code{compile_tag} is empty). +@end defvar + @defvar compiler_c_o Whether the compiler supports the @option{-c} and @option{-o} options simultaneously. Set to @samp{yes} or @samp{no}. diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index a325e27..d484694 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -854,6 +854,10 @@ func_mode_compile () pic_mode=default fi + if test -n "$compile_tag"; then + base_compile="$base_compile $compile_tag" + fi + # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index b93dd0c..e5f2459 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -5347,6 +5347,8 @@ _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) +_LT_TAGDECL([], [compile_tag], [1], + [Add tag specific option for the compiler]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects])