From 4ac81cc17a0111eb44b869cd70b16dd346899ac9 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 17 Sep 2008 10:47:11 -0700 Subject: [PATCH] Test Debian packaging at "make distcheck" time. --- Makefile.am | 8 ++++++++ acinclude.m4 | 8 ++++++++ configure.ac | 2 ++ 3 files changed, 18 insertions(+) diff --git a/Makefile.am b/Makefile.am index 4c492644..96f2145d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,3 +18,11 @@ endif 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 diff --git a/acinclude.m4 b/acinclude.m4 index 17283b11..8b80249d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -137,3 +137,11 @@ AC_DEFUN([OFP_ENABLE_EXT], 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])]) + diff --git a/configure.ac b/configure.ac index e46926f6..53647602 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,8 @@ AC_SUBST(KARCH) 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 -- 2.30.2