diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2018-10-15 11:11:42 +0000 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2018-10-15 13:37:23 -0700 |
commit | e6978e60b6fda4c83eeb400528f16408e80082d7 (patch) | |
tree | 50d942f41392aac08604542010dc06fa87a52ac8 | |
parent | 5559ea533dd2ee5a6d5f10ec8cb2b244ce7f9e65 (diff) | |
download | meta-openembedded-e6978e60b6fda4c83eeb400528f16408e80082d7.tar.gz |
glog: enable building shared library again
* fix the soversion used by libglog as explained bellow:
The preferred default should IMHO be the same as with 0.3.4 version
which was shared library, but that's easy to add with small bbappend
having:
EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON"
but unfortunately the SONAME in the library changed from:
objdump -x usr/lib/libglog.so.0.0.0 | grep SONAME
SONAME libglog.so.0
in 0.3.4 to:
objdump -x usr/lib/libglog.so.0.3.5 | grep SONAME
SONAME libglog.so.0.3.5
Which breaks all our prebuilt binaries which now correctly complain that
there isn't libglog.so.0 provider in dependencies:
QA Issue: /usr/lib/libfoo.so.1.2.3 contained in package libfoo requires
libglog.so.0, but no providers found in RDEPENDS_libfoo
Which is quite unfortunate for minor upgrade. Did they really change the
ABI (and expect to change it in all future minor upgrades) or is this
change just unexpected side-effect of using cmake instead of autotools?
It looks the later, because if I build 0.3.5 version with autotools I
get:
objdump -x usr/lib/libglog.so.0.0.0 | grep SONAME
SONAME libglog.so.0
and there is patch for SOVERSION here as well:
https://github.com/google/or-tools/blob/master/patches/glog.patch
applied in master:
https://github.com/google/glog/blob/master/CMakeLists.txt#L493
https://github.com/google/glog/commit/6b6e38a7d53fe01f42ce34384cf4ba4c50e8cb65#diff-af3b638bc2a3e6c650974192a53c7291
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-support/glog/glog/0001-Rework-CMake-glog-VERSION-management.patch | 71 | ||||
-rw-r--r-- | meta-oe/recipes-support/glog/glog_0.3.5.bb | 3 |
2 files changed, 74 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/glog/glog/0001-Rework-CMake-glog-VERSION-management.patch b/meta-oe/recipes-support/glog/glog/0001-Rework-CMake-glog-VERSION-management.patch new file mode 100644 index 000000000..f41a6c972 --- /dev/null +++ b/meta-oe/recipes-support/glog/glog/0001-Rework-CMake-glog-VERSION-management.patch | |||
@@ -0,0 +1,71 @@ | |||
1 | From 4ea11e0d7c0575316a6ccc07a931164ca29c3d2f Mon Sep 17 00:00:00 2001 | ||
2 | From: Corentin Le Molgat <corentinl@google.com> | ||
3 | Date: Mon, 29 Jan 2018 14:59:08 +0100 | ||
4 | Subject: [PATCH] Rework CMake glog VERSION management. | ||
5 | |||
6 | - Use of Project version properties instead of custom variables | ||
7 | - fix missmatch between VERSION (build version) and SOVERSION (API version) | ||
8 | src: https://cmake.org/cmake/help/latest/prop_tgt/VERSION.html#prop_tgt:VERSION | ||
9 | |||
10 | Upstream-Status: Backport [https://github.com/google/glog/commit/6b6e38a7d53fe01f42ce34384cf4ba4c50e8cb65] | ||
11 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
12 | --- | ||
13 | CMakeLists.txt | 23 ++++++++--------------- | ||
14 | 1 file changed, 8 insertions(+), 15 deletions(-) | ||
15 | |||
16 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
17 | index 7415eab..fb4e408 100644 | ||
18 | --- a/CMakeLists.txt | ||
19 | +++ b/CMakeLists.txt | ||
20 | @@ -8,23 +8,16 @@ if (POLICY CMP0063) | ||
21 | cmake_policy (SET CMP0063 NEW) | ||
22 | endif (POLICY CMP0063) | ||
23 | |||
24 | -project (google-glog) | ||
25 | +project(glog VERSION 0.3.5 LANGUAGES C CXX) | ||
26 | |||
27 | enable_testing () | ||
28 | |||
29 | -set (GLOG_MAJOR_VERSION 0) | ||
30 | -set (GLOG_MINOR_VERSION 3) | ||
31 | -set (GLOG_PATCH_VERSION 5) | ||
32 | - | ||
33 | -set (GLOG_VERSION | ||
34 | - ${GLOG_MAJOR_VERSION}.${GLOG_MINOR_VERSION}.${GLOG_PATCH_VERSION}) | ||
35 | - | ||
36 | set (CPACK_PACKAGE_NAME glog) | ||
37 | set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "") | ||
38 | -set (CPACK_PACKAGE_VERSION_MAJOR ${GLOG_MAJOR_VERSION}) | ||
39 | -set (CPACK_PACKAGE_VERSION_MINOR ${GLOG_MINOR_VERSION}) | ||
40 | -set (CPACK_PACKAGE_VERSION_PATCH ${GLOG_PATCH_VERSION}) | ||
41 | -set (CPACK_PACKAGE_VERSION ${GLOG_VERSION}) | ||
42 | +set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) | ||
43 | +set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) | ||
44 | +set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) | ||
45 | +set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) | ||
46 | |||
47 | option (WITH_GFLAGS "Use gflags" ON) | ||
48 | option (WITH_THREADS "Enable multithreading support" ON) | ||
49 | @@ -406,8 +399,8 @@ if (gflags_FOUND) | ||
50 | endif (NOT BUILD_SHARED_LIBS) | ||
51 | endif (gflags_FOUND) | ||
52 | |||
53 | -set_target_properties (glog PROPERTIES VERSION ${GLOG_MAJOR_VERSION}) | ||
54 | -set_target_properties (glog PROPERTIES SOVERSION ${GLOG_VERSION}) | ||
55 | +set_target_properties (glog PROPERTIES VERSION ${PROJECT_VERSION}) | ||
56 | +set_target_properties (glog PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR}) | ||
57 | |||
58 | if (WIN32) | ||
59 | target_compile_definitions (glog PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES) | ||
60 | @@ -570,7 +563,7 @@ configure_package_config_file (glog-config.cmake.in | ||
61 | NO_CHECK_REQUIRED_COMPONENTS_MACRO) | ||
62 | |||
63 | write_basic_package_version_file (glog-config-version.cmake VERSION | ||
64 | - ${GLOG_VERSION} COMPATIBILITY SameMajorVersion) | ||
65 | + ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion) | ||
66 | |||
67 | export (TARGETS glog NAMESPACE glog:: FILE glog-targets.cmake) | ||
68 | export (PACKAGE glog) | ||
69 | -- | ||
70 | 2.17.1 | ||
71 | |||
diff --git a/meta-oe/recipes-support/glog/glog_0.3.5.bb b/meta-oe/recipes-support/glog/glog_0.3.5.bb index bf7df53f3..4c1bce74e 100644 --- a/meta-oe/recipes-support/glog/glog_0.3.5.bb +++ b/meta-oe/recipes-support/glog/glog_0.3.5.bb | |||
@@ -11,6 +11,7 @@ DEPENDS = "libunwind" | |||
11 | SRC_URI = " \ | 11 | SRC_URI = " \ |
12 | git://github.com/google/glog.git;branch=v035 \ | 12 | git://github.com/google/glog.git;branch=v035 \ |
13 | file://0001-find-libunwind-during-configure.patch \ | 13 | file://0001-find-libunwind-during-configure.patch \ |
14 | file://0001-Rework-CMake-glog-VERSION-management.patch \ | ||
14 | " | 15 | " |
15 | 16 | ||
16 | SRCREV = "a6a166db069520dbbd653c97c2e5b12e08a8bb26" | 17 | SRCREV = "a6a166db069520dbbd653c97c2e5b12e08a8bb26" |
@@ -22,3 +23,5 @@ inherit cmake | |||
22 | RDEPENDS_${PN}-dev = "" | 23 | RDEPENDS_${PN}-dev = "" |
23 | RRECOMMENDS_${PN}-dev = "${PN}-staticdev" | 24 | RRECOMMENDS_${PN}-dev = "${PN}-staticdev" |
24 | RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})" | 25 | RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})" |
26 | |||
27 | EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON" | ||