如果我的系统支持某些头文件或cpp功能,"configure"脚本如何检测?

Hin*_*sum 0 c++ automake header configure include

我正在尝试在我的RHEL 5机器上编译google rpc(grpc),配置脚本检查并抛出此错误:

configure: error: sched_yield was not found on your system
Run Code Online (Sandbox Code Playgroud)

我检查了config.log文件,发现是这样的:

| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char sched_yield ();
| int
| main ()
| {
| return sched_yield ();
|   ;
|   return 0;
| }
configure:19729: result: no
configure:19736: error: in `/downloads/grpc/third_party/protobuf':
configure:19738: error: sched_yield was not found on your system
Run Code Online (Sandbox Code Playgroud)

嗯,这是正确的,我做了一个手动测试,但没有找到.没问题.

But, I just wish to know the principle behind "configure"!
Run Code Online (Sandbox Code Playgroud)

"configure"是否尝试生成一些c/c ++源代码并进行编译,以查看是否支持某些功能?如您所知,"configure"脚本通常运行速度非常快,比调用大量gcc/g ++进程来尝试标头/功能要快得多.

那么"configure"如何实现这个标题/功能"检查"?

YSC*_*YSC 5

"configure"是否尝试生成一些c/c ++源代码并进行编译,以查看是否支持某些功能?

是.

如您所知,"configure"脚本通常运行速度非常快[...]

不是我的经验.configure很慢......

那么"configure"如何实现这个标题/功能"检查"?

见Q#1.