diff options
| author | Roy Marples <roy@marples.name> | 2014-09-07 17:24:07 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-09-07 17:24:07 +0000 |
| commit | 01890c79df552fe5ed717fb97d9dd5bfb622980d (patch) | |
| tree | 87e34612a2035f828f6cfd7d96756356044ffb98 /configure | |
| parent | b9ab902d8a65a29caa8ea4d8885c33c10e923333 (diff) | |
| download | dhcpcd-01890c79df552fe5ed717fb97d9dd5bfb622980d.tar.xz | |
Split arc4random_uniform into it's own compat function and add
it's proper copyright.
Add a new test for it to configure so that we can use the
uclibc arc4random function and our compat arc4random_uniform function.
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -509,6 +509,28 @@ if [ "$ARC4RANDOM" = no ]; then echo "#include \"compat/arc4random.h\"" >>$CONFIG_H fi +if [ -z "$ARC4RANDOM_UNIFORM" ]; then + printf "Testing for arc4random_uniform ... " + cat <<EOF >_arc4random_uniform.c +#include <stdlib.h> +int main(void) { + arc4random_uniform(100); + return 0; +} +EOF + if $XCC _arc4random_uniform.c -o _arc4random_uniform 2>/dev/null; then + ARC4RANDOM_UNIFORM=yes + else + ARC4RANDOM_UNIFORM=no + fi + echo "$ARC4RANDOM" + rm -f _arc4random.c _arc4random +fi +if [ "$ARC4RANDOM_UNIFORM" = no ]; then + echo "COMPAT_SRCS+= compat/arc4random_uniform.c" >>$CONFIG_MK + echo "#include \"compat/arc4random_uniform.h\"" >>$CONFIG_H +fi + if [ -z "$CLOSEFROM" ]; then printf "Testing for closefrom ... " cat <<EOF >_closefrom.c |
