Skip to contentSkip to conversation

package/syslog-ng: add optional rabbitmq-c dependency

PATCH New Fabrice Fontaine 4 participants 6 messages Feb 18, 2019 – Feb 21, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/syslog-ng: add optional rabbitmq-c dependency

rabbitmq-c is not an embedded submodule since version 3.16.1 and
https://github.com/balabit/syslog-ng/commit/c0559593c377f04662368dbecf282d2670aad12f

So enable/disable amqp depending on rabbitmq-c availability and remove uneeded -lrt from LIBS

---
 package/syslog-ng/syslog-ng.mk | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
package/syslog-ng/syslog-ng.mk +7 -2
index 0c92b091b4..4ac25a675b 100644
@@ -14,8 +14,6 @@ SYSLOG_NG_DEPENDENCIES = host-bison host-flex host-pkgconf \
 	eventlog libglib2 openssl pcre
 # We're patching configure.ac
 SYSLOG_NG_AUTORECONF = YES
-# rabbit-mq needs -lrt
-SYSLOG_NG_CONF_ENV = LIBS=-lrt
 SYSLOG_NG_CONF_OPTS = --disable-manpages --localstatedir=/var/run \
 	--disable-java --disable-java-modules --disable-mongodb
 
@@ -83,6 +81,13 @@ else
 SYSLOG_NG_CONF_OPTS += --disable-http
 endif
 
+ifeq ($(BR2_PACKAGE_RABBITMQ_C),y)
+SYSLOG_NG_DEPENDENCIES += rabbitmq-c
+SYSLOG_NG_CONF_OPTS += --enable-amqp
+else
+SYSLOG_NG_CONF_OPTS += --disable-amqp
+endif
+
 ifeq ($(BR2_INIT_SYSTEMD),y)
 SYSLOG_NG_DEPENDENCIES += systemd
 SYSLOG_NG_CONF_OPTS += \
Signature · 1 line
2.14.1
#1 lore raw

PATCH 2/2 package/rabbitmq-c: needs dynamic library

syslog-ng expects that rabbitmq-c is built with openssl support however currently we're disabling openssl on rabbitmq-c in static build.

To fix this issue, add a dependency on dynamic library on rabbitmq-c and its reverse dependencies (only BR2_PACKAGE_JANUS_GATEWAY_RABBITMQ as php-amqp already depends on dynamic library)

Fixes:
- http://autobuild.buildroot.org/results/fce91b98fb199a26ad5f5f726c9bdec4f9d64486

---
 package/janus-gateway/Config.in  |  5 +++--
 package/rabbitmq-c/Config.in     |  5 +++--
 package/rabbitmq-c/rabbitmq-c.mk | 14 +++-----------
 3 files changed, 9 insertions(+), 15 deletions(-)
package/janus-gateway/Config.in +3 -2
index dc8fad067e..8688984aa4 100644
@@ -67,11 +67,12 @@ comment "MQTT transport needs a toolchain w/ threads and dynamic library support
 
 config BR2_PACKAGE_JANUS_GATEWAY_RABBITMQ
 	bool "RabbitMQ"
+	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	select BR2_PACKAGE_RABBITMQ_C
 
-comment "RabbitMQ transport needs a toolchain w/ threads"
-	depends on !BR2_TOOLCHAIN_HAS_THREADS
+comment "RabbitMQ transport needs a toolchain w/ dynamic library, threads"
+	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
 
 config BR2_PACKAGE_JANUS_GATEWAY_REST
 	bool "REST (HTTP/HTTPS)"
package/rabbitmq-c/Config.in +3 -2
index b330c90474..6dbd1467cb 100644
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_RABBITMQ_C
 	bool "rabbitmq-c"
+	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	help
 	  This is a C-language AMQP client library for use with v2.0+
@@ -7,5 +8,5 @@ config BR2_PACKAGE_RABBITMQ_C
 
 	  https://github.com/alanxz/rabbitmq-c
 
