From: Guus Sliepen Date: Fri, 14 Jan 2011 20:18:21 +0000 (+0100) Subject: Remove dependency on libevent, add -pthread when necessary. X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;ds=sidebyside;h=8a3d666a753516fd1b768f200675e622ac187ec8;p=tinc Remove dependency on libevent, add -pthread when necessary. --- diff --git a/README b/README index 3f21f25d..e2a83433 100644 --- 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. diff --git a/configure.in b/configure.in index 5aacff6a..8e718c83 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/doc/tinc.texi b/doc/tinc.texi index 3dc9eca4..cb524bc4 100644 --- a/doc/tinc.texi +++ b/doc/tinc.texi @@ -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 21c16efa..40ed2e89 100644 --- a/have.h +++ b/have.h @@ -187,8 +187,4 @@ #include #endif -#ifdef HAVE_EVENT_H -#include -#endif - #endif /* __TINC_SYSTEM_H__ */ diff --git a/m4/libevent.m4 b/m4/libevent.m4 deleted file mode 100644 index 34bdef70..00000000 --- a/m4/libevent.m4 +++ /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.")] - ) -]) diff --git a/src/Makefile.am b/src/Makefile.am index 3f5f84ff..dceed625 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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