Tinc 2.0 will need liblzo, libevent, libgcrypt, libgnutls and libgnutls-extra.
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
-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"
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
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.
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
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
--- /dev/null
+EXTRA_DIST = *.m4
--- /dev/null
+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]
+ )
+])
--- /dev/null
+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]
+ )]
+ )
+])