0

我正在尝试构建一个开源包,但遇到了与我安装的原型库发生冲突的麻烦/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 zlibin的 OSX Lion 上构建/usr/local,而所需的 in/usr恰好是 1.2.5。这个构建实际上是作为更广泛的脚本控制构建 MythTV 及其所有依赖项(包括ccache.

4

1 回答 1

1

来自“人 gcc”:

-nostdinc
   Do not search the standard system directories for header files.
   Only the directories you have specified with -I options (and the
   directory of the current file, if appropriate) are searched.

另请注意,虽然预编译器确实存在,但您并没有使用 - 您正在使用常规编译器,因此您应该停止将其称为“预编译器”。

于 2012-04-10T03:55:59.590 回答