我正在尝试构建一个开源包,但遇到了与我安装的原型库发生冲突的麻烦/usr/local
,其中“正确”版本位于/usr
.
% (make distclean>/dev/null; ./configure > no_env_conf.log 2>& 1; make > no_env_make.log 2>&1 && echo Success || echo 'Build Error')
Build Error
我想在没有/usr/local
预编译或链接器路径的情况下进行配置和编译。我以为我可以通过指定适当的环境变量来做到这一点,但这并不完全奏效:
% (make distclean>/dev/null; CFLAGS=-I/usr/include LDFLAGS=-L/usr/lib ./configure > no_env_conf.log 2>& 1; make > no_env_make.log 2>&1 && echo Success || echo 'Build Error')
Build Error
但是,如果我只是/usr/local
从文件系统中删除,那么一切正常:
% (sudo mv /usr/local /usr/local_off; make distclean>/dev/null; ./configure > no_env_conf.log 2>& 1; make > no_env_make.log 2>&1 && echo Success || echo 'Compile Error'; sudo mv /usr/local_off /usr/local )
Success
有没有办法/usr/local
从预编译器和链接器使用的路径中消除?我特别想要可以由configure
选项或环境变量处理的东西。
具体上下文:我在ccache
安装了 v1.2.6 of zlib
in的 OSX Lion 上构建/usr/local
,而所需的 in/usr
恰好是 1.2.5。这个构建实际上是作为更广泛的脚本控制构建 MythTV 及其所有依赖项(包括ccache
.