libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Staging (DESTDIR) directories with libtool 1.5 and HP-UX 11


From: Dano Carroll
Subject: Staging (DESTDIR) directories with libtool 1.5 and HP-UX 11
Date: Fri, 23 Jan 2004 23:50:27 -0600
User-agent: Mutt/1.2.5.1i

Hi,

I've been doing work on building RPM's for HP-UX 11 and 11i, so you
probably already know what I'm going to ask about. 

How do I invoke libtool in order to install an executable into a
temporary directory which is not its final destination. In addition,
this executable is linked against a shared library that was built at
the same time that is also going into a temporary directory which is
not the library's final destination.

I am not concerned about automake or autoconf at this point. I will
demonstrate what I get using the hello program referred to in the goat
book. The Makefile I use is given below. For the purpose of this
demonstration, libtrim.sl is already installed in /usr/local/lib. I am
using libtool 1.5 and gcc 3.3.2, both installed in /usr/local

Makefile--
hello: main.c libhello.la
        libtool --mode=link /usr/local/bin/gcc -o hello main.c libhello.la

libhello.la: hello.lo libtrim.la
        libtool --mode=link /usr/local/bin/gcc -rpath /usr/local/lib -o 
libhello.la hello.lo libtrim.la

libtrim.la: trim.lo
        libtool --mode=link /usr/local/bin/gcc -rpath /usr/local/lib -o 
libtrim.la trim.lo

hello.lo: hello.c
        libtool --mode=compile /usr/local/bin/gcc -c hello.c

trim.lo: trim.c
        libtool --mode=compile /usr/local/bin/gcc -c trim.c

install: hello libtrim.la libhello.la
        mkdir -p $(DESTDIR)/usr/local/lib
        mkdir -p $(DESTDIR)/usr/local/bin
        libtool --mode=install /usr/local/bin/install -c libtrim.la 
$(DESTDIR)/usr/local/lib/libtrim.la
        libtool --mode=install /usr/local/bin/install -c libhello.la 
$(DESTDIR)/usr/local/lib/libhello.la
        libtool --mode=install /usr/local/bin/install -c hello 
$(DESTDIR)/usr/local/bin/hello

clean:
        rm -f *.a *.o *.lo *.la *~ hello
        rm -rf .libs
End Makefile--

When I do a "make install", I get no errors. When I do a "make install
DESTDIR=/tmp/hello", I get this:

libtool --mode=install /usr/local/bin/install -c hello 
/tmp/hello/usr/local/bin/hello
libtool: install: warning: `libhello.la' has not been installed in 
`/usr/local/lib'
libtool: install: warning: cannot relink `hello'
/usr/local/bin/install -c hello /tmp/hello/usr/local/bin/hello

The hello file in /tmp/hello/usr/local/bin/hello is the wrapper file,
not a binary. 

What I'm hoping to find out is how I need to use libtool to get what I
want since the documentation seems to imply that I can install
libraries and executables into temporary directories and that once
they are copied into their final directories, everything will work
right.

Sincerely,
Dano Carroll




reply via email to

[Prev in Thread] Current Thread [Next in Thread]