Hi Kevin,

On Mon, Apr 10, 2000 at 10:22:54PM -0400, Kevin Atkinson wrote:
> 
> About a week ago I posted this massage to the libtool mailing but I have
> yet to receive any replies.
> 
> I could REALLY use some help here.  I understand I am using a
> developmental version and will be willing to work with you to help improve
> libtools.

I've been away for about two weeks so it would have been hard for me to
respond.  :-)

> Maybe I should just not use the CXX language features and just some how
> make sure all the right libraries get linked in and just avoid using
> global variables which require initilization...

That's one way to go, but I've run accross too many problems with the
C support in libtool when compiling C++ shared libraries.  It wasn't
just the features you mentioned.  Then again, if you only need to use
gcc then you might be okay.

I responded to your original message below.

> ---------- Forwarded message ----------
> Date: Tue, 4 Apr 2000 17:40:01 -0400 (EDT)
> From: Kevin Atkinson <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Shared libraries w/ C++ and libltdl.
> Resent-Date: Tue, 4 Apr 2000 17:39:36 -0400
> Resent-From: [EMAIL PROTECTED]
> 
> I am having all sorts of problems with shared libraries and C++ with the
> multi-lang. branch.
> 
> PROBLEM 1
> 
> 1) On many platforms libtool can create shared libraries for C but not for
> C++

Right.  I don't have access to all of the platforms supported by libtool's
C library support so I wasn't able to configurations for all of the
platforms.  Any contributions would be more than welcome.

> 2) On many of the platforms which libtool does know how to create C++
> shared libraries libstdc++ is not compiled as a shared library, nor is it
> compiled with PIC support.  This means that linking the shared library
> fails miserably because it will try to link the non PIC code into the
> shared library.

I'm a bit confused here.  What does compiling libtstdc++ have to do with
libtool?  The gcc/libstdc++ distribution has its own support for compiling
that library as a shared one.

> So my question is 
> 
> 1) Is there a way to force libtool NOT to link it as a C++ library if it
> can't do it as a shared library.  IE don't fall back to only making a
> static library.

To my knowledge, there is currently no way to do this.  IMHO, libtool
should not do this either.  It is better to add the missing C++ shared
library configurations to ltcf-cxx.sh.

> 2) Is there a way to force libtool NOT to link in libstdc++ but STILL link
> it using c++?

Try using g++'s -nostdlib flag, or one of the other related ones when
configuring your library.  If I set things up properly, libtool should
use that flag when configuring the C++ support, and avoid linking in
libstdc++.  Note that -nostdlib will also prevent the start files from
being linked in.

> In either case I would like the C++ libraries to be specified in the .la
> files so that they will get statically linked in by libtool when a C program
> uses my libraries.

You're linking C++ libraries to a C program?  That seems a bit odd.  Did I
misunderstand you?

> PROBLEM 2
> 
> Is they a way to do the ldpreloding stuff that is 100% transparent to
> programs linking with my libraries using libtool?  I want the end user to
> have to doing noting but "libtool --mode=link ... -l<My library>" and have
> libtool automatically preload the necessary modules and set up the data
> structure automatically so that the end user does NOT have to call
> LTDL_SET_PRELOADED_SYMBOLS().

I think that I'll let someone else handle this question.  Bob, thanks for
helping out!  I'm not too familiar with this feature of libtool yet.

-Ossama
-- 
Ossama Othman <[EMAIL PROTECTED]>
Distributed Object Computing Laboratory, Univ. of California at Irvine
1024D/F7A394A8 - 84ED AA0B 1203 99E4 1068  70E6 5EB7 5E71 F7A3 94A8

Reply via email to