diff options
author | Francis Dupont <fdupont@isc.org> | 2016-01-29 14:57:39 +0100 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2016-01-29 14:57:39 +0100 |
commit | b7311aaeb339ee998784bf3a273e9d26bfda59af (patch) | |
tree | f9f92d8f73966145c4b610dd0b6d699c50233780 /configure.ac | |
parent | 62a9eb918c7a12bc97fc72960d9c57f35e08d72c (diff) | |
download | isc-dhcp-b7311aaeb339ee998784bf3a273e9d26bfda59af.tar.gz |
Merged rt38835a (add --with-randomdev in config options)
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 30f9ef0a..5664827a 100644 --- a/configure.ac +++ b/configure.ac @@ -580,9 +580,35 @@ AC_CHECK_FUNCS(strlcat) AC_SEARCH_LIBS(if_nametoindex, [ipv6]) # check for /dev/random (declares HAVE_DEV_RANDOM) -AC_CHECK_FILE(/dev/random, - AC_DEFINE([HAVE_DEV_RANDOM], [1], - [Define to 1 if you have the /dev/random file.])) +AC_MSG_CHECKING(for random device) +AC_ARG_WITH(randomdev, + AS_HELP_STRING([--with-randomdev=PATH],[Path for random device + (default is /dev/random)]), + use_randomdev="$withval", use_randomdev="unspec") +if test "$use_randomdev" = "unspec"; then + if test "$cross_compiling" = "yes"; then + AC_MSG_RESULT(unspecified) + AC_MSG_ERROR([ need --with-randomdev=PATH or --with-randomdev=no]) + fi + use_randomdev="/dev/random" +elif test "$use_randomdev" = "yes"; then + use_randomdev="/dev/random" +fi +if test "$use_randomdev" = "no"; then + AC_MSG_RESULT(disabled) + BINDCONFIG="$BINDCONFIG --with-randomdev=no" +else + if test "$cross_compiling" = "yes"; then + AC_MSG_RESULT($use_randomdev (unchecked)) + else + AC_MSG_RESULT($use_randomdev) + AC_CHECK_FILE($use_randomdev, + AC_DEFINE([HAVE_DEV_RANDOM], [1], + [Define to 1 if you have the /dev/random or other configured file.]), + AC_MSG_ERROR(cannot find $use_randomdev)) + fi + BINDCONFIG="$BINDCONFIG --with-randomdev=$use_randomdev" +fi # see if there is a "sa_len" field in our interface information structure AC_CHECK_MEMBER(struct sockaddr.sa_len, |