From: Guus Sliepen Date: Sat, 7 Nov 2009 13:35:48 +0000 (+0100) Subject: Better integration of libevent in build system. X-Git-Tag: import-tinc-1.1~578 X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=5c5548fc7185cc1462602dadcd39a53cef481d29 Better integration of libevent in build system. Since event.h is not part of tinc, we include it in have.h were all other system header files are included. We also ensure -levent comes before -lgdi32 when compiling with MinGW, apparently it doesn't work when the order is reversed. --- diff --git a/have.h b/have.h index 682fd2b7..92914ea0 100644 --- a/have.h +++ b/have.h @@ -37,6 +37,7 @@ #else #define WINVER WindowsXP #endif +#define WIN32_LEAN_AND_MEAN #include #include #include @@ -179,4 +180,8 @@ #include #endif +#ifdef HAVE_EVENT_H +#include +#endif + #endif /* __TINC_SYSTEM_H__ */ diff --git a/m4/libevent.m4 b/m4/libevent.m4 index 9bc9ae15..34bdef70 100644 --- a/m4/libevent.m4 +++ b/m4/libevent.m4 @@ -27,7 +27,7 @@ AC_DEFUN([tinc_LIBEVENT], ) AC_CHECK_LIB(event, event_init, - [LIBS="$LIBS -levent"], + [LIBS="-levent $LIBS"], [AC_MSG_ERROR("libevent libraries not found.")] ) ]) diff --git a/src/net.h b/src/net.h index f50b2bec..634e9e75 100644 --- a/src/net.h +++ b/src/net.h @@ -21,8 +21,6 @@ #ifndef __TINC_NET_H__ #define __TINC_NET_H__ -#include - #include "ipv6.h" #include "cipher.h" #include "digest.h" diff --git a/src/node.h b/src/node.h index 1e08c7ec..02e16c6c 100644 --- a/src/node.h +++ b/src/node.h @@ -21,8 +21,6 @@ #ifndef __TINC_NODE_H__ #define __TINC_NODE_H__ -#include - #include "splay_tree.h" #include "cipher.h" #include "connection.h"