updated build system

This commit is contained in:
Marc Wäckerlin
2015-11-05 09:58:55 +00:00
parent d5dd8200b9
commit 728dfe52e7
6 changed files with 273 additions and 42 deletions

View File

@@ -265,14 +265,8 @@ maintainer-clean-cxx-targets:
EOF
])
# use this in configure.ac to support CppUnit for C++ unit tests
AC_DEFUN([AX_USE_CPPUNIT], [
AM_PATH_CPPUNIT([1.0.0], [have_cppunit="yes"], [have_cppunit="no"])
# infos and warnings
if test "$have_cppunit" = "no"; then
AC_MSG_WARN([Missing cppunit development library!
- you cannot check the library using "make check"
- everything else works perfectly]); fi
# use this in configure.ac to support tests without CppUnit
AC_DEFUN([AX_BUILD_TEST], [
AC_CONFIG_FILES([test/makefile])
AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-test-targets], [test/makefile.in])
test -f test/makefile.in && cat >> test/makefile.in <<EOF
@@ -283,6 +277,17 @@ maintainer-clean-test-targets:
EOF
])
# use this in configure.ac to support CppUnit for C++ unit tests
AC_DEFUN([AX_USE_CPPUNIT], [
AM_PATH_CPPUNIT([1.0.0], [have_cppunit="yes"], [have_cppunit="no"])
# infos and warnings
if test "$have_cppunit" = "no"; then
AC_MSG_WARN([Missing cppunit development library!
- you cannot check the project using "make check"
- everything else works perfectly]); fi
AX_BUILD_TEST
])
# use this in configure.ac to support C++ examples
AC_DEFUN([AX_BUILD_EXAMPLES], [
AC_CONFIG_FILES([examples/makefile])
@@ -696,3 +701,15 @@ AC_DEFUN([AX_CHECK_VALID_LD_FLAG], [
AC_SUBST(LDFLAGS)
AC_MSG_RESULT([$newflag in $LDFLAGS])
])
# Check if a package exists in the current distribution, if yes, require it
# in debian/control.in append @DEB_DEPEND_IFEXISTS@ to Build-Depends
# - parameter:
# $1 = package name
AC_DEFUN([AX_DEB_DEPEND_IFEXISTS], [
pkg=$1
if test -n "$(apt-cache policy -q ${pkg} 2> /dev/null)"; then
DEB_DEPEND_IFEXISTS+=", ${pkg}"
fi
AC_SUBST(DEB_DEPEND_IFEXISTS)
])