Skip to contentSkip to conversation

Opentracing-cpp: new package

PATCH Superseded Jan Heylen 2 participants 6 messages Jan 3, 2018 – Jan 5, 2018

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Jan Heylen

author
#0 lore raw

v4 cover Opentracing-cpp: new package

From: Jan Heylen <[email protected]>

Hi,

V4 of "this adds opentracing-cpp package as a logging library package."

Added generalisation of pkg-cmake stuff related to shared/static stuff

The included patch is already upstreamed and merged, but no new opentracing-cpp release was created yet.

br,

Jan

Jan Heylen (2):
pkg-cmake: make BUILD_SHARED_LIBS part of generic cmake pkg logic
opentracing-cpp: new package

 DEVELOPERS                                         |  3 +
 package/Config.in                                  |  1 +
 ...shared-static-target-a-configurable-optio.patch | 74 ++++++++++++++++++++++
 package/opentracing-cpp/Config.in                  | 16 +++++
 package/opentracing-cpp/opentracing-cpp.hash       |  3 +
 package/opentracing-cpp/opentracing-cpp.mk         | 14 ++++
 package/pkg-cmake.mk                               | 14 +++-
 package/rabbitmq-c/rabbitmq-c.mk                   |  8 ---
 8 files changed, 124 insertions(+), 9 deletions(-)
 create mode 100644 package/opentracing-cpp/0001-CMake-make-shared-static-target-a-configurable-optio.patch
 create mode 100644 package/opentracing-cpp/Config.in
 create mode 100644 package/opentracing-cpp/opentracing-cpp.hash
 create mode 100644 package/opentracing-cpp/opentracing-cpp.mk
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v4 1/2 pkg-cmake: make BUILD_SHARED_LIBS part of generic cmake pkg logic

From: Jan Heylen <[email protected]>

---
Manually tested with opentracing package,
also checked that e.g. gtest configuration goes well (gtest.mk does an override of BUILD_SHARED_LIBS)

---
 package/pkg-cmake.mk             | 14 +++++++++++++-
 package/rabbitmq-c/rabbitmq-c.mk |  8 --------
 2 files changed, 13 insertions(+), 9 deletions(-)
package/pkg-cmake.mk +13 -1
index 6739704..f819e90 100644
@@ -71,6 +71,17 @@ else
 $(2)_BUILDDIR			= $$($(2)_SRCDIR)/buildroot-build
 endif
 
+ifeq ($(BR2_STATIC_LIBS),y)
+CMAKE_BUILD_SHARED_LIBS = OFF
+CMAKE_BUILD_STATIC_LIBS = ON
+else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
+CMAKE_BUILD_SHARED_LIBS = ON
+CMAKE_BUILD_STATIC_LIBS = ON
+else ifeq ($(BR2_SHARED_LIBS),y)
+CMAKE_BUILD_SHARED_LIBS = ON
+CMAKE_BUILD_STATIC_LIBS = OFF
+endif
+
 #
 # Configure step. Only define it if not already defined by the package
 # .mk file. And take care of the differences between host and target
@@ -96,7 +107,8 @@ define $(2)_CONFIGURE_CMDS
 		-DBUILD_TEST=OFF \
 		-DBUILD_TESTS=OFF \
 		-DBUILD_TESTING=OFF \
-		-DBUILD_SHARED_LIBS=$$(if $$(BR2_STATIC_LIBS),OFF,ON) \
+		-DBUILD_SHARED_LIBS=$$(CMAKE_BUILD_SHARED_LIBS) \
+		-DBUILD_STATIC_LIBS=$$(CMAKE_BUILD_STATIC_LIBS) \
 		$$(CMAKE_QUIET) \
 		$$($$(PKG)_CONF_OPTS) \
 	)
package/rabbitmq-c/rabbitmq-c.mk +0 -8
index eef09ec..5a34e53 100644
@@ -13,14 +13,6 @@ RABBITMQ_C_CONF_OPTS = \
 	-DBUILD_API_DOCS=OFF \
 	-DBUILD_TOOLS_DOCS=OFF
 
-ifeq ($(BR2_STATIC_LIBS),y)
-RABBITMQ_C_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON
-else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
-RABBITMQ_C_CONF_OPTS += -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON
-else ifeq ($(BR2_SHARED_LIBS),y)
-RABBITMQ_C_CONF_OPTS += -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
-endif
-
 # CMake OpenSSL detection is buggy, and doesn't properly use
 # pkg-config, so it fails when statically linking. See
 # https://gitlab.kitware.com/cmake/cmake/issues/16885.
Signature · 1 line
2.7.4
#2 lore raw

PATCH v4 1/2 pkg-cmake: make BUILD_SHARED_LIBS part of generic cmake pkg logic

Hello,

Quoted 3 lines · Jan Heylen

