2019-02-02 03:10:43 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-03-25 22:20:25 +03:00
|
|
|
: "${MAKE:=make}"
|
|
|
|
|
2019-02-02 03:32:16 +03:00
|
|
|
log () {
|
|
|
|
echo "$@" >&2;
|
|
|
|
}
|
|
|
|
|
|
|
|
for impl in ENT_GETENTROPY_UNISTD \
|
|
|
|
ENT_GETENTROPY_SYSRANDOM \
|
|
|
|
ENT_GETRANDOM_SYSCALL \
|
2021-03-27 23:15:56 +03:00
|
|
|
ENT_GETENTROPY_BCRYPTGENRANDOM \
|
2019-02-02 03:32:16 +03:00
|
|
|
ENT_DEV_URANDOM
|
|
|
|
do
|
|
|
|
export IMPL=$impl
|
|
|
|
|
|
|
|
log "Trying IMPL=$IMPL"
|
|
|
|
|
2022-03-25 22:20:25 +03:00
|
|
|
if IMPL=$impl ${MAKE} >/dev/null 2>/dev/null
|
2019-02-02 03:32:16 +03:00
|
|
|
then sed -i 's|$(error IMPL must be set)|IMPL='"$impl"'|' Makefile
|
|
|
|
log "IMPL=$IMPL works"
|
|
|
|
exit 0
|
|
|
|
else log "IMPL=$IMPL failed"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
log "This shouldn't happen, something is broken."
|
|
|
|
exit 1
|