Libtool 在 make install 期间未创建版本信息符号链接
Posted
技术标签:
【中文标题】Libtool 在 make install 期间未创建版本信息符号链接【英文标题】:Libtool not creating version info symlinks during make install 【发布时间】:2016-03-13 17:58:34 【问题描述】:在构建这个库时,我正在寻求有关 libtool 尴尬问题的帮助:http://github.com/mspanc/vspec
当我在我的 ubuntu 14.04 机器上构建它时,它工作正常,在 make install 期间添加它会创建适当的 .so.VERSION_INFO 符号链接。
但是,当我尝试使用来自 GStreamer 项目 (http://cgit.freedesktop.org/gstreamer/cerbero/) 的 Cerbero 构建系统进行交叉编译时,它基本上引导工具链进行交叉编译,在 make install 期间它只创建 .so 文件(没有 .so.VERSION_INFO 符号链接),但仅适用于这个库,它可以成功地用于同一构建环境中的其他库。
显然,肯定有一些区别,但是我比较了 vspec 的 automakes 和其他已经安装了很长时间的项目,但仍然无法找出问题的根本原因。
我发现在运行./configure --prefix /root/cerbero/dist/android_armv7 --libdir /root/cerbero/dist/android_armv7/lib --disable-maintainer-mode --disable-silent-rules --disable-introspection --host=arm-linux-androideabi
时生成的损坏库中的libtool
脚本具有version_type=none
,而构建的脚本将此变量正确设置为linux
。这种差异后来导致 libtool 不添加符号链接。
这里的任何人都可以给我任何提示,在生成libtool
时,我应该在哪里寻找导致无效主机识别的原因?
以下来自 Cerbero 的 make install 日志:
Making install in src
make[1]: Entering directory `/root/cerbero/sources/android_armv7/libvspec-1.0-1.0.0/src'
make[2]: Entering directory `/root/cerbero/sources/android_armv7/libvspec-1.0-1.0.0/src'
/bin/mkdir -p '/root/cerbero/dist/android_armv7/lib'
/bin/bash ../libtool --mode=install /usr/bin/install -c libvspec-1.0.la '/root/cerbero/dist/android_armv7/lib'
libtool: install: /usr/bin/install -c .libs/libvspec-1.0.so /root/cerbero/dist/android_armv7/lib/libvspec-1.0.so
libtool: install: /usr/bin/install -c .libs/libvspec-1.0.lai /root/cerbero/dist/android_armv7/lib/libvspec-1.0.la
libtool: install: /usr/bin/install -c .libs/libvspec-1.0.a /root/cerbero/dist/android_armv7/lib/libvspec-1.0.a
libtool: install: chmod 644 /root/cerbero/dist/android_armv7/lib/libvspec-1.0.a
libtool: install: arm-linux-androideabi-ranlib /root/cerbero/dist/android_armv7/lib/libvspec-1.0.a
/bin/mkdir -p '/root/cerbero/dist/android_armv7/share/vala/vapi'
/usr/bin/install -c -m 644 libvspec-1.0.vapi libvspec-1.0.deps '/root/cerbero/dist/android_armv7/share/vala/vapi'
/bin/mkdir -p '/root/cerbero/dist/android_armv7/include/libvspec-1.0'
/usr/bin/install -c -m 644 libvspec.h '/root/cerbero/dist/android_armv7/include/libvspec-1.0'
/bin/mkdir -p '/root/cerbero/dist/android_armv7/lib/pkgconfig'
/usr/bin/install -c -m 644 libvspec-1.0.pc '/root/cerbero/dist/android_armv7/lib/pkgconfig'
make[2]: Leaving directory `/root/cerbero/sources/android_armv7/libvspec-1.0-1.0.0/src'
make[1]: Leaving directory `/root/cerbero/sources/android_armv7/libvspec-1.0-1.0.0/src'
make[1]: Entering directory `/root/cerbero/sources/android_armv7/libvspec-1.0-1.0.0'
make[2]: Entering directory `/root/cerbero/sources/android_armv7/libvspec-1.0-1.0.0'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/cerbero/sources/android_armv7/libvspec-1.0-1.0.0'
make[1]: Leaving directory `/root/cerbero/sources/android_armv7/libvspec-1.0-1.0.0'
Running command 'make install'
在我的 ubuntu 14.04 机器上使用相同的命令:
$ LC_ALL=C sudo make install
Making install in src
make[1]: Entering directory `/home/marcin/aktivitis/radiokit/vspec/src'
make[2]: Entering directory `/home/marcin/aktivitis/radiokit/vspec/src'
/bin/mkdir -p '/usr/local/lib'
/bin/bash ../libtool --mode=install /usr/bin/install -c libvspec-1.0.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libvspec-1.0.so.1.0.0 /usr/local/lib/libvspec-1.0.so.1.0.0
libtool: install: (cd /usr/local/lib && ln -s -f libvspec-1.0.so.1.0.0 libvspec-1.0.so.1 || rm -f libvspec-1.0.so.1 && ln -s libvspec-1.0.so.1.0.0 libvspec-1.0.so.1; ; )
libtool: install: (cd /usr/local/lib && ln -s -f libvspec-1.0.so.1.0.0 libvspec-1.0.so || rm -f libvspec-1.0.so && ln -s libvspec-1.0.so.1.0.0 libvspec-1.0.so; ; )
libtool: install: /usr/bin/install -c .libs/libvspec-1.0.lai /usr/local/lib/libvspec-1.0.la
libtool: install: /usr/bin/install -c .libs/libvspec-1.0.a /usr/local/lib/libvspec-1.0.a
libtool: install: chmod 644 /usr/local/lib/libvspec-1.0.a
libtool: install: ranlib /usr/local/lib/libvspec-1.0.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/bin/mkdir -p '/usr/local/share/vala/vapi'
/usr/bin/install -c -m 644 libvspec-1.0.vapi libvspec-1.0.deps '/usr/local/share/vala/vapi'
/bin/mkdir -p '/usr/local/include/libvspec-1.0'
/usr/bin/install -c -m 644 libvspec.h '/usr/local/include/libvspec-1.0'
/bin/mkdir -p '/usr/local/lib/pkgconfig'
/usr/bin/install -c -m 644 libvspec-1.0.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory `/home/marcin/aktivitis/radiokit/vspec/src'
make[1]: Leaving directory `/home/marcin/aktivitis/radiokit/vspec/src'
make[1]: Entering directory `/home/marcin/aktivitis/radiokit/vspec'
make[2]: Entering directory `/home/marcin/aktivitis/radiokit/vspec'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/marcin/aktivitis/radiokit/vspec'
make[1]: Leaving directory `/home/marcin/aktivitis/radiokit/vspec'
谢谢,
马辛
【问题讨论】:
【参考方案1】:对于 Android,这是该平台的预期 libtool 输出。请参阅this libtool patch 上的 cmets。版本库 will not be added 到 Android。
【讨论】:
以上是关于Libtool 在 make install 期间未创建版本信息符号链接的主要内容,如果未能解决你的问题,请参考以下文章
./libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c make: ./libtool: Command not found