如何为./configure指定LDFLAGS和CPPFLAGS?

Ben*_*old 19 configure libcurl

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

checking for LIBCURL... no
checking for LIBCURL... no
configure: error: Missing required libcurl dev >= 7.18.2
Run Code Online (Sandbox Code Playgroud)

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

brew install curl
Run Code Online (Sandbox Code Playgroud)

似乎成功了.我收到了这条消息:

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
Run Code Online (Sandbox Code Playgroud)

好吧,所以它已经安装但没有符号链接/usr/local,这对我来说很好.我试过这个:

export LDFLAGS=-L/usr/local/opt/curl/lib
export CPPFLAGS=-I/usr/local/opt/curl/include
./configure
Run Code Online (Sandbox Code Playgroud)

但我得到了同样的信息: 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
Run Code Online (Sandbox Code Playgroud)

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

Ben*_*old 43

经过一些更彻底的调查,我确定configurecgminer 的文件没有注意LDFLAGS或者CPPFLAGS在测试libcurl时.相反,它检查LIBCURL_CFLAGSLIBCURL_LIBS.所以,我尝试过:

export LIBCURL_CFLAGS=-I/usr/local/opt/curl/include
export LIBCURL_LIBS=-L/usr/local/opt/curl/lib
./configure
Run Code Online (Sandbox Code Playgroud)

我得到了:

checking for LIBCURL... yes
Run Code Online (Sandbox Code Playgroud)

其余配置顺利完成.成功!