Remove dependency on libevent, add -pthread when necessary.
authorGuus Sliepen <guus@tinc-vpn.org>
Fri, 14 Jan 2011 20:18:21 +0000 (21:18 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Fri, 14 Jan 2011 20:18:21 +0000 (21:18 +0100)
README
configure.in
doc/tinc.texi
have.h
m4/libevent.m4 [deleted file]
src/Makefile.am

diff --git a/README b/README
index 3f21f25..e2a8343 100644 (file)
--- a/README
+++ b/README
@@ -78,9 +78,6 @@ Since 1.0, the lzo library is also used for optional compression. You need this
 library whether or not you plan to enable compression. You can find it at
 http://www.oberhumer.com/opensource/lzo/.
 
-Since 1.1, the libevent library is used for the main event loop. You can find
-it at http://monkey.org/~provos/libevent/.
-
 In order to compile tinc, you will need a GNU C compiler environment.
 
 
index 5aacff6..8e718c8 100644 (file)
@@ -71,6 +71,15 @@ case $host_os in
   ;;
 esac
 
+case $host_os in
+  *mingw*)
+  ;;
+  *)
+    LIBS="-pthread $LIBS"
+    CFLAGS="-pthread $CFLAGS"
+  ;;
+esac 
+
 AC_ARG_ENABLE(tunemu,
   AS_HELP_STRING([--enable-tunemu], [enable support for the tunemu driver]),
   [ AC_DEFINE(ENABLE_TUNEMU, 1, [Support for tunemu])
@@ -152,7 +161,6 @@ dnl These are defined in files in m4/
 
 AC_ARG_WITH(libgcrypt, AC_HELP_STRING([--with-libgcrypt], [enable use of libgcrypt instead of OpenSSL])], [])
 
-tinc_LIBEVENT
 tinc_ZLIB
 tinc_LZO
 
index 3dc9eca..cb524bc 100644 (file)
@@ -339,7 +339,6 @@ having them installed, configure will give you an error message, and stop.
 * OpenSSL::
 * zlib::
 * lzo::
-* libevent::
 @end menu
 
 
@@ -452,27 +451,6 @@ make sure you build development and runtime libraries (which is the
 default).
 
 
-@c ==================================================================
-@node       libevent
-@subsection libevent
-
-@cindex libevent
-For the main event loop, tinc uses the libevent library.
-
-If this library is not installed, you wil get an error when configuring
-tinc for build.
-
-You can use your operating system's package manager to install this if
-available.  Make sure you install the development AND runtime versions
-of this package.
-
-If you have to install libevent manually, you can get the source code
-from @url{http://monkey.org/~provos/libevent/}.  Instructions on how to configure,
-build and install this package are included within the package.  Please
-make sure you build development and runtime libraries (which is the
-default).
-
-
 @c
 @c
 @c
diff --git a/have.h b/have.h
index 21c16ef..40ed2e8 100644 (file)
--- a/have.h
+++ b/have.h
 #include <netinet/if_ether.h>
 #endif
 
-#ifdef HAVE_EVENT_H
-#include <event.h>
-#endif
-
 #endif /* __TINC_SYSTEM_H__ */
diff --git a/m4/libevent.m4 b/m4/libevent.m4
deleted file mode 100644 (file)
index 34bdef7..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-dnl Check to find the libevent headers/libraries
-
-AC_DEFUN([tinc_LIBEVENT],
-[
-  AC_ARG_WITH(libevent,
-    AS_HELP_STRING([--with-libevent=DIR], [libevent base directory, or:]),
-    [libevent="$withval"
-     CPPFLAGS="$CPPFLAGS -I$withval/include"
-     LDFLAGS="$LDFLAGS -L$withval/lib"]
-  )
-
-  AC_ARG_WITH(libevent-include,
-    AS_HELP_STRING([--with-libevent-include=DIR], [libevent headers directory]),
-    [libevent_include="$withval"
-     CPPFLAGS="$CPPFLAGS -I$withval"]
-  )
-
-  AC_ARG_WITH(libevent-lib,
-    AS_HELP_STRING([--with-libevent-lib=DIR], [libevent library directory]),
-    [libevent_lib="$withval"
-     LDFLAGS="$LDFLAGS -L$withval"]
-  )
-
-  AC_CHECK_HEADERS(event.h,
-    [],
-    [AC_MSG_ERROR("libevent header files not found."); break]
-  )
-
-  AC_CHECK_LIB(event, event_init,
-    [LIBS="-levent $LIBS"],
-    [AC_MSG_ERROR("libevent libraries not found.")]
-  )
-])
index 3f5f84f..dceed62 100644 (file)
@@ -5,7 +5,7 @@ sbin_PROGRAMS = tincd tincctl
 EXTRA_DIST = linux bsd solaris cygwin mingw raw_socket uml_socket openssl gcrypt
 
 tincd_SOURCES = \
-       xmalloc.c utils.c getopt.c getopt1.c list.c splay_tree.c dropin.c fake-getaddrinfo.c fake-getnameinfo.c \
+       xmalloc.c utils.c event.c getopt.c getopt1.c list.c splay_tree.c dropin.c fake-getaddrinfo.c fake-getnameinfo.c \
        cipher.c conf.c connection.c control.c crypto.c digest.c edge.c graph.c logger.c meta.c net.c net_packet.c net_setup.c \
        net_socket.c netutl.c node.c process.c protocol.c protocol_auth.c protocol_edge.c protocol_misc.c \
        protocol_key.c protocol_subnet.c route.c rsa.c subnet.c tincd.c
@@ -25,7 +25,7 @@ DEFAULT_INCLUDES =
 INCLUDES = @INCLUDES@ -I$(top_builddir)
 
 noinst_HEADERS = \
-       xalloc.h utils.h getopt.h list.h splay_tree.h dropin.h fake-getaddrinfo.h fake-getnameinfo.h fake-gai-errnos.h ipv6.h ipv4.h ethernet.h \
+       xalloc.h utils.h event.h getopt.h list.h splay_tree.h dropin.h fake-getaddrinfo.h fake-getnameinfo.h fake-gai-errnos.h ipv6.h ipv4.h ethernet.h \
        cipher.h conf.h connection.h control.h control_common.h crypto.h device.h digest.h edge.h graph.h logger.h meta.h net.h netutl.h node.h process.h \
        protocol.h route.h rsa.h rsagen.h subnet.h bsd/tunemu.h