如何为./configure指定LDFLAGS和CPPFLAGS? [英] How do I specify LDFLAGS and CPPFLAGS for ./configure?

查看:1571
本文介绍了如何为./configure指定LDFLAGS和CPPFLAGS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用运行OS X 10.8.3的Mac.我正在尝试编译cgminer 3.0.0.在第一次运行./configure时,我收到消息:

I am using a Mac running OS X 10.8.3. I am trying to compile cgminer 3.0.0. On my first run of ./configure I got the message:

checking for LIBCURL... no
checking for LIBCURL... no
configure: error: Missing required libcurl dev >= 7.18.2

所以我使用自制软件安装了最新版本的libcurl:

So I installed the latest version of libcurl using homebrew:

brew install curl

那个似乎可以解决问题.我收到此消息:

That seemed to do the trick. I got this message:

downloaded: /Library/Caches/Homebrew/curl-7.30.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/curl/7.30.0
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

The libcurl provided by Leopard is too old for CouchDB to use.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/curl/lib
    CPPFLAGS: -I/usr/local/opt/curl/include

==> Summary
/usr/local/Cellar/curl/7.30.0: 75 files, 2.0M, built in 61 seconds

好的,它已经安装但没有链接到/usr/local,对我来说很好.我试过了:

Okay, so it's installed but not symlinked into /usr/local, that's fine with me. I tried this:

export LDFLAGS=-L/usr/local/opt/curl/lib
export CPPFLAGS=-I/usr/local/opt/curl/include
./configure

但是我得到了相同的消息:configure: error: Missing required libcurl dev >= 7.18.2

But I got the same message: configure: error: Missing required libcurl dev >= 7.18.2

所以我尝试了这个:

env LDFLAGS=-L/usr/local/opt/curl/lib CPPFLAGS=-I/usr/local/opt/curl/include ./configure

我仍然收到缺少必需的libcurl"消息.有什么想法吗?

I'm still getting the "missing required libcurl" message. Any ideas?

推荐答案

经过更深入的研究后,我确定在测试libcurl时,cgminer的configure文件不关注LDFLAGSCPPFLAGS.而是检查LIBCURL_CFLAGSLIBCURL_LIBS.所以,我尝试了:

After some more thorough investigation, I determined that the configure file for cgminer does not pay attention to LDFLAGS or CPPFLAGS when testing for libcurl. Instead, it checks for LIBCURL_CFLAGS and LIBCURL_LIBS. So, I tried:

export LIBCURL_CFLAGS=-I/usr/local/opt/curl/include
export LIBCURL_LIBS=-L/usr/local/opt/curl/lib
./configure

然后我得到了

checking for LIBCURL... yes

其余配置顺利进行.成功!

And the rest of the configuration went off without a hitch. SUCCESS!

这篇关于如何为./configure指定LDFLAGS和CPPFLAGS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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