summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-05-10 17:11:24 +0000
committerrubidium <rubidium@openttd.org>2010-05-10 17:11:24 +0000
commita8fa3dd3ce76e209ec421f825da631edf7e9fd75 (patch)
tree630cbbb798087f4a938f03b47c7f502287ee68bd
parent6d94dd10dd69bcd459d84e8c99423c16edaeecb1 (diff)
downloadopenttd-a8fa3dd3ce76e209ec421f825da631edf7e9fd75.tar.xz
(svn r19781) -Fix [FS#3809]: compilation on NetBSD failed (Krille)
-rw-r--r--config.lib7
-rw-r--r--src/network/core/os_abstraction.h2
-rw-r--r--src/stdafx.h3
3 files changed, 11 insertions, 1 deletions
diff --git a/config.lib b/config.lib
index be58f7697..291bbaa00 100644
--- a/config.lib
+++ b/config.lib
@@ -2318,6 +2318,13 @@ detect_library() {
if [ -z "$res" ]; then
log 2 " trying /opt/local/include/$4$5... no"
fi
+ if [ -z "$res" ] && [ "$os" = "NETBSD" ]; then
+ eval "$2=`ls -1 /usr/pkg/include/$4*.h 2>/dev/null | egrep \"\/$5\$\"`"
+ eval "res=\$$2"
+ if [ -z "$res" ]; then
+ log 2 " trying /usr/pkg/include/$4$5... no"
+ fi
+ fi
eval "res=\$$2"
if [ -n "$res" ] && ( [ -n "$force_static" ] || ( [ "$enable_static" != "0" ] && [ "$os" != "OSX" ] ) ); then
diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h
index 02f9aaca9..5b789d5cc 100644
--- a/src/network/core/os_abstraction.h
+++ b/src/network/core/os_abstraction.h
@@ -127,7 +127,7 @@ static inline void OTTDfreeaddrinfo(struct addrinfo *ai)
/* UNIX stuff */
#if defined(UNIX) && !defined(__OS2__)
-# if defined(OPENBSD)
+# if defined(OPENBSD) || defined(__NetBSD__)
# define AI_ADDRCONFIG 0
# endif
# define SOCKET int
diff --git a/src/stdafx.h b/src/stdafx.h
index 8413e1d9d..dcd0d4a6a 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -24,6 +24,9 @@
#elif defined(__NDS__)
#include <nds/jtypes.h>
#define TROUBLED_INTS
+#elif defined(__NetBSD__)
+ #include <unistd.h>
+ #define _GNU_SOURCE
#endif
/* It seems that we need to include stdint.h before anything else