googletest strongly recommends that their library is
rebuilt on each platform, but this runs counter to a
tagged release of code that utilizes gtest.  This commit
enables `make dist` to bundle the googletest *.so files
into the resultant zip file.

Note that these googletest *.so files are dependent upon
a certain version of glibc (and other libraries) and may
not work on distros with very old versions of those
tools.

Signed-off-by: Tom Hromatka <tom.hroma...@oracle.com>
---
 bootstrap.sh            |  6 +++---
 tests/gunit/Makefile.am | 20 +++++++-------------
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/bootstrap.sh b/bootstrap.sh
index 8dbc10f59afd..6e6dcbb5962a 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -10,9 +10,9 @@ fi
 
 # configure googletest
 git submodule update --init --recursive
-pushd googletest
-autoreconf -i
-./configure
+pushd googletest/googletest
+git checkout release-1.8.0
+cmake -DBUILD_SHARED_LIBS=ON .
 make
 popd
 
diff --git a/tests/gunit/Makefile.am b/tests/gunit/Makefile.am
index e108d322863b..c6d2e42781c8 100644
--- a/tests/gunit/Makefile.am
+++ b/tests/gunit/Makefile.am
@@ -26,21 +26,13 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
              -std=c++11 \
              -DSTATIC= \
              -DUNIT_TEST
-LDADD = ../../src/.libs/libcgroupfortesting.la \
-       $(top_srcdir)/googletest/googletest/lib/libgtest.la \
-       $(top_srcdir)/googletest/googletest/lib/libgtest_main.la
+LDADD = $(top_builddir)/src/.libs/libcgroupfortesting.la
 
-EXTRA_DIST = $(top_srcdir)/googletest/googletest/lib/libgtest.la \
-            $(top_srcdir)/googletest/googletest/lib/libgtest_main.la \
-            $(top_srcdir)/googletest/googletest/lib/.libs \
-            $(top_srcdir)/googletest/googletest/include
+EXTRA_DIST = $(top_srcdir)/googletest/googletest/libgtest.so \
+            $(top_srcdir)/googletest/googletest/libgtest_main.so \
+            $(top_srcdir)/googletest/googletest/include \
+            libcgroup_unittest.map
 
-libgtest_la_SOURCES = libcgroup_unittest.map
-libgtest_la_CPPFLAGS = -I$(top_builddir)/googletest/googletest/include \
-                      -I$(top_builddir)/googletest/googletest
-libgtest_la_LDFLAGS = -lpthread
-
-check_LTLIBRARIES = libgtest.la
 check_PROGRAMS = gtest
 TESTS = gtest
 
@@ -50,3 +42,5 @@ gtest_SOURCES = gtest.cpp \
                003-cg_get_cgroups_from_proc_cgroups.cpp \
                004-cgroup_compare_ignore_rule.cpp \
                005-cgroup_compare_wildcard_procname.cpp
+gtest_LDFLAGS = -L$(top_builddir)/googletest/googletest -l:libgtest.so \
+               -rpath $(abs_top_builddir)/googletest/googletest
-- 
1.8.3.1



_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to