2007-02-23 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS)
+ <compiler_needs_object>: New tag variable. Default to `no'.
+ (_LT_LINKER_SHLIBS) [ linux ]: Set it to yes for Sun C 5.9.
+ (_LT_LANG_CXX_CONFIG): Also default it to `no'.
+ [ linux ]: Set it to `yes' for Sun C++ 5.9.
+ * libltdl/config/ltmain.m4sh (func_mode_link): If we link
+ no objects but only convenience archives into a library,
+ force expansion if `compiler_needs_object' is yes.
+ For creating a linker input filelist due to long cmdline,
+ extract the first object if `compiler_needs_object' is yes.
+ * doc/libtool.texi (libtool script contents): Document it.
+ Fixes test failures of Sun compilers on GNU/Linux.
+ Report by Terry D. Dontje.
+
* libltdl/config/ltmain.m4sh (func_mode_link): Avoid setting
`$libobjs' to a single space; set it to empty in that case.
simultaneously. Set to @samp{yes} or @samp{no}.
@end defvar
+@defvar compiler_needs_object
+Whether the compiler has to see an object listed on the command line in
+order to successfully invoke the linker. If @samp{no}, then a set of
+convenience archives or a set of object file names can be passed via
+linker-specific options or linker scripts.
+@end defvar
+
@defvar dlopen_support
Whether @code{dlopen} is supported on the platform.
Set to @samp{yes} or @samp{no}.
deplibs="$tmp_deplibs"
if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
if test -n "$whole_archive_flag_spec"; then
save_libobjs=$libobjs
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
output=${output_objdir}/${output_la}.lnk
func_echo "creating linker input file list: $output"
: > $output
- for obj in $save_libobjs
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
do
$ECHO "$obj" >> $output
done
delfiles="$delfiles $output"
- output=\"$file_list_spec$output\"
+ output=$firstobj\"$file_list_spec$output\"
else
func_echo "creating reloadable object files..."
output=$output_objdir/$output_la-${k}.$objext
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(archive_cmds, $1)=
_LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
tmp_sharedflag='-G' ;;
[Compiler flag to allow reflexive dlopens])
_LT_TAGDECL([], [whole_archive_flag_spec], [1],
[Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
[Create an old-style archive from a shared archive])
_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
# Not sure whether something based on
# $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1