【发布时间】:2023-03-05 18:51:01
【问题描述】:
我目前正在尝试从位于我当前项目旁边的另一个项目中包含一个 libtool 库。我可以使用
检查配置中的库LDFLAGS="$LDFLAGS -L$top_srcdir../otherproject/libotherproject/.libs/"
AC_CHECK_LIB([otherproject],[init],[],[AC_MSG_ERROR([No otherproject libary found.])])
在我的 configure.ac 中。到目前为止一切都很好。但是,如果我使用 make 构建项目,当它位于 currentproject/sources/ 时,我会从 libtool 收到一个错误:
../libtool: line 5986: cd: ../otherproject/libotherproject/.libs/: No such file or directory
libtool: link: cannot determine absolute directory name of `../otherproject/libotherproject/.libs/'
这是合乎逻辑的,因为它应该类似于../../otherproject/libotherproject/.libs/。我试图调试它,发现 if 是使用
AC_MSG_NOTICE([Top src dir is: $top_srcdir])
在 configure.ac 中,配置脚本告诉我
configure: Top src dir is:
仅限。 $abs_top_srcdir 的行为相同。 $srcdir 是“。”总是。我在文档中挖掘了一下,发现 $builddir 应该始终是“。”,但在我的情况下也是空的。这是一个错误吗?也许我忘了打电话给AC_init_anything?谢谢你的帮助!
【问题讨论】:
-
不确定您是否真的打算将
.libs子目录与 libtool 一起使用。你应该通过<path>/libxxx.la。您使用哪些步骤来生成configure脚本和Makefile.in模板? -
我通常执行 autoconf 和 automake 来生成我的文件。我应该在哪里传递 .la-File 的路径?
标签: autotools autoconf libtool