summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-01-29 10:18:02 +0000
committerRoy Marples <roy@marples.name>2016-01-29 10:18:02 +0000
commitf5eb2f87816521135495ad3a6b611de341c70ec3 (patch)
tree5fb1f73126ef1f54def705494dfbc6dc6d3f3a95 /configure
parent40095c803a2c001600be75a0adecf8409e67d335 (diff)
downloaddhcpcd-f5eb2f87816521135495ad3a6b611de341c70ec3.tar.xz
Use ffs64(3) instead of ffs(3) when calculating to see if we can fit the
user number inside the resultant length given the prefix length, so we can use the whole of the user number (64 bits) if needed. Add a compat ffs64(3) implementation from NetBSD if none found on the platform.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure b/configure
index f0eabf92..0ad1f77b 100755
--- a/configure
+++ b/configure
@@ -985,6 +985,28 @@ if [ "$BE64ENC" = no ]; then
echo "#include \"compat/endian.h\"" >>$CONFIG_H
fi
+if [ -z "$FFS64" ]; then
+ printf "Testing for ffs64 ... "
+ cat <<EOF >_ffs64.c
+#include <sys/bitops.h>
+int main(void) {
+ return (int)ffs64(1337);
+}
+EOF
+ if $XCC _ffs64.c -o _ffs64 2>&3; then
+ FFS64=yes
+ else
+ FFS64=no
+ fi
+ echo "$FFS64"
+ rm -f _ffs64.c _ffs64
+fi
+if [ "$FFS64" = yes ]; then
+ echo "CPPFLAGS+= -DHAVE_SYS_BITOPS_H" >>$CONFIG_MK
+else
+ echo "#include \"compat/ffs64.h\"" >>$CONFIG_H
+fi
+
if [ -z "$MD5" ]; then
MD5_LIB=
printf "Testing for MD5Init ... "