-comment "rabbitmq-c needs a toolchain w/ threads"
-	depends on !BR2_TOOLCHAIN_HAS_THREADS
+comment "rabbitmq-c needs a toolchain w/ dynamic library, threads"
+	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
package/rabbitmq-c/rabbitmq-c.mk +3 -11
index a3c4f8219f..6385ccb6b6 100644
@@ -19,28 +19,20 @@ RABBITMQ_C_CONF_OPTS = \
 RABBITMQ_C_CONF_OPTS += -DTHREADS_PTHREAD_ARG=OFF
 
 # BUILD_SHARED_LIBS is handled in pkg-cmake.mk as it is a generic cmake variable
-ifeq ($(BR2_STATIC_LIBS),y)
-RABBITMQ_C_CONF_OPTS += -DBUILD_STATIC_LIBS=ON
-else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
+ifeq ($(BR2_SHARED_STATIC_LIBS),y)
 RABBITMQ_C_CONF_OPTS += -DBUILD_STATIC_LIBS=ON
 else ifeq ($(BR2_SHARED_LIBS),y)
 RABBITMQ_C_CONF_OPTS += -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.
-ifeq ($(BR2_PACKAGE_OPENSSL):$(BR2_STATIC_LIBS),y:)
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
 RABBITMQ_C_CONF_OPTS += -DENABLE_SSL_SUPPORT=ON
 RABBITMQ_C_DEPENDENCIES += openssl
 else
 RABBITMQ_C_CONF_OPTS += -DENABLE_SSL_SUPPORT=OFF
 endif
 
-# Popt is sometimes linked against libintl, but CMake doesn't know
-# about that, and there's no way to tell manually CMake to link
-# against an additional library.
-ifeq ($(BR2_PACKAGE_POPT):$(BR2_STATIC_LIBS),y:)
+ifeq ($(BR2_PACKAGE_POPT),y)
 RABBITMQ_C_CONF_OPTS += -DBUILD_TOOLS=ON
 RABBITMQ_C_DEPENDENCIES += popt
 else
Signature · 1 line
2.14.1
#2 lore raw

PATCH 2/2 package/rabbitmq-c: needs dynamic library

Quoted 6 lines · Fabrice Fontaine

syslog-ng expects that rabbitmq-c is built with openssl support however currently we're disabling openssl on rabbitmq-c in static build.

To fix this issue, add a dependency on dynamic library on rabbitmq-c and its reverse dependencies (only BR2_PACKAGE_JANUS_GATEWAY_RABBITMQ as php-amqp already depends on dynamic library)

Actually, janus-gateway also depends on !STATIC already. But the other
transports have the !STATIC dependeny explicitly again, so it makes sense to add it for rabbitmq too.

Note that this patch essentially reverts Thomas' attempt to fix static build in
beb6524225f, almost two years ago. I expect Thomas was just fixing autobuild results and doesn't actually need a statically linked rabbitmq.

Note also that the CMake bug report [1] has seen no progress since then.

Therefore, applied to master, thanks.

Regards,
Arnout

[1] https://gitlab.kitware.com/cmake/cmake/issues/16885.

Quoted 5 lines

Fixes:
- http://autobuild.buildroot.org/results/fce91b98fb199a26ad5f5f726c9bdec4f9d64486

#3 lore raw

PATCH 2/2 package/rabbitmq-c: needs dynamic library

Hello,

Quoted 3 lines · On Wed, 20 Feb 2019 23:39:59 +0100 Arnout Vandecappelle <[email protected]> wrote:

Note that this patch essentially reverts Thomas' attempt to fix static build in
beb6524225f, almost two years ago. I expect Thomas was just fixing autobuild results and doesn't actually need a statically linked rabbitmq.

I can confirm that I don't care about rabbitmq static linking support.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/2 package/syslog-ng: add optional rabbitmq-c dependency

In reply to Fabrice Fontaine
Quoted 9 lines · On Tue, 19 Feb 2019 00:45 Fabrice Fontaine <[email protected] wrote:

