Skip to content

Commit 22f22bb

Browse files
committed
rsyslog: make libyaml support optional via RSYSLOG_libyaml
The upstream rsyslog build links against libyaml-0.so.2 whenever pkg-config detects yaml-0.1, which made libyaml a hard dependency of the rsyslog binary without any way to opt out from OpenWrt config. libyaml is only used for YAML (.yaml/.yml) configuration files and for loading rate-limiting policies from external files; RainerScript (.conf) installs do not need it. Introduce a new RSYSLOG_libyaml Config.in switch, default off, and gate the +libyaml DEPENDS entry on it. Pass --enable-libyaml or --disable-libyaml to configure based on the switch. The upstream configure script in 8.2604.0 does not understand a --disable-libyaml flag (libyaml was unconditionally autodetected). Backport upstream commit c5c244861 ("configure: make libyaml default-on explicit") as 001-configure-make-libyaml-default-on- explicit.patch, which adds the AC_ARG_ENABLE(libyaml) block. The patch dissolves cleanly once the package is bumped to 8.2606.0+. PKG_FIXUP:=autoreconf is added so the configure.ac change flows into the generated configure script during the SDK build. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
1 parent 94c808d commit 22f22bb

3 files changed

Lines changed: 70 additions & 2 deletions

File tree

admin/rsyslog/Config.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
if PACKAGE_rsyslog
2+
config RSYSLOG_libyaml
3+
bool "Enable libyaml support (YAML config + file-based rate-limit policies)"
4+
default n
5+
help
6+
Enable libyaml support in rsyslog. Required to load YAML
7+
(.yaml/.yml) configuration files and to load rate-limiting
8+
policies from external files. Disable to drop the libyaml
9+
runtime dependency (~50KB).
210
config RSYSLOG_gssapi_krb5
311
bool "Enable GSSAPI Kerberos 5 support"
412
default n

admin/rsyslog/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=rsyslog
1111
PKG_VERSION:=8.2604.0
12-
PKG_RELEASE:=1
12+
PKG_RELEASE:=2
1313

1414
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
1515
PKG_SOURCE_URL:= \
@@ -22,6 +22,7 @@ PKG_LICENSE:=GPL-3.0-or-later
2222
PKG_LICENSE_FILES:=COPYING
2323
PKG_CPE_ID:=cpe:/a:rsyslog:rsyslog
2424

25+
PKG_FIXUP:=autoreconf
2526
PKG_INSTALL:=1
2627
PKG_BUILD_PARALLEL:=1
2728

@@ -37,7 +38,7 @@ define Package/rsyslog
3738
+RSYSLOG_libdbi:libdbi +libestr +libfastjson +RSYSLOG_gnutls:libgnutls \
3839
+RSYSLOG_mmdblookup:libmaxminddb +RSYSLOG_mysql:libmysqlclient \
3940
+RSYSLOG_omhttp:libcurl +RSYSLOG_openssl:libopenssl \
40-
+RSYSLOG_pgsql:libpq +libuuid +zlib
41+
+RSYSLOG_pgsql:libpq +RSYSLOG_libyaml:libyaml +libuuid +zlib
4142
MENU:=1
4243
endef
4344

@@ -51,6 +52,7 @@ CONFIGURE_ARGS+= \
5152
--disable-default-tests \
5253
--disable-libsystemd \
5354
--disable-impstats-push \
55+
$(if $(CONFIG_RSYSLOG_libyaml),--enable-libyaml,--disable-libyaml) \
5456
$(if $(CONFIG_RSYSLOG_gssapi_krb5),--enable-gssapi-krb5) \
5557
$(if $(CONFIG_RSYSLOG_mysql),--enable-mysql) \
5658
$(if $(CONFIG_RSYSLOG_pgsql),--enable-pgsql) \
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
From c5c2448617e72d088e818a5581a8a6cc85e81963 Mon Sep 17 00:00:00 2001
2+
From: Rainer Gerhards <rgerhards@adiscon.com>
3+
Date: Sat, 16 May 2026 10:44:45 +0200
4+
Subject: [PATCH] configure: make libyaml default-on explicit
5+
6+
Why: Distro builds must not silently change rsyslog features based
7+
on whether libyaml development files happen to be installed.
8+
9+
Impact: Default builds now require yaml-0.1 unless --disable-libyaml
10+
is passed explicitly.
11+
12+
Before/After: Before, configure auto-disabled libyaml features;
13+
after, the default fails fast and opt-out builds are explicit.
14+
15+
Closes https://github.com/rsyslog/rsyslog/issues/6914
16+
17+
Upstream-Status: Backport [v8.2604.0 -> 8.2606.0]
18+
Upstream-Commit: c5c2448617e72d088e818a5581a8a6cc85e81963
19+
---
20+
configure.ac | 21 ++++++++++++++++-----
21+
1 file changed, 17 insertions(+), 4 deletions(-)
22+
23+
--- a/configure.ac
24+
+++ b/configure.ac
25+
@@ -166,13 +166,26 @@
26+
)
27+
28+
# Checks for libraries.
29+
-PKG_CHECK_MODULES([LIBYAML], [yaml-0.1], [
30+
- AC_DEFINE([HAVE_LIBYAML], [1], [Define if libyaml is available])
31+
- have_libyaml=yes
32+
-], [
33+
- AC_MSG_WARN([libyaml not found, rate limiting policies from files and YAML configuration support will be disabled])
34+
- have_libyaml=no
35+
-])
36+
+AC_ARG_ENABLE(libyaml,
37+
+ [AS_HELP_STRING([--disable-libyaml],
38+
+ [Disable libyaml-backed YAML configuration and policy file support @<:@default=enabled@:>@])],
39+
+ [case "${enableval}" in
40+
+ yes) enable_libyaml="yes" ;;
41+
+ no) enable_libyaml="no" ;;
42+
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-libyaml) ;;
43+
+ esac],
44+
+ [enable_libyaml="yes"]
45+
+)
46+
+AS_IF([test "x$enable_libyaml" = "xyes"], [
47+
+ PKG_CHECK_MODULES([LIBYAML], [yaml-0.1], [
48+
+ AC_DEFINE([HAVE_LIBYAML], [1], [Define if libyaml is available])
49+
+ have_libyaml=yes
50+
+ ], [
51+
+ AC_MSG_ERROR([libyaml support is enabled by default but yaml-0.1 was not found. Install libyaml development files or configure with --disable-libyaml.])
52+
+ ])
53+
+], [
54+
+ have_libyaml=no
55+
+])
56+
AM_CONDITIONAL(HAVE_LIBYAML, test x$have_libyaml = xyes)
57+
AC_MSG_NOTICE([YAML configuration support: $have_libyaml])
58+
save_LIBS=$LIBS

0 commit comments

Comments
 (0)