From a260bb0044deba5ad71b1d1534fb80f2ec2545ba Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Fri, 3 Feb 2006 20:05:00 +0000 Subject: [PATCH] * libtool.m4 [ solaris ] (AC_LIBTOOL_LANG_CXX_CONFIG) (AC_LIBTOOL_PROG_LD_SHLIBS) < whole_archive_flag_spec >: Fix this once and for all, for both the SUN compiler suite (cc/CC/f77/f90/f95) and GCC. Reported by Yuri Pukhalsky . --- ChangeLog | 6 ++++++ libtool.m4 | 36 ++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index a41492b87..9ecbc3d8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2006-02-03 Ralf Wildenhues + * libtool.m4 [ solaris ] (AC_LIBTOOL_LANG_CXX_CONFIG) + (AC_LIBTOOL_PROG_LD_SHLIBS) < whole_archive_flag_spec >: + Fix this once and for all, for both the SUN compiler suite + (cc/CC/f77/f90/f95) and GCC. + Reported by Yuri Pukhalsky . + * cdemo/Makefile.am: Remove broken use of undocumented Automake variable `$(OBJECTS)'. * demo/Makefile.am, depdemo/Makefile.am: Likewise. diff --git a/libtool.m4 b/libtool.m4 index 5d80b6b58..f082bdd78 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -3577,15 +3577,10 @@ case $host_os in case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes @@ -3632,6 +3627,12 @@ case $host_os in fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac fi ;; esac @@ -6107,17 +6108,16 @@ _LT_EOF case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; + if test "$GCC" = yes; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; -- 2.47.3