From: Jan Heylen <[email protected]>

This commit really needs a better description as to why we are doing this.

package/pkg-cmake.mk else · line 82

Quoted 9 lines
package/pkg-cmake.mk +9 -0
+ifeq ($(BR2_STATIC_LIBS),y)
+CMAKE_BUILD_SHARED_LIBS = OFF
+CMAKE_BUILD_STATIC_LIBS = ON
+else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
+CMAKE_BUILD_SHARED_LIBS = ON
+CMAKE_BUILD_STATIC_LIBS = ON
+else ifeq ($(BR2_SHARED_LIBS),y)
+CMAKE_BUILD_SHARED_LIBS = ON
+CMAKE_BUILD_STATIC_LIBS = OFF

I don't think those intermediate variables are really useful.

package/pkg-cmake.mk define $(2)_CONFIGURE_CMDS · line 111

Quoted 12 lines
package/pkg-cmake.mk +4 -1
+endif
+
 #
 # Configure step. Only define it if not already defined by the package
 # .mk file. And take care of the differences between host and target
@@ -96,7 +107,8 @@ define $(2)_CONFIGURE_CMDS
 		-DBUILD_TEST=OFF \
 		-DBUILD_TESTS=OFF \
 		-DBUILD_TESTING=OFF \
-		-DBUILD_SHARED_LIBS=$$(if $$(BR2_STATIC_LIBS),OFF,ON) \
+		-DBUILD_SHARED_LIBS=$$(CMAKE_BUILD_SHARED_LIBS) \
+		-DBUILD_STATIC_LIBS=$$(CMAKE_BUILD_STATIC_LIBS) \

Indeed, you can just do:

		-DBUILD_SHARED_LIBS=$$(if $$(BR2_STATIC_LIBS),OFF,ON) \
		-DBUILD_STATIC_LIBS=$$(if $$(BR2_SHARED_LIBS),OFF,ON)

and that's it.

Quoted 5 lines
package/rabbitmq-c/rabbitmq-c.mk +0 -0
index eef09ec..5a34e53 100644

package/rabbitmq-c/rabbitmq-c.mk RABBITMQ_C_CONF_OPTS = \ · line 22

Quoted 10 lines
package/rabbitmq-c/rabbitmq-c.mk +0 -7
@@ -13,14 +13,6 @@ RABBITMQ_C_CONF_OPTS = \
 	-DBUILD_API_DOCS=OFF \
 	-DBUILD_TOOLS_DOCS=OFF
 
-ifeq ($(BR2_STATIC_LIBS),y)
-RABBITMQ_C_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON
-else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
-RABBITMQ_C_CONF_OPTS += -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON
-else ifeq ($(BR2_SHARED_LIBS),y)
-RABBITMQ_C_CONF_OPTS += -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
-endif

This should be part of a separate commit, since it's a simplification that follows the previous change.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
author
#3 lore raw

PATCH v4 2/2 opentracing-cpp: new package

In reply to Jan Heylen

From: Jan Heylen <[email protected]>

---
test-pkg passes

Changes v3 -> v4:
- remove shared/static switch in mk file as that is handled in pkg-cmake.mk now

Changes v2 -> v3:
- Fix another indendation typo
- Add DEVELOPERS file change
- Signoff opetracing-cpp patch
- run test-pkg and include various dependencies (toolchain bug & m68k cf)
- add comments in Config.in on the dependencies

Changes v1 -> v2:
- Fix indendation typo
- Add licence hash
- remove INTALL_TARGET=yes as that is default
---

 DEVELOPERS                                         |  3 +
 package/Config.in                                  |  1 +
 ...shared-static-target-a-configurable-optio.patch | 74 ++++++++++++++++++++++
 package/opentracing-cpp/Config.in                  | 16 +++++
 package/opentracing-cpp/opentracing-cpp.hash       |  3 +
 package/opentracing-cpp/opentracing-cpp.mk         | 14 ++++
 6 files changed, 111 insertions(+)
 create mode 100644 package/opentracing-cpp/0001-CMake-make-shared-static-target-a-configurable-optio.patch
 create mode 100644 package/opentracing-cpp/Config.in
 create mode 100644 package/opentracing-cpp/opentracing-cpp.hash
 create mode 100644 package/opentracing-cpp/opentracing-cpp.mk
DEVELOPERS +3 -0
index fe989c0..f17fcdd 100644
@@ -790,6 +790,9 @@ F:	package/pangomm/
 F:	package/rpm/
 F:	package/yad/
 
+N:	Jan Heylen <[email protected]>
+F:	package/opentracing-cpp/
+
 N:	Jan Kraval <[email protected]>
 F:	board/orangepi/orangepi-lite
 F:	configs/orangepi_lite_defconfig
package/Config.in +1 -0
index bd39a37..1150a3f 100644
@@ -1288,6 +1288,7 @@ menu "Logging"
 	source "package/log4cplus/Config.in"
 	source "package/log4cpp/Config.in"
 	source "package/log4cxx/Config.in"
+	source "package/opentracing-cpp/Config.in"
 	source "package/zlog/Config.in"
 endmenu
 
package/opentracing-cpp/0001-CMake-make-shared-static-target-a-configurable-optio.patch new file +74 -0

74 lines not on this page · raw message

package/opentracing-cpp/Config.in new file +16 -0
new file mode 100644
index 0000000..f13d21b
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_OPENTRACING_CPP
+	bool "opentracing-cpp"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # exception_ptr
+	depends on !BR2_m68k_cf # exception_ptr
+	help
+	  OpenTracing API for C++
+
+	  http://opentracing.io
+
+comment "opentracing-cpp needs a toolchain w/ C++11"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+
+comment "opentracing-cpp needs exception_ptr"
+	depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735 || BR2_m68k_cf
package/opentracing-cpp/opentracing-cpp.hash new file +3 -0
new file mode 100644
index 0000000..d25dbaf
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 c77041cb2f147ac81b2b0702abfced5565a9cebc318d045c060a4c3e074009ee opentracing-cpp-v1.2.0.tar.gz
+sha256 b80bffcfee825a69645f7ca97ddba48714031ea5c845198d184714d5490798b6 COPYING
package/opentracing-cpp/opentracing-cpp.mk new file +14 -0
new file mode 100644
index 0000000..f1748ef
@@ -0,0 +1,14 @@
+################################################################################
+#
+# opentracing-cpp
+#
+################################################################################
+
+OPENTRACING_CPP_VERSION = v1.2.0
+OPENTRACING_CPP_SITE = $(call github,opentracing,opentracing-cpp,$(OPENTRACING_CPP_VERSION))
+OPENTRACING_CPP_LICENSE = MIT
+OPENTRACING_CPP_LICENSE_FILES = COPYING
+
+OPENTRACING_CPP_INSTALL_STAGING = YES
+
+$(eval $(cmake-package))
Signature · 1 line
2.7.4
#4 lore raw

PATCH v4 2/2 opentracing-cpp: new package

Hello,

package/opentracing-cpp/Config.in line 6

Quoted 12 lines · Jan Heylen
package/opentracing-cpp/Config.in new file +6 -0
new file mode 100644
index 0000000..f13d21b
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_OPENTRACING_CPP
+	bool "opentracing-cpp"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # exception_ptr
+	depends on !BR2_m68k_cf # exception_ptr

So exception_ptr is not available on m68k coldfire, regardless of the gcc version ?

If so, we perhaps want to introduce something like:

config BR2_TOOLCHAIN_HAS_EXECPTION_PTR

	bool
	default y
	depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735
	depends on !BR2_m68k_cf

but please confirm first that there really is something special about m68k coldfire.

package/opentracing-cpp/Config.in line 12

Quoted 6 lines
package/opentracing-cpp/Config.in new file +6 -0
+	help
+	  OpenTracing API for C++
+
+	  http://opentracing.io
+
+comment "opentracing-cpp needs a toolchain w/ C++11"

This should be:

opentracing-cpp needs a toolchain w/ C++, gcc >= 4.8"

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
author
#5 lore raw

PATCH v4 2/2 opentracing-cpp: new package

Hello,

Quoted 22 lines · Thomas Petazzoni

Hello,

package/opentracing-cpp/Config.in line 6

Quoted 12 lines · Jan Heylen
package/opentracing-cpp/Config.in new file +6 -0
new file mode 100644
index 0000000..f13d21b
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_OPENTRACING_CPP
+     bool "opentracing-cpp"
+     depends on BR2_INSTALL_LIBSTDCPP
+     depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+     depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # exception_ptr
+     depends on !BR2_m68k_cf # exception_ptr

So exception_ptr is not available on m68k coldfire, regardless of the gcc version ?

If so, we perhaps want to introduce something like:

Quoted 8 lines

config BR2_TOOLCHAIN_HAS_EXECPTION_PTR

        bool
        default y
        depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735
        depends on !BR2_m68k_cf

but please confirm first that there really is something special about m68k coldfire.

Done by experiment, in V6 added BR2_m68k_cf to BR2_TOOLCHAIN_HAS_GCC_BUG_64735. See V6 op this patchset.

Quoted 11 lines

package/opentracing-cpp/Config.in line 12

Quoted 7 lines
package/opentracing-cpp/Config.in new file +6 -0
+     help
+       OpenTracing API for C++
+
+       http://opentracing.io
+
+comment "opentracing-cpp needs a toolchain w/ C++11"

This should be:

opentracing-cpp needs a toolchain w/ C++, gcc >= 4.8"

Done in V6.

Quoted 8 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com