rabbitmq-c is not an embedded submodule since version 3.16.1 and

https://github.com/balabit/syslog-ng/commit/c0559593c377f04662368dbecf282d2670aad12f

So enable/disable amqp depending on rabbitmq-c availability and remove uneeded -lrt from LIBS

Looks good to me

---

Quoted 33 lines
 package/syslog-ng/syslog-ng.mk | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
package/syslog-ng/ renamed from package/syslog-ng/syslog-ng.mk +0 -0

syslog-ng.mk
index 0c92b091b4..4ac25a675b 100644

package/syslog-ng/syslog-ng.mk +7 -3
@@ -14,8 +14,6 @@ SYSLOG_NG_DEPENDENCIES = host-bison host-flex
 host-pkgconf \
        eventlog libglib2 openssl pcre
 # We're patching configure.ac
 SYSLOG_NG_AUTORECONF = YES
-# rabbit-mq needs -lrt
-SYSLOG_NG_CONF_ENV = LIBS=-lrt
 SYSLOG_NG_CONF_OPTS = --disable-manpages --localstatedir=/var/run \
        --disable-java --disable-java-modules --disable-mongodb
@@ -83,6 +81,13 @@ else
 SYSLOG_NG_CONF_OPTS += --disable-http
 endif
 
+ifeq ($(BR2_PACKAGE_RABBITMQ_C),y)
+SYSLOG_NG_DEPENDENCIES += rabbitmq-c
+SYSLOG_NG_CONF_OPTS += --enable-amqp
+else
+SYSLOG_NG_CONF_OPTS += --disable-amqp
+endif
+
 ifeq ($(BR2_INIT_SYSTEMD),y)
 SYSLOG_NG_DEPENDENCIES += systemd
 SYSLOG_NG_CONF_OPTS += \
--
Quoted 3 lines

2.14.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190219/f05d83aa/attachment.html>

#5 lore raw

PATCH 1/2 package/syslog-ng: add optional rabbitmq-c dependency

In reply to Fabrice Fontaine
Quoted 5 lines · Fabrice Fontaine

rabbitmq-c is not an embedded submodule since version 3.16.1 and
https://github.com/balabit/syslog-ng/commit/c0559593c377f04662368dbecf282d2670aad12f

So enable/disable amqp depending on rabbitmq-c availability and remove uneeded -lrt from LIBS

Applied to master, thanks.

Indeed, since the recent bump to 3.19.1, we "randomly" build with/without amqp
depending on whether rabbitmq-c was built before or not.

Regards,
Arnout

Quoted 34 lines
---
 package/syslog-ng/syslog-ng.mk | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
package/syslog-ng/syslog-ng.mk +7 -2
index 0c92b091b4..4ac25a675b 100644
@@ -14,8 +14,6 @@ SYSLOG_NG_DEPENDENCIES = host-bison host-flex host-pkgconf \
 	eventlog libglib2 openssl pcre
 # We're patching configure.ac
 SYSLOG_NG_AUTORECONF = YES
-# rabbit-mq needs -lrt
-SYSLOG_NG_CONF_ENV = LIBS=-lrt
 SYSLOG_NG_CONF_OPTS = --disable-manpages --localstatedir=/var/run \
 	--disable-java --disable-java-modules --disable-mongodb
 
@@ -83,6 +81,13 @@ else
 SYSLOG_NG_CONF_OPTS += --disable-http
 endif
 
+ifeq ($(BR2_PACKAGE_RABBITMQ_C),y)
+SYSLOG_NG_DEPENDENCIES += rabbitmq-c
+SYSLOG_NG_CONF_OPTS += --enable-amqp
+else
+SYSLOG_NG_CONF_OPTS += --disable-amqp
+endif
+
 ifeq ($(BR2_INIT_SYSTEMD),y)
 SYSLOG_NG_DEPENDENCIES += systemd
 SYSLOG_NG_CONF_OPTS += \