diff options
author | Daniel Walter <dwalter@sigma-star.at> | 2016-08-31 10:11:14 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2016-11-17 11:36:56 +0100 |
commit | e635677589fa9fed6310e8ec2c3cab7afa93b9ce (patch) | |
tree | 7fd732eea10c4144f0068d8b45ce99d585694fdc /configure.ac | |
parent | 005cef532697be0746c72632f94cfeae67a2a187 (diff) |
Add Makefile for unittests
Signed-off-by: Daniel Walter <dwalter@sigma-star.at>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 637d692..18ff9af 100644 --- a/configure.ac +++ b/configure.ac @@ -3,6 +3,20 @@ AC_PREREQ([2.60]) m4_define([RELEASE], 1.5.2) AC_INIT([mtd-utils], [RELEASE], [linux-mtd@lists.infradead.org], mtd-utils) + + +AC_ARG_ENABLE([unit-tests], + [AS_HELP_STRING([--enable-unit-tests], [Compile unit test programs])], + [case "${enableval}" in + yes) AM_CONDITIONAL([UNIT_TESTS], [true]) ;; + no) AM_CONDITIONAL([UNIT_TESTS], [false]) ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-unit-tests]) ;; + esac], + [AM_CONDITIONAL([UNIT_TESTS], [false])]) + +AM_COND_IF([UNIT_TESTS], [: ${CFLAGS=""}], []) + + AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign subdir-objects dist-bzip2]) AM_SILENT_RULES([yes]) @@ -78,6 +92,8 @@ AM_CONDITIONAL([HAVE_EXECINFO], [test "x$execinfo_found" == "xyes"]) PKG_CHECK_MODULES(ZLIB, [ zlib ]) PKG_CHECK_MODULES(UUID, [ uuid ]) +AM_COND_IF([UNIT_TESTS], [PKG_CHECK_MODULES(CMOCKA, [ cmocka ])], []) + AM_COND_IF([WITHOUT_LZO], [], [ have_lzo="yes" AC_ARG_VAR([LZO_CFLAGS], [C compiler flags for lzo]) |