diff options
author | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2016-09-01 12:59:36 -0700 |
---|---|---|
committer | Sean V Kelley <seanvk@posteo.de> | 2016-09-07 10:18:01 -0700 |
commit | b6906974929e778400c2a84dba8ebf2a2a3f68f4 (patch) | |
tree | 886ba2980714b9abf26ffa17f22d9b8c9c895f72 | |
parent | 1746adbb9adabd9fbee417ae3db67da599cc84e9 (diff) |
toolchain: build gtest convenience library
Define autoconf/automake rules to build libgtest.la
as a convenience library.
Add --enable-tests configure option (default:no).
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-by: Sean V Kelley <seanvk@posteo.de>
-rw-r--r-- | Makefile.am | 5 | ||||
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | test/Makefile.am | 38 |
3 files changed, 53 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 093adef..37ef353 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,11 @@ AUTOMAKE_OPTIONS = foreign SUBDIRS = debian.upstream src +if ENABLE_TESTS +SUBDIRS += test +endif + + # Extra clean files so that maintainer-clean removes *everything* MAINTAINERCLEANFILES = \ aclocal.m4 compile config.guess config.sub \ diff --git a/configure.ac b/configure.ac index f12f8a6..7b4fd0a 100644 --- a/configure.ac +++ b/configure.ac @@ -61,11 +61,16 @@ AC_ARG_ENABLE([hybrid-codec], [build with hybrid codec support @<:@default=no@:>@])], [], [enable_hybrid_codec="no"]) +AC_ARG_ENABLE([tests], + [AC_HELP_STRING([--enable-tests], + [build tests @<:@default=no@:>@])], + [], [enable_tests="no"]) + AC_DISABLE_STATIC AC_PROG_LIBTOOL AC_PROG_CC AM_PROG_CC_C_O - +AC_PROG_CXX AC_C_BIGENDIAN AC_HEADER_STDC AC_SYS_LARGEFILE @@ -116,6 +121,8 @@ if test "$enable_hybrid_codec" = "yes"; then AC_DEFINE([HAVE_HYBRID_CODEC], [1], [Defined to 1 if hybrid codec is needed]) fi +AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" = "yes") + VA_VERSION=`$PKG_CONFIG --modversion libva` VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1` VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2` @@ -207,6 +214,7 @@ AC_OUTPUT([ src/shaders/render/Makefile src/shaders/utils/Makefile src/shaders/vme/Makefile + test/Makefile ]) dnl Print summary @@ -221,4 +229,5 @@ echo echo VA-API version ................... : $VA_VERSION_STR echo VA-API drivers path .............. : $LIBVA_DRIVERS_PATH echo Windowing systems ................ : $BACKENDS +echo Build tests ...................... : $enable_tests echo diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..aa79703 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,38 @@ +AUTOMAKE_OPTIONS = subdir-objects + +AM_CXXFLAGS = \ + -I$(top_srcdir)/test/gtest/include \ + $(NULL) + +AM_CPPFLAGS = \ + -DGTEST_HAS_PTHREAD=1 \ + -DGTEST_USE_OWN_TR1_TUPLE=0 \ + -DGTEST_LANG_CXX11=1 \ + -DGTEST_HAS_TR1_TUPLE=1 \ + -std=c++11 \ + $(NULL) + +AM_LDFLAGS = \ + -pthread \ + $(NULL) + +noinst_LTLIBRARIES = libgtest.la + +libgtest_la_SOURCES = \ + gtest/src/gtest-all.cc \ + gtest/src/gtest_main.cc \ + $(NULL) + +libgtest_la_CXXFLAGS = \ + -I$(top_srcdir)/test/gtest \ + $(AM_CXXFLAGS) \ + $(NULL) + +EXTRA_DIST = \ + gtest/docs \ + gtest/include \ + gtest/src/*.cc \ + gtest/src/*.h \ + gtest/README.md \ + gtest/LICENSE \ + $(NULL) |