Building and linking shared libaries for multiple different versions of UNIX

Richard Sharpe sharpe at
Wed May 16 16:08:38 GMT 2001

At 09:54 AM 5/16/01 -0500, samba-technical at wrote:
>Will you:
>  1. chmod the shared library to +x on HP-UX?

Well, I will ignore HP-UX for a while ...

>  2. Make the shared library extension on HP-UX 'sl' rather than 'so'?
>  3. Is there just one shared library? If more than one, are they
>     dependent on each other? If so, do you plan on hard-coding the
>     runtime path of the installation library directory in the
>     shared libraries?

ATM, just one shared library

>  4. Are you linking against any 3rd-party libraries (OpenSSL, KRB,
>     etc.)? If so, do you plan to add runtime paths to each of
>     these to your library (in which case -rpath won't work
>     everywhere).

Not at the moment.

>  5. On AIX, you need to run '/bin/nm ...' to create a list of
>     the exported symbols and then pass the file created as output
>     to ld before generating the shared library.

OK, thanks ...

>  6. Will you allow creating static *and* shared libraries at the
>     same time? If you do, then handling shared libraries on AIX
>     becomes more interesting.

Yes, I want to support static and shared ... I guess AIX is low on my list
of priorities, unless IBM wants it raised :-)

>  7. How do you plan on versioning the library?

Ummm, good question ... I was planning on calling the current interface
V1.0, and any changes to the interface (like the byte-range locking
addition I discussed with Andrew) would require that I bump the version
number ...

>  8. Will you embed an soname in the snamed library (cf -soname on
>     Linux ld).

Yes, I was planning on $(CC) ... -Wl,-soname,$@ ...

>  9. Will smbd, nmdb, etc. be linked against your shared library?
>     If so, HP-UX and other platforms hardcode -L paths into the
>     binary. Libtool first installs the shared library and then
>     relinks the executables at install time so the correct
>     runtime path is inserted into the binary. Will you do this?
>     Or support the +b option on HP-UX ld (if you do, the binaries
>     will work after being installed but *not* before).

No, smbd and nmbd do not currently use this library. Rather, they use a
lower level abstraction that already exists, which I also use.

>Libtool will make your life easier.

Well, I have a copy of the Autoconf, Automake, and Libtool, but there are a
number of people who present cogent reasons for not using Libtool ...

>albert chin (china at

Richard Sharpe, sharpe at
Samba (Team member,, Ethereal (Team member,
Contributing author, SAMS Teach Yourself Samba in 24 Hours
Author, Special Edition, Using Samba

More information about the samba-technical mailing list