Package: gumbo-parser / 0.13.0+dfsg-2

00-tests.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Description: Use libgtest-dev to build tests.
Author: Onur Aslan <onur@onur.im>
Forwarded: not-needed
Last-Update: 2014-10-13

--- a/Makefile.am
+++ b/Makefile.am
@@ -7,27 +7,16 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
-if !HAVE_SHARED_LIBGTEST
+# Using Debian's libgtest-dev for tests
+GTEST_DIR = /usr/src/gtest
 
-gtest/lib/libgtest.a gtest/lib/libgtest_main.a: gtest/Makefile
-	cd gtest && $(MAKE) $(AM_MAKEFLAGS)
-
-gtest/Makefile: gtest/CMakeLists.txt
-	cd gtest && cmake . -DBUILD_GMOCK=OFF
-
-# We would like to clean gtest when "make clean" is invoked.  But we have to
-# be careful because clean-local is also invoked during "make distclean", but
-# "make distclean" already recurses into gtest because it's listed among the
-# DIST_SUBDIRS.  distclean will delete gtest/Makefile, so if we then try to
-# cd to the directory again and "make clean" it will fail.  So, check that the
-# Makefile exists before recursing.
-clean-local:
-	@if test -e gtest/Makefile; then \
-		echo "Making clean in gtest"; \
-		cd gtest && $(MAKE) $(AM_MAKEFLAGS) clean; \
-	fi
-
-endif !HAVE_SHARED_LIBGTEST
+tests/gtest-all.o:
+	$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \
+            $(GTEST_DIR)/src/gtest-all.cc -o tests/gtest-all.o
+
+tests/gtest_main.o:
+	$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \
+            $(GTEST_DIR)/src/gtest_main.cc -o tests/gtest_main.o
 
 gentags: src/tag.in
 	@python gentags.py $<
@@ -89,13 +78,9 @@ gumbo_test_SOURCES = \
 gumbo_test_DEPENDENCIES = libgumbo.la
 gumbo_test_LDADD = libgumbo.la
 
-if HAVE_SHARED_LIBGTEST
-# FIXME(bnoordhuis) Should be configurable by the user.
-gumbo_test_LDADD += -lgtest -lgtest_main
-else
-gumbo_test_DEPENDENCIES += gtest/lib/libgtest.a gtest/lib/libgtest_main.a
-gumbo_test_LDADD += gtest/lib/libgtest.a gtest/lib/libgtest_main.a
-endif
+gumbo_test_DEPENDENCIES += tests/gtest-all.o tests/gtest_main.o
+gumbo_test_LDADD += tests/gtest-all.o tests/gtest_main.o
+gumbo_test_LDFLAGS = -pthread
 
 noinst_PROGRAMS = clean_text find_links get_title positions_of_class benchmark serialize prettyprint
 LDADD = libgumbo.la