]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix tests and compile for NetBSD.
authorRoy Marples <roy@marples.name>
Tue, 14 Jul 2009 15:10:09 +0000 (15:10 +0000)
committerRoy Marples <roy@marples.name>
Tue, 14 Jul 2009 15:10:09 +0000 (15:10 +0000)
common.h
configure
control.c

index 0eea2c34f3612061d414ab81da9d2764495b8b62..fbbfc189e7c3383f08c403b4f990c85412c5608e 100644 (file)
--- a/common.h
+++ b/common.h
@@ -29,6 +29,7 @@
 #define COMMON_H
 
 #include <stdio.h>
+#include <time.h>
 
 #include "config.h"
 #include "defs.h"
index 89e114af0c374915ba8e768369a7707b860b52bb..2b54e1312e2631c5af794e4e7dabdff041fccb95 100755 (executable)
--- 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 <<EOF >_arc4random.c
 #include <stdlib.h>
 int main(void) {
-       uint32_t = arc4random();
+       uint32_t = 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 <<EOF >_closefrom.c
 #include <unistd.h>
 int main(void) {
-       int = closefrom(3);
+       int = closefrom(3);
        return 0;
 }
 EOF
@@ -169,4 +176,3 @@ else
        echo "#include \"compat/strlcpy.h\"" >>$CONFIG_H
 fi
 rm -f _strlcpy.c _strlcpy
-
index a6754e3b6d77b35723881e68ec1fd18a9c087163..30e6e5066653a77f9416b7b264f236746f9b5e75 100644 (file)
--- a/control.c
+++ b/control.c
@@ -31,6 +31,7 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <time.h>
 #include <unistd.h>