X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=m4%2Flibevent.m4;fp=m4%2Flibevent.m4;h=58f5fab6ebac6b17d99d02a0d3a142e3de34eabb;hb=4766925321be74269679b4d9094e94b1ed8d9368;hp=0000000000000000000000000000000000000000;hpb=80e6cb10e8dff4104b24dc591d54ae387b9551d0;p=tinc diff --git a/m4/libevent.m4 b/m4/libevent.m4 new file mode 100644 index 00000000..58f5fab6 --- /dev/null +++ b/m4/libevent.m4 @@ -0,0 +1,33 @@ +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 headers files not found."); break] + ) + + AC_CHECK_LIB(event, event_init, + [LIBS="$LIBS -levent"], + [AC_MSG_ERROR("libevent library not found."); break] + ) +])