3

我正在尝试在 OS X 上构建最新的 openssh Portable。但是,当我运行 ./confgure 时,会出现以下情况:

configure: WARNING: sandbox.h: present but cannot be compiled
configure: WARNING: sandbox.h:     check for missing prerequisite headers?
configure: WARNING: sandbox.h: see the Autoconf documentation
configure: WARNING: sandbox.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sandbox.h: proceeding with the preprocessor's result
configure: WARNING: sandbox.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------------- ##
configure: WARNING:     ## Report this to openssh-unix-dev@mindrot.org ##
configure: WARNING:     ## ------------------------------------------- ##
checking for sandbox.h... yes

当我尝试构建它时:

In file included from sandbox-darwin.c:23:
/usr/include/sandbox.h:98:29: error: sandbox/private.h: No such file or directory
make: *** [sandbox-darwin.o] Error 1

不用说,这是一个问题。我搜索了谷歌并查看了“可能已经有你答案的问题”,但似乎没有什么相关的。我怎样才能解决这个问题?

4

1 回答 1

1

可以通过在构建命令中添加 #define 来解决此问题(如建议的here):

gcc -D__APPLE_API_STRICT_CONFORMANCE -I . -c sandbox-darwin.c -o sandbox-darwin.o

注意:这是一个关于如何编译 sandbox-darwin.c 的最小示例,您可能需要根据您的平台添加适当的其他命令行参数 - 只需复制构建命令并添加 -D__APPLE_API_STRICT_CONFORMANCE 或将其添加到 Makefile。

这是我最近遇到的问题(使用 openssh-6.8p1 和 6.9p1),我不清楚为什么这个“修复”没有包含在 openssh 或 Macports 中......?这可能是因为这个问题似乎只影响 OSX Lion 10.7,尽管我没有在其他版本上测试过......

于 2015-09-28T13:33:35.427 回答