AC_PREREQ(2.61)
AC_INIT([tinc], [1.0.32])
AC_CONFIG_SRCDIR([src/tincd.c])
-AM_INIT_AUTOMAKE([1.11 check-news std-options subdir-objects nostdinc silent-rules -Wall])
+AM_INIT_AUTOMAKE([1.11 check-news std-options subdir-objects nostdinc silent-rules -Wall info-in-builddir])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE
AM_SILENT_RULES([yes])
dnl Checks for header files.
dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies.
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -I${srcdir}"
AC_HEADER_STDC
AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h time.h sys/uio.h sys/wait.h netdb.h arpa/inet.h arpa/nameser.h dirent.h getopt.h])
AC_CHECK_HEADERS([net/if.h net/if_types.h linux/if_tun.h net/if_tun.h net/if_utun.h net/tun/if_tun.h net/if_tap.h net/tap/if_tap.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h netpacket/packet.h],
[], [], [#include "src/have.h"]
)
+CPPFLAGS="$save_CPPFLAGS"
+
AC_CHECK_DECLS([res_init], [AC_CHECK_LIB(resolv, res_init)], [], [
#include <netinet/in.h>
#include <resolv.h>
# For additional rules usually of interest only to the maintainer,
# see GNUmakefile and Makefile.maint.
-sample-config.tar.gz: sample-config
- $(AM_V_GEN)GZIP=$(GZIP_ENV) $(AMTAR) chozf sample-config.tar.gz --exclude .svn sample-config
+sample-config.tar.gz: $(srcdir)/sample-config
+ $(AM_V_GEN)GZIP=$(GZIP_ENV) $(AMTAR) chozf $@ --exclude .svn $<
texi2html: tinc.texi
- $(AM_V_GEN)texi2html -split=chapter tinc.texi
+ $(AM_V_GEN)texi2html -split=chapter $<
tincd.8.html: tincd.8
$(AM_V_GEN)w3mman2html $< > $@
-e s,'@sysconfdir\@',"$(sysconfdir)",g \
-e s,'@localstatedir\@',"$(localstatedir)",g
-tincd.8: tincd.8.in
- $(AM_V_GEN)$(substitute) tincd.8.in > tincd.8
+tincd.8: $(srcdir)/tincd.8.in
+ $(AM_V_GEN)$(substitute) $< > $@
-tinc.conf.5: tinc.conf.5.in
- $(AM_V_GEN)$(substitute) tinc.conf.5.in > tinc.conf.5
+tinc.conf.5: $(srcdir)/tinc.conf.5.in
+ $(AM_V_GEN)$(substitute) $< > $@
+
+tincinclude.texi: $(srcdir)/tincinclude.texi.in
+ $(AM_V_GEN)$(substitute) $< > $@
-tincinclude.texi: tincinclude.texi.in
- $(AM_V_GEN)$(substitute) tincinclude.texi.in > tincinclude.texi
-
tinc.texi: tincinclude.texi
## Process this file with automake to produce Makefile.in -*-Makefile-*-
-EXTRA_DIST = README *.m4
-
+EXTRA_DIST = README attribute.m4 ax_append_flag.m4 ax_cflags_warn_all.m4 ax_check_compile_flag.m4 ax_check_link_flag.m4 ax_require_defined.m4 lzo.m4 openssl.m4 zlib.m4
LIBS += -lpcap
endif
-AM_CPPFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\"
+AM_CPPFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -I $(abs_top_builddir)/
#ifndef __TINC_SYSTEM_H__
#define __TINC_SYSTEM_H__
-#include "../config.h"
+#include "config.h"
#include "have.h"
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
#if HAVE_CONFIG_H
-# include "../config.h"
+# include "config.h"
#endif
#include <sys/types.h>