diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2010-06-22 11:45:17 +0200 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-22 11:45:17 +0200 |
commit | 7a5b2c37ea0b4ec81fbe8be7c1d7f9bf1731439e (patch) | |
tree | 803e0d9f0c1cac2cda089d755cb9dab76a802b66 | |
parent | 9c5128866ea65ad300b40d47a9d43998dc8bc9f4 (diff) | |
download | mtdev-git-7a5b2c37ea0b4ec81fbe8be7c1d7f9bf1731439e.tar.gz |
Build test tools also under autoconf
The tests can be disabled by using --enable-test=no in configure.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | test/Makefile.am | 12 |
4 files changed, 24 insertions, 1 deletions
@@ -76,3 +76,5 @@ core # Edit the following section as needed # For example, !report.pc overrides *.pc. See 'man gitignore' # +test/mtdev +test/mtdev-mapgen diff --git a/Makefile.am b/Makefile.am index e2c1d0a..5fb2b00 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = src +SUBDIRS = src test pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = mtdev.pc diff --git a/configure.ac b/configure.ac index cb59c11..3a033ab 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,14 @@ AC_PROG_LIBTOOL AC_PROG_CC AC_PROG_INSTALL +# Optional test build +AC_ARG_ENABLE(test, + AC_HELP_STRING([--enable-test], + [Build test programs [[default=auto]]]), + [build_test="$enableval"], + [build_test="auto"]) +AM_CONDITIONAL(BUILD_TEST, [ test "$build_test" != "no" ]) + # Initialize X.Org macros m4_ifndef([XORG_MACROS_VERSION], [m4_fatal([must install xorg-macros 1.5 or later before running autoconf/autogen])]) @@ -29,5 +37,6 @@ XORG_DEFAULT_OPTIONS AC_CONFIG_FILES([Makefile src/Makefile + test/Makefile mtdev.pc]) AC_OUTPUT diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..532540d --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,12 @@ +if BUILD_TEST + +bin_PROGRAMS = mtdev-mapgen mtdev + +INCLUDES=-I$(top_srcdir)/include/ + +mtdev_mapgen_SOURCES = mtdev-mapgen.c + +mtdev_SOURCES = mtdev.c +mtdev_LDFLAGS = -lmtdev + +endif |