I am building tmux-2.0
from sources on a pretty regular Linux host. First attempt failed as it turned out that the version of libevent
installed is older than required, so I proceeded to download and build libevent-2.0.22
from sources (current at the time of writing) first.
Building of libevent
succeeded flawlessly, and I thought I could then retry building tmux
with the following:
PKG_CONFIG_PATH=$PATH_TO_MY_BUILT_LIBEVENT/lib/pkgconfig ./configure ...
The above invocation succeeded, so did subsequent make
and make install
.
Running my newly build tmux
, however, aborts with a missing shared object, not surprisingly libevent-2.0.so.5
:
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
I thought building against a custom library implies it will also be used at runtime? ldd
on my tmux
gives me:
linux-vdso.so.1 => (0x00007fff8f5ff000)
libutil.so.1 => /lib64/libutil.so.1 (0x0000003cf8800000)
libncurses.so.5 => /lib64/libncurses.so.5 (0x0000003cf7e00000)
libevent-2.0.so.5 => not found
librt.so.1 => /lib64/librt.so.1 (0x0000003ce8600000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x0000003cea200000)
libc.so.6 => /lib64/libc.so.6 (0x0000003ce7600000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x0000003cf7200000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003ce7e00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003ce8200000)
/lib64/ld-linux-x86-64.so.2 (0x0000003ce7200000)
So, libevent-2.0.so.5
is not found.
Do I need to resort to setting, I don't know, LIBS
, LDFLAGS
or some other variables or switches to configure
script above, so that, I don't know, the paths to my newly built libevent
are embedded in tmux
binary, courtesy of ld
?
I do not have root access - university Linux workstation - and frankly I don't need one, I think. I also do not want to muck about with LD_LIBRARY_PATH
or the like. Suffice to say, doing LD_LIBRARY_PATH=$PATH_TO_MY_LIBEVENT/lib tmux
works fine. But I want it to work "by default", locating and using my libevent
.
I guess the solution would apply to pretty much any software using the "GNU build system". What's the right thing to do here?