From 62d8866021f04bc8afc8e63d366c71d11c817bc9 Mon Sep 17 00:00:00 2001 From: Benjamin Gaignard Date: Wed, 30 Jan 2013 14:34:00 +0100 Subject: tests: allow tests programs to be installed Install test programs is useful in cross compilation case. By default the behavior is the same and test programs aren't installed in $bindir. If --enable-install-test-programs is set then test programs are installed in $bindir. Signed-off-by: Benjamin Gaignard Signed-off-by: Rob Clark --- configure.ac | 10 ++++++++++ tests/kmstest/Makefile.am | 5 +++++ tests/modeprint/Makefile.am | 5 +++++ tests/modetest/Makefile.am | 5 +++++ tests/vbltest/Makefile.am | 6 +++++- 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ee4ac721..59e8a346 100644 --- a/configure.ac +++ b/configure.ac @@ -98,6 +98,11 @@ AC_ARG_ENABLE(freedreno-experimental-api, [Enable support for freedreno's experimental API (default: disabled)]), [FREEDRENO=$enableval], [FREEDRENO=no]) +AC_ARG_ENABLE(install-test-programs, + AS_HELP_STRING([--enable-install-test-programs], + [Install test programs (default: no)]), + [INSTALL_TESTS=$enableval], [INSTALL_TESTS=no]) + dnl =========================================================================== dnl check compiler flags AC_DEFUN([LIBDRM_CC_TRY_FLAG], [ @@ -211,6 +216,11 @@ if test "x$FREEDRENO" = xyes; then AC_DEFINE(HAVE_FREEDRENO, 1, [Have freedreno support]) fi +AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes]) +if test "x$INSTALL_TESTS" = xyes; then + AC_DEFINE(HAVE_INSTALL_TESTS, 1, [Install test programs]) +fi + AC_ARG_ENABLE([cairo-tests], [AS_HELP_STRING([--enable-cairo-tests], [Enable support for Cairo rendering in tests (default: auto)])], diff --git a/tests/kmstest/Makefile.am b/tests/kmstest/Makefile.am index ae562a10..7903a267 100644 --- a/tests/kmstest/Makefile.am +++ b/tests/kmstest/Makefile.am @@ -3,8 +3,13 @@ AM_CFLAGS = \ -I$(top_srcdir)/libkms/ \ -I$(top_srcdir) +if HAVE_INSTALL_TESTS +bin_PROGRAMS = \ + kmstest +else noinst_PROGRAMS = \ kmstest +endif kmstest_SOURCES = \ main.c diff --git a/tests/modeprint/Makefile.am b/tests/modeprint/Makefile.am index c4862acd..6420ef33 100644 --- a/tests/modeprint/Makefile.am +++ b/tests/modeprint/Makefile.am @@ -2,8 +2,13 @@ AM_CFLAGS = \ -I$(top_srcdir)/include/drm \ -I$(top_srcdir) +if HAVE_INSTALL_TESTS +bin_PROGRAMS = \ + modeprint +else noinst_PROGRAMS = \ modeprint +endif modeprint_SOURCES = \ modeprint.c diff --git a/tests/modetest/Makefile.am b/tests/modetest/Makefile.am index 065ae132..410c6326 100644 --- a/tests/modetest/Makefile.am +++ b/tests/modetest/Makefile.am @@ -3,8 +3,13 @@ AM_CFLAGS = \ -I$(top_srcdir)/libkms/ \ -I$(top_srcdir) +if HAVE_INSTALL_TESTS +bin_PROGRAMS = \ + modetest +else noinst_PROGRAMS = \ modetest +endif modetest_SOURCES = \ buffers.c modetest.c buffers.h diff --git a/tests/vbltest/Makefile.am b/tests/vbltest/Makefile.am index 77f90370..f99b6a23 100644 --- a/tests/vbltest/Makefile.am +++ b/tests/vbltest/Makefile.am @@ -1,9 +1,13 @@ AM_CFLAGS = \ -I$(top_srcdir)/include/drm \ -I$(top_srcdir) - +if HAVE_INSTALL_TESTS +noinst_PROGRAMS = \ + vbltest +else noinst_PROGRAMS = \ vbltest +endif vbltest_SOURCES = \ vbltest.c -- cgit v1.2.3