bluez-alsa:交叉编译报错:error: Libtool library used but 'LIBTOOL' is undefined
[fly@752fac4b02e9 bluez-alsa-1.4.0]$ autoreconf --install
src/asound/Makefile.am:6: error: Libtool library used but 'LIBTOOL' is undefined
src/asound/Makefile.am:6: The usual way to define 'LIBTOOL' is to add 'LT_INIT'
src/asound/Makefile.am:6: to 'configure.ac' and run 'aclocal' and 'autoconf' again.
src/asound/Makefile.am:6: If 'LT_INIT' is in 'configure.ac', make sure
src/asound/Makefile.am:6: its definition is in aclocal's search path.
test/Makefile.am:21: error: Libtool library used but 'LIBTOOL' is undefined
test/Makefile.am:21: The usual way to define 'LIBTOOL' is to add 'LT_INIT'
test/Makefile.am:21: to 'configure.ac' and run 'aclocal' and 'autoconf' again.
test/Makefile.am:21: If 'LT_INIT' is in 'configure.ac', make sure
test/Makefile.am:21: its definition is in aclocal's search path.
autoreconf: automake failed with exit status: 1
报错解释:
这个错误表明在编译过程中,Makefile.am 文件试图使用 libtool 来构建库,但是 'LIBTOOL' 变量没有被定义。Libtool 是一个构建共享库的工具,它提供了一种跨平台的方式来自动化构建过程,并且处理了许多与不同操作系统上共享库的不同之处。
解决方法:
确保 libtool 已经安装在系统上。
在 Makefile.am 文件中定义 'LIBTOOL' 变量。通常,这可以通过在 Makefile.am 文件中添加如下行来实现:
makefile
LIBTOOL = $(SHELL) $(top_builddir)/libtool
或者,如果 libtool 在你的系统的标准路径上,你可以简单地使用:
makefile
LIBTOOL = libtool
在定义了 'LIBTOOL' 变量后,重新运行 aclocal,autoconf,automake 和 make 来重新生成 Makefile 并进行编译。
确保在修改 Makefile.am 或者其他配置文件后,保存更改并运行正确的命令来更新构建系统。如果你不熟悉这些步骤,可以查看相关的构建系统文档以获取更详细的指导
解决办法
执行如下:
[fly@752fac4b02e9 aclocal]$ sudo cp -rf /usr/share/aclocal/* .
[fly@752fac4b02e9 aclocal]$ pwd
/usr/local/share/aclocal
说明:应该是/usr/local/share/aclocal目录下缺少libtool.m4文件