DIST_SUBDIRS = $(SUBDIRS)
EXTRA_DIST = README.hwtables
+
+if HAVE_DPKG_BUILDPACKAGE
+distcheck-hook:
+ cd $(srcdir) && dpkg-buildpackage -rfakeroot -us -uc
+ cd $(srcdir) && fakeroot ./debian/rules clean
+else
+distcheck-hook:
+endif
fi
AC_SUBST([ofp_top_srcdir], ['$(top_srcdir)'])
AM_CONDITIONAL([HAVE_EXT], [test $HAVE_EXT = yes])])
+
+dnl Checks for dpkg-buildpackage. If this is available then we check
+dnl that the Debian packaging is functional at "make distcheck" time.
+AC_DEFUN([OFP_CHECK_DPKG_BUILDPACKAGE],
+ [AC_CHECK_PROG([HAVE_DPKG_BUILDPACKAGE], [dpkg-buildpackage], [yes], [no])
+ AM_CONDITIONAL([HAVE_DPKG_BUILDPACKAGE],
+ [test $HAVE_DPKG_BUILDPACKAGE = yes])])
+
OFP_CHECK_LINUX(l26, 2.6, 2.6, KSRC26, L26_ENABLED)
OFP_CHECK_LINUX(l24, 2.4, 2.4, KSRC24, L24_ENABLED)
+OFP_CHECK_DPKG_BUILDPACKAGE
+
CFLAGS="$CFLAGS -Wall -Wno-sign-compare -Wpointer-arith -Wdeclaration-after-statement"
OFP_ENABLE_EXT