tmux3.4 静态链接libevent
说明
tmux需要依赖第三方库,对于开发环境而言,宿主机存在库版本不是最新情况,可以本地编译并通过LD_LIBRARY_PATH进行动态库路径指定
同时又存在部分开发环境下无法指定的情况,此时可以根据需求静态链接,适用于Ubuntu16.04及以上环境
环境
~ ✘ cat /etc/issue
Ubuntu 18.04.6 LTS \n \l
~ ✘
编译
libevent-2.1.12
./configure --prefix=$HOME/.usr/local/ --enable-static
make install
tmux-3.4
LIBEVENT_CORE_CFLAGS="-I$HOME/.usr/local/include" LIBEVENT_CORE_LIBS="-L$HOME/.usr/local/lib -Wl,-Bstatic -levent_core -Wl,-Bdynamic" ./configure --prefix=$HOME/.usr/local/
make install
验证
~ ✘ ldd $(command -v tmux)
linux-vdso.so.1 (0x00007ffc339f2000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f456c1c4000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f456bf9a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f456bbfc000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f456b9e2000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f456b5f1000)
/lib64/ld-linux-x86-64.so.2 (0x00007f456c6f2000)