]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
autotools: gtest: Distribute the googletest *.so files
authorTom Hromatka <tom.hromatka@oracle.com>
Mon, 13 Jan 2020 23:31:20 +0000 (23:31 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 13 Jan 2020 23:31:20 +0000 (23:31 +0000)
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.hromatka@oracle.com>
bootstrap.sh
tests/gunit/Makefile.am

index 8dbc10f59afd4650762a8ca394094923e4af96a1..6e6dcbb5962a308df54b2a83ff99d2ade431a473 100755 (executable)
@@ -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
 
index e108d322863b0f87d76b4cd905dd5d73686be389..c6d2e42781c8985dfd3dc73f899893cdc3b5bf4e 100644 (file)
@@ -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