HOWTO链接添加到库中的autoconf配置脚本/ Makefile文件 [英] Howto add a link to a library in autoconf configure script / makefile

查看:184
本文介绍了HOWTO链接添加到库中的autoconf配置脚本/ Makefile文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个自动工具福利局
我有困难,很容易搞清楚HOWTO
链接特定库到配置的目标之一。

I am an autotools newb and I have difficulties figuring out howto easily link a specific library into one of the configured targets.

我有我想建立通常的方式源码包:
的./configure&功放;&安培;让&功放;&安培;使安装

I have a source package that I want to build the usual way: ./configure && make && make install

不幸的是,CPPS之一缺少一个引用另一个库。
手工编译它(调整命令行)的作品。但我宁愿
补丁编译脚本。
哪里是编辑链接引用标准的地方?

Unfortunately one of the cpps has a missing reference to another library. Compiling it by hand (adjusting the commandline) works. But I would rather "patch" the compile script. Where is the standard place to edit linking references?

 undefined reference to `boost::system::get_system_category()

这是我的错误消息,顺便说一句。

That is my error message btw.

推荐答案

您需要将相关的 -l <​​/ code>标志添加到 AM_LDFLAGS Makefile.am ;例如:

You need to add the relevant -l flag to AM_LDFLAGS in Makefile.am; e.g.:

AM_LDFLAGS = -lboost_system-mt

需要注意的是Boost库通常结束一个后缀MDASH;一个字母序列,表明构建配置。在上面的例子中,后缀是 -mt 。这可能是你的安装不同(虽然 -mt 变种是POSIXy系统,IME常用)。

Note that Boost libraries generally end in a suffix—a sequence of letters that indicates the build configuration. In the above example, the suffix is -mt. This could be different in your installation (though the -mt variant is commonly available on POSIXy systems, IME).

我做这样的事情:

AM_LDFLAGS = -lboost_system$(BOOST_LIB_SUFFIX)

BOOST_LIB_SUFFIX 为precious变量(参见 AC_ARG_VAR ),默认值为 -mt

BOOST_LIB_SUFFIX is a precious variable (see AC_ARG_VAR) that defaults to -mt.

这篇关于HOWTO链接添加到库中的autoconf配置脚本/ Makefile文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