summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>2022-08-26 08:59:23 +0200
committerKhem Raj <raj.khem@gmail.com>2022-08-27 07:37:46 -0700
commit4db814180c1646af3186a0a095fe41afe9474557 (patch)
tree612ca106ed46a4b3e8ef3c5898ef827850408be5
parent61e3493c5305b941cee4781707c8576b3f7bea89 (diff)
downloadmeta-openembedded-4db814180c1646af3186a0a095fe41afe9474557.tar.gz
protobuf: change build system to cmake
Autotools support has been removed and replaced completely by CMake. See related issues for details: https://github.com/protocolbuffers/protobuf/issues/7911 https://github.com/protocolbuffers/protobuf/pull/10132 Drop autotools patches too. Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/protobuf/protobuf/0001-Makefile.am-include-descriptor.cc-when-building-libp.patch30
-rw-r--r--meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch31
-rw-r--r--meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb23
3 files changed, 16 insertions, 68 deletions
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/0001-Makefile.am-include-descriptor.cc-when-building-libp.patch b/meta-oe/recipes-devtools/protobuf/protobuf/0001-Makefile.am-include-descriptor.cc-when-building-libp.patch
deleted file mode 100644
index 59d43072c7..0000000000
--- a/meta-oe/recipes-devtools/protobuf/protobuf/0001-Makefile.am-include-descriptor.cc-when-building-libp.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 76980e1c84374e8bfa4dffcca78c5050783e83b9 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Thu, 27 Jun 2019 13:27:18 +0000
4Subject: [PATCH] Makefile.am: include descriptor.pb.cc when building
5 libprotoc.so
6
7* otherwise plugin.pb.o has undefined symbol scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto
8 and build with gold fails with:
9 core2-32-oe-linux/protobuf/3.8.0-r0/recipe-sysroot-native/usr/bin/i686-oe-linux/../../libexec/i686-oe-linux/gcc/i686-oe-linux/9.1.0/ld.bfd: ./.libs/libprotoc.so: undefined reference to `descriptor_table_google_2fprotobuf_2fdescriptor_2eproto'
10 core2-32-oe-linux/protobuf/3.8.0-r0/recipe-sysroot-native/usr/bin/i686-oe-linux/../../libexec/i686-oe-linux/gcc/i686-oe-linux/9.1.0/ld.bfd: ./.libs/libprotoc.so: undefined reference to `scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto'
11
12Upstream-Status: Pending
13Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
14
15---
16 src/Makefile.am | 1 +
17 1 file changed, 1 insertion(+)
18
19diff --git a/src/Makefile.am b/src/Makefile.am
20index e6a7dc7fd..6b0fe6686 100644
21--- a/src/Makefile.am
22+++ b/src/Makefile.am
23@@ -326,6 +326,7 @@ libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map
24 EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map
25 endif
26 libprotoc_la_SOURCES = \
27+ google/protobuf/descriptor.pb.cc \
28 google/protobuf/compiler/code_generator.cc \
29 google/protobuf/compiler/command_line_interface.cc \
30 google/protobuf/compiler/cpp/enum.cc \
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch b/meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch
deleted file mode 100644
index 7c87dbe262..0000000000
--- a/meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 2649fe191ad3f086274a9bf1520212a4c715c944 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Wed, 18 Jul 2018 17:52:34 +0800
4Subject: [PATCH] protobuf: fix configure error
5
6fix below error:
7gnu-configize: 'configure.ac' or 'configure.in' is required
8
9third_party/googletest is git submodule of protobuf. Above error
10caused by missing submodule googletest.
11
12Upstream-Status: Inappropriate [oe-specific]
13
14Signed-off-by: Changqing Li <changqing.li@windriver.com>
15
16---
17 configure.ac | 1 -
18 1 file changed, 1 deletion(-)
19
20diff --git a/configure.ac b/configure.ac
21index 375a79d93..1d73cd73f 100644
22--- a/configure.ac
23+++ b/configure.ac
24@@ -241,7 +241,6 @@ AC_SUBST([LIBLOG_LIBS])
25 # too.
26 export CFLAGS
27 export CXXFLAGS
28-AC_CONFIG_SUBDIRS([third_party/googletest])
29
30 AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
31 AC_OUTPUT
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb b/meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb
index 26ac8dd1c0..88bef2c06d 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb
+++ b/meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb
@@ -14,8 +14,6 @@ SRCREV = "ab840345966d0fa8e7100d771c92a73bfbadd25c"
14 14
15SRC_URI = "git://github.com/protocolbuffers/protobuf.git;branch=21.x;protocol=https \ 15SRC_URI = "git://github.com/protocolbuffers/protobuf.git;branch=21.x;protocol=https \
16 file://run-ptest \ 16 file://run-ptest \
17 file://0001-protobuf-fix-configure-error.patch \
18 file://0001-Makefile.am-include-descriptor.cc-when-building-libp.patch \
19 file://0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch \ 17 file://0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch \
20 file://0001-Fix-linking-error-with-ld-gold.patch \ 18 file://0001-Fix-linking-error-with-ld-gold.patch \
21 " 19 "
@@ -24,12 +22,17 @@ SRC_URI:append:mipsel:toolchain-clang = " file://0001-Fix-build-on-mips-clang.pa
24 22
25S = "${WORKDIR}/git" 23S = "${WORKDIR}/git"
26 24
27inherit autotools-brokensep pkgconfig ptest 25inherit cmake pkgconfig ptest
28 26
29PACKAGECONFIG ??= "" 27PACKAGECONFIG ??= ""
30PACKAGECONFIG[python] = ",," 28PACKAGECONFIG[python] = ",,"
31 29
32EXTRA_OECONF += "--with-protoc=echo" 30EXTRA_OECMAKE += "\
31 -Dprotobuf_BUILD_SHARED_LIBS=ON \
32 -Dprotobuf_BUILD_LIBPROTOC=ON \
33 -Dprotobuf_BUILD_TESTS=OFF \
34 -Dprotobuf_BUILD_EXAMPLES=OFF \
35"
33 36
34TEST_SRC_DIR = "examples" 37TEST_SRC_DIR = "examples"
35LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}" 38LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
@@ -40,9 +43,15 @@ do_compile_ptest() {
40 # Add the location of the cross-compiled header and library files 43 # Add the location of the cross-compiled header and library files
41 # which haven't been installed yet. 44 # which haven't been installed yet.
42 cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc" 45 cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc"
46 cp ${S}/${TEST_SRC_DIR}/*.cc "${B}/${TEST_SRC_DIR}/"
47 cp ${S}/${TEST_SRC_DIR}/*.proto "${B}/${TEST_SRC_DIR}/"
48 cp ${S}/${TEST_SRC_DIR}/*.py "${B}/${TEST_SRC_DIR}/"
49 cp ${S}/${TEST_SRC_DIR}/Makefile "${B}/${TEST_SRC_DIR}/"
43 sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" 50 sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
44 sed -e 's|Cflags:|Cflags: -I${S}/src|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" 51 sed -e 's|Cflags:|Cflags: -I${S}/src|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
45 sed -e 's|Libs:|Libs: -L${B}/src/.libs|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" 52 sed -e 's|Libs:|Libs: -L${B}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
53 # Until out-of-tree build of examples is supported, we have to use this approach
54 sed -e 's|../src/google/protobuf/.libs/timestamp.pb.o|${B}/CMakeFiles/libprotobuf.dir/src/google/protobuf/timestamp.pb.cc.o|' -i "${B}/${TEST_SRC_DIR}/Makefile"
46 export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}" 55 export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}"
47 56
48 # Save the pkgcfg sysroot variable, and update it to nothing so 57 # Save the pkgcfg sysroot variable, and update it to nothing so
@@ -54,7 +63,7 @@ do_compile_ptest() {
54 63
55 # Compile the tests 64 # Compile the tests
56 for lang in ${LANG_SUPPORT}; do 65 for lang in ${LANG_SUPPORT}; do
57 oe_runmake -C "${S}/${TEST_SRC_DIR}" ${lang} 66 oe_runmake -C "${B}/${TEST_SRC_DIR}" ${lang}
58 done 67 done
59 68
60 # Restore the pkgconfig sysroot variable 69 # Restore the pkgconfig sysroot variable
@@ -71,7 +80,7 @@ do_install_ptest() {
71 install "$i" "${D}/${PTEST_PATH}" 80 install "$i" "${D}/${PTEST_PATH}"
72 fi 81 fi
73 done 82 done
74 cp "${S}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}" 83 cp "${B}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}"
75 cd "$olddir" 84 cd "$olddir"
76} 85}
77 86