from my change in debian mksh-29.6-2: if arc4random exists, use it

This commit is contained in:
tg 2007-06-10 17:06:07 +00:00
parent eb47c62e8d
commit f9b33dffea
1 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $MirOS: src/bin/mksh/Build.sh,v 1.211 2007/06/09 22:06:55 tg Exp $
# $MirOS: src/bin/mksh/Build.sh,v 1.212 2007/06/10 17:06:07 tg Exp $
#-
# Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS
# CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NEED_MKNOD MKSH_NOPWNAM
@ -572,7 +572,7 @@ EOF
#
# Environment: library functions
#
ac_test arc4random <<-'EOF'
ac_testn arc4random <<-'EOF'
#include <sys/types.h>
#if HAVE_STDINT_H
#include <stdint.h>
@ -581,6 +581,15 @@ ac_test arc4random <<-'EOF'
int main(void) { return (arc4random()); }
EOF
if test $HAVE_ARC4RANDOM = 0 && test -f "$srcdir/arc4random.c"; then
ac_header sys/sysctl.h
addsrcs HAVE_ARC4RANDOM arc4random.c
HAVE_ARC4RANDOM=1
HAVE_ARC4RANDOM_DECL=0
HAVE_ARC4RANDOM_PUSH=0
fi
CPPFLAGS="$CPPFLAGS -DHAVE_ARC4RANDOM=$HAVE_ARC4RANDOM"
ac_test arc4random_push arc4random 0 <<-'EOF'
extern void arc4random_push(int);
int main(void) { arc4random_push(1); return (0); }