urbit/pkg/ent/configure
Benjamin Summers 9618f37965 Add 'pkg/ent/' from commit '31ac2913f14c6f7631f5792ad942605fb2d9fb87'
git-subtree-dir: pkg/ent
git-subtree-mainline: 1207c204cb
git-subtree-split: 31ac2913f1
2019-03-04 16:49:14 -08:00

26 lines
512 B
Bash
Executable File

#!/usr/bin/env bash
log () {
echo "$@" >&2;
}
for impl in ENT_GETENTROPY_UNISTD \
ENT_GETENTROPY_SYSRANDOM \
ENT_GETRANDOM_SYSCALL \
ENT_DEV_URANDOM
do
export IMPL=$impl
log "Trying IMPL=$IMPL"
if IMPL=$impl make >/dev/null 2>/dev/null
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