【问题标题】:Using libtool and autoconf使用 libtool 和 autoconf
【发布时间】:2014-04-27 21:41:46
【问题描述】:

我正在开发一个使用 libtool 安装库的系统(我刚刚发现了 libtool),它似乎是一个强大的工具,例如 autotools。

我的问题是我无法使用 autoconf 和 automake 链接我的程序。经过一番谷歌搜索和stackoverflowing,我找到了如何手动将我的程序与libtool链接。

我的问题是,如何将 libtool 与 autoconf 一起使用?在 configure.ac 和/或 Makefile.am 中添加哪些命令?我也找到了从.la文件中复制依赖并放到configure.ac中的惰性解决方案,但我认为是错误的解决方案。

我通常在我拥有 root 权限的系统上工作,所以我通常很懒,总是在系统级别安装很多东西,并且一切都运行顺利,直到今天我在一个没有 root 权限的系统上.

【问题讨论】:

    标签: linker autoconf automake libtool


    【解决方案1】:

    经过更多的谷歌搜索,我找到了解决方案。

    1) 将宏 LT_INIT 添加到 configure.ac

    LT_INIT(static)
    

    还有很多其他的选择,见http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html#LT_005fINIT

    2) 将变量 progname_LDADD 添加到 Makefile.am

    progname_LDADD = library_name.la
    

    progname 在哪里定义

    bin_PROGRAM = progname
    

    我当然缺少一些东西,但它现在正在工作。欢迎提出任何建议。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多