Operating System - HP-UX
1820123 Members
3073 Online
109619 Solutions
New Discussion юеВ

Installing our library as primary library

 
Anitha_5
Contributor

Installing our library as primary library

Hi All,

We have created a library that supports minimal functionalites...

So need to know how to install that as the primary library, so that a program must take that as the default library...

Can you please help us in the same...

Thanks in advance

Anitha



2 REPLIES 2
Amit Agarwal_1
Trusted Contributor

Re: Installing our library as primary library

Hi Anitha,

Is your library named similar to some standard library, somehing like libc.sl or libc.so?
If this is the case, and you want your application to use your libc.sl instead of standard libc.sl, then you can set environment variable LD_PRELOAD=.

If your library doesn't have a name collision with any other library then put your libraries at the below mentioned locations. This will ensure that any programs linking with libXXX picks your library.

PA 32-bit: /usr/lib/libXXX.sl
PA 64-bit: /usr/lib/pa20-64/libXXX.sl
IA 32-bit: /usr/lib/hpux32/libXXX.so
IA 64-bit: /usr/lib/hpux64/libXXX.so

though as per convention you should create the above files as symlinks to your library(with differnt extension) but that is not mandatory.

-Amit
Laurent Laperrousaz
Regular Advisor

Re: Installing our library as primary library

You can also use the SHLIB_PATH environment variable to set a primary path to seek the libs you want a user program to run.
add in the .profile:
SHLIB_PATH="path_to_the_directory"
You can add several paths separated by : (like for PATH variable).
The path can be relative or absolute.

Hope this helps