【发布时间】:2014-04-06 15:56:49
【问题描述】:
在 Linux 系统上,我配置了一个软件包 (llvm),autoconf 找到了arc4random 函数。这里是配置期间输出的提取:
checking for strerror... yes
checking for strerror_r... yes
checking for setenv... yes
checking for arc4random... yes
checking for strtoll... yes
checking for strtoq... yes
checking for sysconf... yes
配置顺利。后来,在构建包时,我收到关于未声明的说明符 arc4random 的错误:
[removed]/lib/Support/Unix/Process.inc:368:10: error: use of undeclared identifier
'arc4random'
return arc4random();
^
这里是指的位置:
367 #if defined(HAVE_ARC4RANDOM)
368 return arc4random();
369 #else
370 static int x = (::srand(GetRandomNumberSeed()), 0);
371 (void)x;
372 return ::rand();
373 #endif
保护得当,这里是configure.ac 部分:
AC_CHECK_FUNCS([strerror strerror_r setenv arc4random ])
似乎一切都好。我想知道为什么配置过程检测到该功能可用。
autoconf (GNU Autoconf) 2.63
这里是config.log的摘录:
configure --prefix=[removed] --host=powerpc64-bgq-linux --disable-terminfo --disable-zlib --enable-targets=powerpc CXX=bgclang++ CXXFLAGS=-O3 -fPIC CC=bgclang CFLAGS=-O3 -fPIC LDFLAGS=-shared
【问题讨论】: