]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Makefile: allow gtest to be linked in statically
authorSage Weil <sage.weil@dreamhost.com>
Sun, 21 Aug 2011 23:38:01 +0000 (16:38 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Mon, 22 Aug 2011 00:53:19 +0000 (17:53 -0700)
Use UNITTEST_STATIC_LDADD instead of UNITTEST_LDADD.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Makefile.am
src/Makefile.am
src/gtest/Makefile.am

index 4e3386b1ecb9e3cfa8540dba7dd5a5593c43c071..91304f28ecbcb42f111db8ecc1bf098d0067a742 100644 (file)
@@ -14,7 +14,7 @@ all-local:
 if WITH_DEBUG
 #      We need gtest to build the rados-api tests. We only build those in
 #      a debug build, though.
-       @cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
+       @cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la lib/libgtest.a lib/libgtest_main.a
 endif
 
 check-local:
index c277cc4f2ccfbef9a6006b2c1f86e4f7d6990ce2..803f25d8ea4055c65f36243f6de981c8f687d76f 100644 (file)
@@ -430,6 +430,10 @@ UNITTEST_LDADD = \
        $(top_builddir)/src/gtest/lib/libgtest.la \
        $(top_builddir)/src/gtest/lib/libgtest_main.la \
        -lpthread
+UNITTEST_STATIC_LDADD = \
+       $(top_builddir)/src/gtest/lib/libgtest.a \
+       $(top_builddir)/src/gtest/lib/libgtest_main.a \
+       -lpthread
 
 unittest_encoding_SOURCES = test/encoding.cc
 unittest_encoding_LDADD = libceph.la -lpthread -lm \
index 93feeeb46234fb5e145652a4364c08261e6daf43..91858550283e0d2f909c4d725656b39ce667802c 100644 (file)
@@ -180,8 +180,10 @@ endif
 
 # Build rules for libraries.
 lib_LTLIBRARIES = lib/libgtest.la lib/libgtest_main.la
+lib_LTLIBRARIES += lib/libgtest.a lib/libgtest_main.a
 
 lib_libgtest_la_SOURCES = src/gtest-all.cc
+lib_libgtest_a_SOURCES = src/gtest-all.cc
 
 pkginclude_HEADERS = include/gtest/gtest.h \
                      include/gtest/gtest-death-test.h \
@@ -209,6 +211,9 @@ pkginclude_internal_HEADERS = \
 lib_libgtest_main_la_SOURCES = src/gtest_main.cc
 lib_libgtest_main_la_LIBADD = lib/libgtest.la
 
+lib_libgtest_main_a_SOURCES = src/gtest_main.cc
+lib_libgtest_main_a_LIBADD = lib/libgtest.a
+
 # Bulid rules for samples and tests. Automake's naming for some of
 # these variables isn't terribly obvious, so this is a brief
 # reference: