使用autoconf进行库解析? [英] Library resolution with autoconf?

查看:56
本文介绍了使用autoconf进行库解析?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建我的第一个自动配置托管软件包.

I'm building my first autoconf managed package.

但是,我找不到任何简单的示例来说明如何指定所需的库,并找到该库可能在​​各个不同位置的位置.

However I can't find any simple examples anywhere of how to specify a required library, and find that library where it might be in various different places.

我目前有:

AC_CHECK_LIB(['event'], ['event_init'])

但是:

  1. 找不到在/opt/local/lib
  2. 中安装的版本
  3. 如果没有找到该库,它不会抱怨
  4. 我也需要将include路径设置为/opt/local/include
  1. It doesn't find the version installed in /opt/local/lib
  2. It doesn't complain if the library isn't actually found
  3. I need to set the include path to /opt/local/include too

任何帮助,或链接到体面的教程的链接,深表感谢...

any help, or links to decent tutorials much appreciated...

推荐答案

如果希望gcc/g ++在非标准位置查看,则需要手动设置CFLAGSCXXFLAGSLDFLAGS.

You need to manually set CFLAGS, CXXFLAGS and LDFLAGS if you want gcc/g++ to look in non-standard locations.

因此,在调用AC_CHECK_LIB()之前,请先做类似的事情

So, before calling AC_CHECK_LIB(), do something like

CFLAGS="$CFLAGS -I/opt/local/include"
CXXFLAGS="$CXXFLAGS -I/opt/local/include"
LDFLAGS="$LDFLAGS -L/opt/local/lib"

如果在整个配置脚本中仅使用gcc,则不需要CXXFLAGS.

You don't need CXXFLAGS if you're only using gcc throughout your configure script.

这篇关于使用autoconf进行库解析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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