Hi Bruno, all,

>>>> +         _LT_AC_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'
>>>
>>> Are you sure the compiler driver won't reorder arguments here?

I tested this now, this issue seems ok for the time being.  Let's hope
they don't break it.

The CVS HEAD test suite exposed some further issues:
- whole_archive_flag_spec needs to be adjusted the way you suggested also
  for the C compiler.
- We can trick the C compiler driver into accepting only whole archives
  (and no other objects) by adding a dummy /dev/null argument: it will
  be ignored by GNU binutils ld.  :-)
- The Fortran compilers need an empty $wl: they'll forward everything
  they don't understand to the linker.  Let's not worry about their
  overly verbose warnings about them.
- This means we need white space separators in whole_archive for
  Fortran.
- For the compiler matching, we need more than the first line: the f77
  driver will prepend all output; 5 lines should be sufficient.
| NOTICE: Invoking /home/ralf/download/software/sunstudio/sunstudiomars/bin/f90 
-f77 -ftrap=%none --version
 

Furthermore, the GCJ convenience test fails, due to insufficient
variable resetting done in the Java section of libtool.m4 ($wl in this
case).  I reported this issue a while ago, but never got around to
fixing it yet.

So this is where I'm at now.  I think the postdeps for Fortran are still
wrong, but we can fix that later.

It should be noted that currently, newer versions of config.guess and
config.sub are needed than the checked-in copies of branch-1-5; in any
case they need to be newer than those shipped with Autoconf-2.59, so
they will be updated first.

On i686-pc-linux-gnu, HEAD passes all tests except the GCJ convenience
one, branch-1-5 passes all its tests plus the non-FC HEAD convenience
tests; you can test this with overriding $LIBTOOL for the HEAD testsuite
(plus my pending patch):
  make check-local \
    TESTSUITE_FLAGS='-v -d 11 LIBTOOL=/tmp/branch-1-5/build-suncc/libtool'


Unless anyone has complaints about these patches, I'll probably apply
within the couple of days.

Cheers,
Ralf

HEAD:
2006-05-14  Bruno Haible  <[EMAIL PROTECTED]>,
            Ralf Wildenhues  <[EMAIL PROTECTED]>

        * libltdl/m4/libtool.m4 (_LT_COMPILER_PIC, _LT_LINKER_SHLIBS)
        (_LT_LANG_CXX_CONFIG, _LT_SYS_HIDDEN_LIBDEPS) [ linux ]:
        Add support for Sun C 5.9, Sun C++ 5.9, and Sun Fortran 8.3 on
        Linux.
        * NEWS: Update.

branch-1-5:
2006-05-14  Bruno Haible  <[EMAIL PROTECTED]>,
            Ralf Wildenhues  <[EMAIL PROTECTED]>

        * libtool.m4 [ linux ] (AC_LIBTOOL_LANG_CXX_CONFIG)
        (AC_LIBTOOL_POSTDEP_PREDEP, AC_LIBTOOL_PROG_COMPILER_PIC)
        (AC_LIBTOOL_PROG_LD_SHLIBS): Add support for Sun C 5.9,
        Sun C++ 5.9, and Sun Fortran 8.3 on Linux.
        * NEWS: Update.
2006-05-14  Bruno Haible  <[EMAIL PROTECTED]>,
            Ralf Wildenhues  <[EMAIL PROTECTED]>

        * libltdl/m4/libtool.m4 (_LT_COMPILER_PIC, _LT_LINKER_SHLIBS)
        (_LT_LANG_CXX_CONFIG, _LT_SYS_HIDDEN_LIBDEPS) [ linux ]:
        Add support for Sun C 5.9, Sun C++ 5.9, and Sun Fortran 8.3 on
        Linux.
        * NEWS: Update.

Index: NEWS
===================================================================
RCS file: /cvsroot/libtool/libtool/NEWS,v
retrieving revision 1.193
diff -u -r1.193 NEWS
--- NEWS        14 May 2006 08:20:11 -0000      1.193
+++ NEWS        14 May 2006 12:41:54 -0000
@@ -33,6 +33,7 @@
 * Initial support for RDOS.
 * Fix error with -version-info on systems with version_type=none, such
   as BeOS.
+* Initial support for the Sun compiler suite on GNU/Linux.
 * Bug fixes.
 
 New in 1.9f: 2004-10-23; CVS version 1.9e, Libtool team:
Index: libltdl/m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.64
diff -u -r1.64 libtool.m4
--- libltdl/m4/libtool.m4       14 May 2006 08:43:58 -0000      1.64
+++ libltdl/m4/libtool.m4       14 May 2006 16:01:37 -0000
@@ -3525,6 +3525,14 @@
            _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
            ;;
          *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+             ;;
+           esac
            ;;
        esac
        ;;
@@ -3779,6 +3787,22 @@
         # All Alpha code is PIC.
         _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)
+         # Sun C 5.9
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       *Sun\ F*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+         ;;
+       esac
+       ;;
       esac
       ;;
 
@@ -4126,11 +4150,22 @@
        ifc* | ifort*)                  # Intel Fortran compiler
          tmp_addflag=' -nofor_main' ;;
        esac
