[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Libtool misfeature on HP-UX
From: |
Schleicher Ralph (LLI) |
Subject: |
Libtool misfeature on HP-UX |
Date: |
Wed, 22 May 2002 18:31:41 +0200 |
ltmain.sh (GNU libtool) 1.4.2 (1.922.2.54 2001/09/11 03:33:37)
Hi,
I encountered a problem with Libtool libraries on HP-UX.
Consider the following (simplified) Makefile.am:
----------------
lib_LTLIBRARIES = libfoo.la libbar.la
libfoo_la_SOURCES = foo.c
libbar_la_SOURCES = bar.c
libbar_la_LDFLAGS = libfoo.la
----------------
When relinking libbar.la for installation, the command sequence is
----------------
libtool: install: warning: relinking `libbar.la'
cd /home/w3016.5/schleich/tmp/foo; /bin/sh ./libtool --mode=relink \
gcc -g -O2 -o libbar.la -rpath /usr/local/lib libfoo.la libbar_la-bar.lo
/usr/ccs/bin/ld -b +h libbar.sl +b /usr/local/lib -o .libs/libbar.sl \
libbar_la-bar.lo /usr/local/lib/libfoo.sl -lc
----------------
The problem is that libfoo.sl is not subject to dynamic file name lookup
via the built-in library search path or SHLIB_PATH environment variable
(LD_LIBRARY_PATH on HP-UX 11.00) because it has been specified as an
absolute file name and *not* via a -l or -l: switch. This is a problem
if you want to make a binary distribution with a different directory
layout -- just setting SHLIB_PATH does not work.
I propose to translate the Libtool link command on HP-UX as follows:
----------------
/usr/ccs/bin/ld -b +h libbar.sl +b /usr/local/lib -o .libs/libbar.sl \
libbar_la-bar.lo /usr/local/lib/libfoo.sl -lc
/usr/ccs/bin/chatr -l /usr/local/lib/libfoo.sl .libs/libbar.sl >/dev/null
----------------
The chatr(1) command has the following effect:
----------------
$ chatr .libs/libbar.sl
.libs/libbar.sl:
shared library
shared library dynamic path search:
SHLIB_PATH enabled first
embedded path enabled second /usr/local/lib
internal name:
libbar.sl
shared library list:
static /usr/local/lib/libfoo.sl <<< *look here*
dynamic /usr/lib/libc.1
[...]
$ chatr -l /usr/local/lib/libfoo.sl .libs/libbar.sl
.libs/libbar.sl:
shared library
shared library dynamic path search:
SHLIB_PATH enabled first
embedded path enabled second /usr/local/lib
internal name:
libbar.sl
shared library list:
dynamic /usr/local/lib/libfoo.sl <<< *look here*
dynamic /usr/lib/libc.1
[...]
----------------
Here is the relevant section from the chatr(1) manual page:
----------------
-l library Indicate that the specified shared library is
subject to run-time path lookup if directory
path lists are provided (see +s and +b).
----------------
Best regards,
--
Ralph
- Libtool misfeature on HP-UX,
Schleicher Ralph (LLI) <=