]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Test for getifaddrs support.
authorRoy Marples <roy@marples.name>
Sat, 18 Jul 2009 11:31:56 +0000 (11:31 +0000)
committerRoy Marples <roy@marples.name>
Sat, 18 Jul 2009 11:31:56 +0000 (11:31 +0000)
configure

index b3a242382fbbfdeb10968ceab8c66d87d2c87a24..b6ac9395c11b0578e6bd7daa506ec7100883cb3e 100755 (executable)
--- a/configure
+++ b/configure
@@ -120,6 +120,24 @@ if [ -e "$LDELF" ]; then
        echo "LDFLAGS+= -Wl,-dynamic-linker=$LDELF" >>$CONFIG_MK
 fi
 
+# We require the libc to support non standard functions, like getifaddrs
+printf "Testing for getifaddrs support ... "
+cat <<EOF >_getifaddrs.c
+#include <sys/types.h>
+#include <ifaddrs.h>
+int main(void) {
+       struct ifaddrs *ifap;
+       return getifaddrs(&ifap);
+}
+EOF
+if $CC _getifaddrs.c -o _getifaddrs 2>/dev/null; then
+       echo "yes"
+else
+       echo "no"
+       echo "libc support for getifaddrs is required - aborting" >&2
+       exit 1
+fi
+
 printf "Testing for arc4random support ... "
 cat <<EOF >_arc4random.c
 #include <stdlib.h>