-
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs 
$deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       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 /dev/null'
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       *)
+         tmp_sharedflag='-shared' ;;
+       esac
+       _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' 
$libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
         if test "x$supports_anon_versioning" = xyes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > 
$output_objdir/$libname.ver~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> 
$output_objdir/$libname.ver~echo "local: *; };" >> 
$output_objdir/$libname.ver~$CC -shared'"$tmp_addflag"' $libobjs $deplibs 
$compiler_flags ${wl}-soname $wl$soname ${wl}-version-script 
${wl}$output_objdir/$libname.ver -o $lib'
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > 
$output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> 
$output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs 
$compiler_flags ${wl}-soname $wl$soname ${wl}-version-script 
${wl}$output_objdir/$libname.ver -o $lib'
         fi
       else
         _LT_TAGVAR(ld_shlibs, $1)=no
@@ -5753,6 +5788,29 @@
            # dependencies.
            output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v 
conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e 
"s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in 
conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; 
done; $ECHO "X$list" | $Xsed'
            ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+             _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} 
-h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects 
$compiler_flags'
+             _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'
+
+             # Not sure whether something based on
+             # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+             # would be better.
+             output_verbose_link_cmd='echo'
+
+             # Archives containing C++ object files must be created using
+             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+             # necessary to make sure instantiated templates are included
+             # in the archive.
+             _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+             ;;
+           esac
+           ;;
        esac
        ;;
 
@@ -6262,6 +6320,15 @@
   _LT_TAGVAR(postdeps,$1)=
   ;;
 
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+    _LT_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    ;;
+  esac
+  ;;
+
 solaris*)
   case $cc_basename in
   CC*)
2006-05-14  Bruno Haible  <[EMAIL PROTECTED]>,
            Ralf Wildenhues  <[EMAIL PROTECTED]>

        * libtool.m4 [ linux ] (AC_LIBTOOL_LANG_CXX_CONFIG)
        (AC_LIBTOOL_POSTDEP_PREDEP, AC_LIBTOOL_PROG_COMPILER_PIC)
        (AC_LIBTOOL_PROG_LD_SHLIBS): Add support for Sun C 5.9,
        Sun C++ 5.9, and Sun Fortran 8.3 on Linux.
        * NEWS: Update.

Index: NEWS
===================================================================
RCS file: /cvsroot/libtool/libtool/NEWS,v
retrieving revision 1.109.2.46
diff -u -r1.109.2.46 NEWS
--- NEWS        14 May 2006 08:21:23 -0000      1.109.2.46
+++ NEWS        14 May 2006 13:32:32 -0000
@@ -11,6 +11,7 @@
   with large library dependency graphs.
 * Fix error with -version-info on systems with version_type=none, such
   as BeOS.
+* Initial support for the Sun compiler suite on GNU/Linux.
 * Bug Fixes.
 
 New in 1.5.22: 2005-12-18; CVS version 1.5.21a, Libtool team:
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.153
diff -u -r1.314.2.153 libtool.m4
--- libtool.m4  14 May 2006 08:44:38 -0000      1.314.2.153
+++ libtool.m4  14 May 2006 16:02:13 -0000
@@ -3368,6 +3368,29 @@
        # dependencies.
        output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v 
conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED 
"s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in 
conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; 
done; echo $list'
        ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)
+         # Sun C++ 5.9
+         _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} 
-h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects 
$compiler_flags'
+         _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+         _LT_AC_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'
+
+         # Not sure whether something based on
+         # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+         # would be better.
+         output_verbose_link_cmd='echo'
+
+         # Archives containing C++ object files must be created using
+         # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+         # necessary to make sure instantiated templates are included
+         # in the archive.
+         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+         ;;
+       esac
+       ;;
     esac
     ;;
   lynxos*)
@@ -3888,6 +3911,15 @@
   _LT_AC_TAGVAR(postdeps,$1)=
   ;;
 
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    ;;
+  esac
+  ;;
+
 solaris*)
   case $cc_basename in
   CC*)
@@ -5007,6 +5039,14 @@
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
            ;;
          *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+             ;;
+           esac
            ;;
        esac
        ;;
@@ -5253,6 +5293,22 @@
         # All Alpha code is PIC.
         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         ;;
+      *)
+        case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)
+         # Sun C 5.9
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       *Sun\ F*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
+         ;;
+       esac
+       ;;
       esac
       ;;
 
@@ -5567,13 +5623,22 @@
        ifc* | ifort*)                  # Intel Fortran compiler
          tmp_addflag=' -nofor_main' ;;
        esac
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs 
$deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         _LT_AC_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 /dev/null'
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       *)
+         tmp_sharedflag='-shared' ;;
+       esac
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' 
$libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
        if test $supports_anon_versioning = yes; then
          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > 
$output_objdir/$libname.ver~
   cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
   $echo "local: *; };" >> $output_objdir/$libname.ver~
-         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags 
${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver 
-o $lib'
+         $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs 
$compiler_flags ${wl}-soname $wl$soname ${wl}-version-script 
${wl}$output_objdir/$libname.ver -o $lib'
        fi
       else
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
_______________________________________________
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool

Reply via email to