From: Guus Sliepen Date: Thu, 14 Dec 2006 19:49:59 +0000 (+0000) Subject: Add missing checks in m4/ and update configure.ac. X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=4766925321be74269679b4d9094e94b1ed8d9368;p=tinc Add missing checks in m4/ and update configure.ac. Tinc 2.0 will need liblzo, libevent, libgcrypt, libgnutls and libgnutls-extra. --- diff --git a/Makefile.am b/Makefile.am index c9da143d..67bffa3b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,18 +2,10 @@ AUTOMAKE_OPTIONS = gnu EXTRA_DIST = config.rpath mkinstalldirs system.h depcomp -SUBDIRS = cfg fd logger rt support tnl vnd - -sbin_PROGRAMS = tincd - -tincd_SOURCES = process.c tincd.c - -tincd_LDADD = cfg/libcfg.a fd/libfd.a logger/liblogger.a rt/librt.a support/libsupport.a tnl/libtnl.a vnd/libvnd.a -lgnutls +SUBDIRS = m4 ACLOCAL_AMFLAGS = -I m4 -AM_CFLAGS = @CFLAGS@ -DCONFDIR=\"$(sysconfdir)\" -DLOCALEDIR=\"$(localedir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" - ChangeLog: svn log > ChangeLog diff --git a/configure.ac b/configure.ac index c26b0496..e19aad4b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,17 +1,13 @@ -AC_PREREQ(2.59) +AC_PREREQ(2.61) AC_INIT -AC_CONFIG_SRCDIR([tincd.c]) +AC_CONFIG_SRCDIR([src/tincd.c]) AM_INIT_AUTOMAKE(tinc, 2.0-svn) AC_CONFIG_HEADERS([config.h]) AM_MAINTAINER_MODE -dnl Include the macros from the m4/ directory -dnl AM_ACLOCAL_INCLUDE(m4) +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION(0.16.1) -dnl AM_GNU_GETTEXT([external]) -dnl AM_GNU_GETTEXT_VERSION(0.14.1) - -AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions]) AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions]) dnl ALL_LINGUAS="nl" @@ -19,14 +15,10 @@ dnl ALL_LINGUAS="nl" dnl Checks for programs. AC_PROG_CC AC_PROG_CPP -AC_PROG_GCC_TRADITIONAL -AC_PROG_AWK AC_PROG_INSTALL AC_PROG_LN_S -AC_PROG_MAKE_SET -AC_PROG_RANLIB -AC_ISC_POSIX +AC_GNU_SOURCE dnl Check and set OS @@ -65,13 +57,6 @@ esac AC_CACHE_SAVE -if test -d /sw/include ; then - CPPFLAGS="$CPPFLAGS -I/sw/include" -fi -if test -d /sw/lib ; then - LIBS="$LIBS -L/sw/lib" -fi - dnl Checks for libraries. dnl Checks for header files. @@ -240,8 +225,8 @@ AC_FUNC_MEMCMP AC_FUNC_ALLOCA AC_TYPE_SIGNAL AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system unsetenv vsyslog]) -dnl jm_FUNC_MALLOC -dnl jm_FUNC_REALLOC +AC_FUNC_MALLOC +AC_FUNC_REALLOC dnl Support for SunOS @@ -256,33 +241,12 @@ AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo inet_aton]) AC_CACHE_SAVE -dnl These are defined in files in m4/ - -dnl case $host_os in -dnl *linux*) -dnl tinc_TUNTAP -dnl ;; -dnl esac - -dnl tinc_OPENSSL -dnl tinc_ZLIB -dnl tinc_LZO - -AM_PATH_LIBGNUTLS([1.0.4], [], [AC_MSG_ERROR([GNUTLS library not found.]); break]) - -dnl Check if support for jumbograms is requested -dnl AC_ARG_ENABLE(jumbograms, -dnl AS_HELP_STRING(--enable-jumbograms,enable support for jumbograms (packets up to 9000 bytes)), -dnl [ AC_DEFINE(ENABLE_JUMBOGRAMS, 1, [Support for jumbograms (packets up to 9000 bytes)]) ] -dnl ) - -dnl Check if checkpoint tracing has to be enabled -dnl AC_ARG_ENABLE(tracing, -dnl AS_HELP_STRING(--enable-tracing,enable checkpoint tracing (debugging only)), -dnl [ AC_DEFINE(ENABLE_TRACING, 1, [Checkpoint tracing]) ] -dnl ) +tinc_LIBEVENT +tinc_LZO +AM_PATH_LIBGNUTLS([1.4.0], [], [AC_MSG_ERROR([GNUTLS library not found.]); break]) +AM_PATH_LIBGNUTLS_EXTRA([1.4.0], [], [AC_MSG_ERROR([GNUTLS extra library not found.]); break]) +AM_PATH_LIBGCRYPT([1.2.0], [], [AC_MSG_ERROR([Gcrypt library not found.]); break]) -dnl AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile doc/tincd.8 doc/tinc.conf.5 doc/tincinclude.texi lib/Makefile po/Makefile.in m4/Makefile]) -AC_CONFIG_FILES([Makefile cfg/Makefile fd/Makefile logger/Makefile rt/Makefile support/Makefile tnl/Makefile vnd/Makefile]) +AC_CONFIG_FILES([Makefile m4/Makefile]) AC_OUTPUT diff --git a/m4/Makefile.am b/m4/Makefile.am new file mode 100644 index 00000000..7bcfad9b --- /dev/null +++ b/m4/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = *.m4 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] + ) +]) diff --git a/m4/lzo.m4 b/m4/lzo.m4 new file mode 100644 index 00000000..41c80971 --- /dev/null +++ b/m4/lzo.m4 @@ -0,0 +1,37 @@ +dnl Check to find the lzo headers/libraries + +AC_DEFUN([tinc_LZO], +[ + AC_ARG_WITH(lzo, + AS_HELP_STRING([--with-lzo=DIR], [lzo base directory, or:]), + [lzo="$withval" + CPPFLAGS="$CPPFLAGS -I$withval/include" + LDFLAGS="$LDFLAGS -L$withval/lib"] + ) + + AC_ARG_WITH(lzo-include, + AS_HELP_STRING([--with-lzo-include=DIR], [lzo headers directory]), + [lzo_include="$withval" + CPPFLAGS="$CPPFLAGS -I$withval"] + ) + + AC_ARG_WITH(lzo-lib, + AS_HELP_STRING([--with-lzo-lib=DIR], [lzo library directory]), + [lzo_lib="$withval" + LDFLAGS="$LDFLAGS -L$withval"] + ) + + AC_CHECK_LIB(lzo2, lzo1x_1_compress, + [AC_CHECK_HEADERS(lzo/lzo1x.h, + [LIBS="$LIBS -llzo2"], + [AC_MSG_ERROR("lzo2 header files not found."); break] + )], + [AC_CHECK_LIB(lzo, lzo1x_1_compress, + [AC_CHECK_HEADERS(lzo1x.h, + [LIBS="$LIBS -llzo"], + [AC_MSG_ERROR("lzo1 header files not found."); break] + )], + [AC_MSG_ERROR("lzo library not found."); break] + )] + ) +])