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
|
From ca8570bad0bbefb450a2cbe40c17eb5a5565f829 Mon Sep 17 00:00:00 2001
From: Petr Nechaev <petr.nechaev@cogentembedded.com>
Date: Wed, 22 Nov 2017 00:21:45 +0300
Subject: [PATCH 1/1] Use pkg-config for locating gflags and gmock
Binaries gflags-config and gmock-config are not generated during
cross-compilation of gflags and gmock so use pkg-config instead.
---
configure.ac | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index 8b458fa..16a6c7e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,17 +138,19 @@ LIBS="$SAVE_LIBS"
# TODO(hamaji): Use official m4 macros provided by testing libraries
# once the m4 macro of Google Mocking becomes ready.
# Check if there is Google Test library installed.
-AC_CHECK_PROG(GTEST_CONFIG, gtest-config, "yes")
+# Use pkg-config instead of gtest-config with Yocto
+AC_CHECK_PROG(GTEST_CONFIG, pkg-config, "yes")
if test x"$GTEST_CONFIG" = "xyes"; then
- GTEST_CFLAGS=`gtest-config --cppflags --cxxflags`
- GTEST_LIBS=`gtest-config --ldflags --libs`
+ GTEST_CFLAGS=`pkg-config --cppflags --cxxflags gtest`
+ GTEST_LIBS=`pkg-config --libs gtest`
AC_DEFINE(HAVE_LIB_GTEST, 1, [define if you have google gtest library])
# Check if there is Google Mocking library installed.
- AC_CHECK_PROG(GMOCK_CONFIG, gmock-config, "yes")
+ # Use pkg-config instead of gmock-config with Yocto
+ AC_CHECK_PROG(GMOCK_CONFIG, pkg-config, "yes")
if test x"$GMOCK_CONFIG" = "xyes"; then
- GMOCK_CFLAGS=`gmock-config --cppflags --cxxflags`
- GMOCK_LIBS=`gmock-config --ldflags --libs`
+ GMOCK_CFLAGS=`pkg-config --cppflags --cxxflags gmock`
+ GMOCK_LIBS=`pkg-config --libs gmock`
AC_DEFINE(HAVE_LIB_GMOCK, 1, [define if you have google gmock library])
else
# We don't run test cases which use Google Mocking framework.
--
2.9.5
|