问题描述
我正在构建我的第一个 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'])
但是:
- 在
/opt/local/lib
中找不到安装的版本 - 如果实际上没有找到图书馆,它不会抱怨
- 我也需要将包含路径设置为
/opt/local/include
非常感谢任何帮助或指向体面教程的链接...
any help, or links to decent tutorials much appreciated...
推荐答案
如果你需要手动设置CFLAGS
、CXXFLAGS
和LDFLAGS
希望 gcc/g++ 在非标准位置查找.
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 进行库解析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!