On a Linux system I configured a software package (llvm) and autoconf finds the arc4random
function. Here an extraction of the output during configuration:
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
Configuring goes fine. Later, when building the package I get an error about an undeclared specifier arc4random
:
[removed]/lib/Support/Unix/Process.inc:368:10: error: use of undeclared identifier
'arc4random'
return arc4random();
^
Here the referred location:
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
It's properly guarded, here the configure.ac
piece:
AC_CHECK_FUNCS([strerror strerror_r setenv arc4random ])
Seems all fine. I am wondering why the configure process detected the function to be available.
autoconf (GNU Autoconf) 2.63
Here the extract from 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