summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-09-16 15:49:01 +0000
committerRoy Marples <roy@marples.name>2016-09-16 15:49:01 +0000
commitb0601fe4165e342848c344faf2e08720db5fa271 (patch)
tree35a23064feb1fe237cbc934fa2f0cf55c0e8f0b3 /configure
parentba13abcc97a2f606a2d7ea85832cd90e7a3cad06 (diff)
downloaddhcpcd-b0601fe4165e342848c344faf2e08720db5fa271.tar.xz
One BSD in the future will include address flags in ifa_msghdr.
A libc in the future will include address flags in ifaddrs. Although this does make the code a bit more #ifdef messy, the end result is a smaller binary, and less ioctls to make.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure36
1 files changed, 36 insertions, 0 deletions
diff --git a/configure b/configure
index 0f2e2341..c5b8a218 100755
--- a/configure
+++ b/configure
@@ -533,6 +533,22 @@ EOF
echo "no"
fi
rm -f _ifam_pid.c _ifam_pid
+
+ printf "Testing for ifam_addrflags ... "
+ cat <<EOF >_ifam_addrflags.c
+#include <net/if.h>
+int main(void) {
+ struct ifa_msghdr ifam = { };
+ return (int)ifam.ifam_addrflags;
+}
+EOF
+ if $XCC _ifam_addrflags.c -o _ifam_addrflags 2>&3; then
+ echo "yes"
+ echo "#define HAVE_IFAM_ADDRFLAGS" >>$CONFIG_H
+ else
+ echo "no"
+ fi
+ rm -f _ifam_addrflags.c _ifam_addrflags
fi
abort=false
@@ -546,9 +562,11 @@ int main(void) {
return getifaddrs(&ifap);
}
EOF
+LIBSOCKET=
if $XCC _getifaddrs.c -o _getifaddrs 2>&3; then
echo "yes"
elif $XCC _getifaddrs.c -o _getifaddrs -lsocket 2>&3; then
+ LIBSOCKET=-lsocket
echo "yes (-lsocket)"
echo "LDADD+= -lsocket" >>$CONFIG_MK
else
@@ -559,6 +577,24 @@ fi
rm -f _getifaddrs.c _getifaddrs
$abort && exit 1
+printf "Testing for ifaddrs.ifa_addrflags ... "
+cat <<EOF >_getifaddrs_addrflags.c
+#include <sys/types.h>
+#include <ifaddrs.h>
+int main(void) {
+ struct ifaddrs *ifap;
+ getifaddrs(&ifap);
+ return (int)ifap->ifa_addrflags;
+}
+EOF
+if $XCC _getifaddrs_addrflags.c -o _getifaddrs_addrflags $LIBSOCKET 2>&3; then
+ echo "yes"
+ echo "#define HAVE_IFADDRS_ADDRFLAGS" >>$CONFIG_H
+else
+ echo "no"
+fi
+rm -f _getifaddrs_addrflags.c _getifaddrs_addrflags
+
printf "Testing for clock_gettime ... "
cat <<EOF >_clock_gettime.c
#include <time.h>