Re: [gentoo-user] prelink a dynamic library

2008-10-03 Thread Helmut Jarausch
On  2 Oct, [EMAIL PROTECTED] wrote:
 On Wed, 01 Oct 2008 18:53:04 +0200 (CEST)
 Helmut Jarausch [EMAIL PROTECTED] wrote:
 
 Hi,
 
 Hello Helmut,
  
 I want to create a shared library, say libULIB.so,
 which needs additional shared libraries, e.g. libmpfr.so and
 libgmp.so .
 
 My users only use the functions provided by libULIB.so.
 
 Is there a means to prelink libULIB.so, so that the libraries
 libmpfr.so and libgmp.so are not needed by the user?
 
 You should be able to just provide the libraries to the linker when
 linking your shared object. When *running* the application, your shared
 object (i.e. the loader) should transitively pull in the libs on which
 yours depends. You can check those dependencies using ldd your-lib.
 
 Hope this helps,
 Patric

Thanks Patric, but unfortunately that's not what I want.
In this case, these secondary libraries (e.g. libmpfr.so and
libgmp.so) have to be present on the target machines together
with an 'rpath' if they are in non-standard directories.

My aim was to let the linker generate a big library which
obseletes the secondary libraries.

Helmut.

-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany




Re: [gentoo-user] prelink a dynamic library

2008-10-03 Thread b.n.

Helmut Jarausch ha scritto:

On  2 Oct, [EMAIL PROTECTED] wrote:

On Wed, 01 Oct 2008 18:53:04 +0200 (CEST)
Helmut Jarausch [EMAIL PROTECTED] wrote:


Hi,

Hello Helmut,
 

I want to create a shared library, say libULIB.so,
which needs additional shared libraries, e.g. libmpfr.so and
libgmp.so .

My users only use the functions provided by libULIB.so.

Is there a means to prelink libULIB.so, so that the libraries
libmpfr.so and libgmp.so are not needed by the user?

You should be able to just provide the libraries to the linker when
linking your shared object. When *running* the application, your shared
object (i.e. the loader) should transitively pull in the libs on which
yours depends. You can check those dependencies using ldd your-lib.

Hope this helps,
Patric


Thanks Patric, but unfortunately that's not what I want.
In this case, these secondary libraries (e.g. libmpfr.so and
libgmp.so) have to be present on the target machines together
with an 'rpath' if they are in non-standard directories.

My aim was to let the linker generate a big library which
obseletes the secondary libraries.


If I understand correctly, you want them to be statically linked.

m.



Re: [gentoo-user] prelink a dynamic library

2008-10-03 Thread Paul Hartman
On Wed, Oct 1, 2008 at 11:53 AM, Helmut Jarausch
[EMAIL PROTECTED] wrote:
 Hi,

 I want to create a shared library, say libULIB.so,
 which needs additional shared libraries, e.g. libmpfr.so and
 libgmp.so .

 My users only use the functions provided by libULIB.so.

 Is there a means to prelink libULIB.so, so that the libraries
 libmpfr.so and libgmp.so are not needed by the user?

use the -static commandline option of gcc.

Paul



Re: [gentoo-user] prelink a dynamic library

2008-10-02 Thread bzk0711
On Wed, 01 Oct 2008 18:53:04 +0200 (CEST)
Helmut Jarausch [EMAIL PROTECTED] wrote:

 Hi,

Hello Helmut,
 
 I want to create a shared library, say libULIB.so,
 which needs additional shared libraries, e.g. libmpfr.so and
 libgmp.so .
 
 My users only use the functions provided by libULIB.so.
 
 Is there a means to prelink libULIB.so, so that the libraries
 libmpfr.so and libgmp.so are not needed by the user?

You should be able to just provide the libraries to the linker when
linking your shared object. When *running* the application, your shared
object (i.e. the loader) should transitively pull in the libs on which
yours depends. You can check those dependencies using ldd your-lib.

Hope this helps,
Patric



[gentoo-user] prelink a dynamic library

2008-10-01 Thread Helmut Jarausch
Hi,

I want to create a shared library, say libULIB.so,
which needs additional shared libraries, e.g. libmpfr.so and
libgmp.so .

My users only use the functions provided by libULIB.so.

Is there a means to prelink libULIB.so, so that the libraries
libmpfr.so and libgmp.so are not needed by the user?

I.e.

instead of

g++ Example.C -lUlib -lmpfr -lgmp

it should be suffucient to say

g++ Example.C -lUlib

Given Ulib.o I've tried

g++ -shared -o libUlib.so -fpic -Wl,-soname,libUlib.so \
-Wl,-rpath,$LIBPATH -Wl,-export-dynamic \
Ulib.o -L $LIBPATH -lmpfr -lgmp

but I still need -lmpfr -lgmp to get an executable.

Many thanks for a hint,
Helmut.

-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany