From: Roy Marples Date: Tue, 14 Jul 2009 15:10:09 +0000 (+0000) Subject: Fix tests and compile for NetBSD. X-Git-Tag: v5.1.0~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dd8d70da070c20fa13d6184e8ab9c8b9e95cd99;p=thirdparty%2Fdhcpcd.git Fix tests and compile for NetBSD. --- diff --git a/common.h b/common.h index 0eea2c34..fbbfc189 100644 --- a/common.h +++ b/common.h @@ -29,6 +29,7 @@ #define COMMON_H #include +#include #include "config.h" #include "defs.h" diff --git a/configure b/configure index 89e114af..2b54e131 100755 --- a/configure +++ b/configure @@ -97,15 +97,22 @@ Linux) ;; esac +# Even if we build for $PREFIX, the clueless user might move us to / +LDELF=/libexec/ld.elf_so +if [ -e "$LDELF" ]; then + echo "Linking against $LDELF" + echo "LDFLAGS+= -Wl,-dynamic-linker=$LDELF" >>$CONFIG_MK +fi + printf "Testing for arc4random support ... " cat <_arc4random.c #include int main(void) { - uint32_t = arc4random(); + uint32_t r = arc4random(); return 0; } EOF -if $CC _arc4random.c -o _random 2>/dev/null; then +if $CC _arc4random.c -o _arc4random 2>/dev/null; then echo "yes" else echo "no" @@ -118,7 +125,7 @@ printf "Testing for closefrom support ... " cat <_closefrom.c #include int main(void) { - int = closefrom(3); + int r = closefrom(3); return 0; } EOF @@ -169,4 +176,3 @@ else echo "#include \"compat/strlcpy.h\"" >>$CONFIG_H fi rm -f _strlcpy.c _strlcpy - diff --git a/control.c b/control.c index a6754e3b..30e6e506 100644 --- a/control.c +++ b/control.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include