automake
[Top][All Lists]
Advanced

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

Wait, isn't rpath supposed to be set automagically?


From: Miles Bader
Subject: Wait, isn't rpath supposed to be set automagically?
Date: Sun, 26 Feb 2012 23:47:11 +0900

I thought that as long as one used ".la" libraries, automake+libtool
was supposed to handle all the grotty stuff like rpath automatically,
adding -rpath $(libdir) if you depend on libraries installed to libdir
and libdir isn't on the system library search path.  [Yeah, I also
know some people hate rpath, but ...]

But ... it doesn't seem to.  Is something broken, is there an option I
should set... or?

[I guess I can add "-rpath <blahblaha>" somewhere in Makefile.am, but
I don't really want to add system-dependent stuff that libtool's
supposed to be handling; isn't that why libtool exists in the first
place?]

automake version 1.11.3, libtool version 2.4.2

Thanks,

-Miles


Example:

configure.ac:
        AC_INIT([blah], [0.1], [bob])
        AM_INIT_AUTOMAKE([foreign])
        LT_INIT
        AC_PROG_CC
        AC_CONFIG_FILES([Makefile])
        AC_OUTPUT
Makefile.am:
        bin_PROGRAMS = blah
        lib_LTLIBRARIES = liboink.la
        blah_SOURCES = blah.c
        blah_LDADD = liboink.la
        liboink_la_SOURCES = oink.c
blah.c:
        extern void oink ();
        int main () { oink (); }
oink.c:
        void oink () { }

Commands:
        $ autoreconf --install
                ...
        $ ./configure
                ...
        $ make
                ...
        $ sudo make install
                ...
        $ /usr/local/bin/blah
        /usr/local/bin/blah: error while loading shared libraries: 
liboink.so.0: cannot open shared object file: No such file or directory
        $ LD_LIBRARY_PATH=/usr/local/lib /usr/local/lib/blah
        $ ldd /usr/local/bin/blah
                linux-vdso.so.1 =>  (0x00007fff247c5000)
                liboink.so.0 => not found
                libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 
(0x00007f5ceeb26000)
                /lib64/ld-linux-x86-64.so.2 (0x00007f5ceeed1000)
        $ readelf -d /usr/local/bin/blah | grep RPATH
        $ 

-- 
Brain, n. An apparatus with which we think we think.



reply via email to

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