support for SunPRO C/C++ on Linux

2006-05-08 Thread Bruno Haible
Hi,

Here is a patch that adds support for Sun's C and C++ compilers 5.9, ported
from Solaris to Linux. They exist for x86 and x86_64; I tested it only on x86.
The compiler executable for C is called 'c89' and 'c99' (two slightly
different programs); for C++ it is called 'CC'.

Without this patch, several tests fail:

PASS: cdemo-static.test
PASS: cdemo-make.test
PASS: cdemo-exec.test
PASS: demo-static.test
FAIL: demo-make.test
FAIL: demo-exec.test
FAIL: demo-inst.test
PASS: demo-unst.test
PASS: depdemo-static.test
PASS: depdemo-make.test
PASS: depdemo-exec.test
PASS: depdemo-inst.test
PASS: depdemo-unst.test
PASS: mdemo-static.test
FAIL: mdemo-make.test
SKIP: mdemo-exec.test
SKIP: mdemo-inst.test
PASS: mdemo-unst.test
SKIP: cdemo-conf.test
SKIP: cdemo-make.test
SKIP: cdemo-exec.test
SKIP: demo-conf.test
SKIP: demo-make.test
SKIP: demo-exec.test
SKIP: demo-inst.test
SKIP: demo-unst.test
SKIP: deplibs.test
SKIP: depdemo-conf.test
SKIP: depdemo-make.test
SKIP: depdemo-exec.test
SKIP: depdemo-inst.test
SKIP: depdemo-unst.test
SKIP: mdemo-conf.test
SKIP: mdemo-make.test
SKIP: mdemo-exec.test
SKIP: mdemo-inst.test
SKIP: mdemo-unst.test
SKIP: dryrun.test
PASS: demo-nofast.test
FAIL: demo-make.test
FAIL: demo-exec.test
FAIL: demo-inst.test
PASS: demo-unst.test
PASS: demo-pic.test
FAIL: demo-make.test
FAIL: demo-exec.test
PASS: demo-nopic.test
FAIL: demo-make.test
FAIL: demo-exec.test
PASS: depdemo-nofast.test
PASS: depdemo-make.test
PASS: depdemo-exec.test
PASS: depdemo-inst.test
PASS: depdemo-unst.test
SKIP: cdemo-shared.test
SKIP: cdemo-make.test
SKIP: cdemo-exec.test
SKIP: demo-shared.test
SKIP: demo-make.test
SKIP: demo-exec.test
SKIP: demo-inst.test
SKIP: hardcode.test
SKIP: build-relink.test
SKIP: noinst-link.test
SKIP: demo-unst.test
SKIP: depdemo-shared.test
SKIP: depdemo-make.test
SKIP: depdemo-exec.test
SKIP: depdemo-inst.test
SKIP: build-relink2.test
SKIP: depdemo-unst.test
SKIP: mdemo-shared.test
SKIP: mdemo-make.test
SKIP: mdemo-exec.test
SKIP: mdemo-inst.test
SKIP: mdemo-unst.test
PASS: assign.test
PASS: link.test
PASS: link-2.test
PASS: nomode.test
PASS: quote.test
PASS: sh.test
PASS: suffix.test
SKIP: pdemo-conf.test
SKIP: pdemo-make.test
SKIP: pdemo-exec.test
SKIP: pdemo-inst.test
SKIP: mdemo-conf.test
SKIP: mdemo-make.test
SKIP: mdemo2-conf.test
SKIP: mdemo2-make.test
SKIP: mdemo2-exec.test
PASS: duplicate_members.test
PASS: link-order.test
PASS: tagdemo-static.test
PASS: tagdemo-make.test
PASS: tagdemo-exec.test
SKIP: tagdemo-conf.test
SKIP: tagdemo-make.test
SKIP: tagdemo-exec.test
SKIP: tagdemo-shared.test
SKIP: tagdemo-make.test
SKIP: tagdemo-exec.test
PASS: f77demo-static.test
PASS: f77demo-make.test
PASS: f77demo-exec.test
SKIP: f77demo-conf.test
SKIP: f77demo-make.test
SKIP: f77demo-exec.test
SKIP: f77demo-shared.test
SKIP: f77demo-make.test
SKIP: f77demo-exec.test

With this patch, the FAILs are turned into PASS; all tests PASS or SKIP.
Additionally, with the corresponding patch to config.rpath, the
autoconf-lib-link testsuite passes as well.


2006-05-05  Bruno Haible  [EMAIL PROTECTED]

* libtool.m4 (AC_LIBTOOL_LANG_CXX_CONFIG): Add support for Sun C++ 5.9
on Linux.
(AC_LIBTOOL_PROG_COMPILER_PIC): Add support for Sun C 5.9 and
Sun C++ 5.9.
(AC_LIBTOOL_PROG_LD_SHLIBS): Add support for Sun C 5.9.

*** libtool-1.5.22/libtool.m4.bak   2005-12-18 22:53:17.0 +0100
--- libtool-1.5.22/libtool.m4   2006-05-07 02:17:19.0 +0200
***
*** 3353,3358 
--- 3353,3377 
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v 
conftest.$objext 21 | 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'
;;
+   CC*)
+   # 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$convenience ${wl}--no-whole-archive'
+ 
+   # Not sure whether something based on
+   # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 21
+   # 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
 

Re: support for SunPRO C/C++ on Linux

2006-05-08 Thread Ralf Wildenhues
Hi Bruno,

* Bruno Haible wrote on Mon, May 08, 2006 at 09:44:42PM CEST:
 
 Here is a patch that adds support for Sun's C and C++ compilers 5.9, ported
 from Solaris to Linux. They exist for x86 and x86_64; I tested it only on x86.

Thanks!

 The compiler executable for C is called 'c89' and 'c99' (two slightly
 different programs); for C++ it is called 'CC'.

How unfortunate.  Several compilers on GNU/Linux install themselves with
links or wrappers named c89 or c99.  I don't think all of them
understand -KPIC, and none of the others will understand '-Qoption ld'.
We should probably do a --version|-V test as well to disambiguate.
(To keep the size overhead down, we may want to map version strings to
compiler base names somewhere earlier; ugh.)

 With this patch, the FAILs are turned into PASS; all tests PASS or SKIP.

Which ones skip?

Cheers,
Ralf


___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: support for SunPRO C/C++ on Linux

2006-05-08 Thread Ralf Wildenhues
Hi Bruno,

* Bruno Haible wrote on Mon, May 08, 2006 at 10:40:59PM CEST:
 
   The compiler executable for C is called 'c89' and 'c99' (two slightly
   different programs); for C++ it is called 'CC'.
 
  How unfortunate.  Several compilers on GNU/Linux install themselves with
  links or wrappers named c89 or c99.  I don't think all of them
  understand -KPIC, and none of the others will understand '-Qoption ld'.
  We should probably do a --version|-V test as well to disambiguate.
 
 Something like this, or test whether $CC -flags  /dev/null gives no 
 error...

Yes, maybe.

 Does the same hold also for the name 'CC' of the C++ compiler?

I think that is a lot safer.

 I'll resend a new patch.

Thanks.

Cheers,
Ralf


___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool