Skip to contentSkip to conversation

package/jimtcl: install pkg-config file

PATCH Applied Yegor Yefremov 2 participants 7 messages Oct 24 – Oct 30

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 package/jimtcl: install pkg-config file

Install jimtcl.pc to staging, so that packages can use pkg-config to find jimtcl. This is especially needed for static linking, as jimtcl lists the libraries it links against (e.g. openssl and zlib) in Libs.private.

Assisted-by Claude:claude-opus-5-5
---
 package/jimtcl/jimtcl.mk | 2 ++
 1 file changed, 2 insertions(+)
package/jimtcl/jimtcl.mk +2 -0
index f2d59265ad..5e09e776ad 100644
@@ -71,6 +71,8 @@ define JIMTCL_INSTALL_STAGING_CMDS
 		cp -a $(@D)/$$i $(STAGING_DIR)/usr/include/ || exit 1 ; \
 	done; \
 	$(call JIMTCL_INSTALL_LIB,$(STAGING_DIR))
+	$(INSTALL) -m 0644 -D $(@D)/jimtcl.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/jimtcl.pc
 endef
 
 define JIMTCL_INSTALL_TARGET_CMDS
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 3/3 package/jimtcl: fix optional openssl and zlib dependencies

Since jimtcl 0.83, the "full" configuration is the default, so jimtcl automatically enables ssl support in the aio extension and the zlib extension when openssl and zlib are found. As these dependencies are not declared, the result depends on whether openssl and zlib happen to be built before jimtcl.

Add them to the dependencies when they are enabled (with host-pkgconf, which jimtcl uses to find them), and otherwise pass --disable-ssl and --without-ext=zlib.

This issue has been present since commit 283821fc31c4 ("package/jimtcl:
bump to version 0.83"), as jimtcl 0.83 made its optional features enabled by default. It therefore affects 2025.11 and later.

Fixes 283821fc31c4890f141111cbc5994e36703c91eb ("package/jimtcl: bump to version 0.83")
Assisted-by Claude:claude-opus-5-5
---
 package/jimtcl/jimtcl.mk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
package/jimtcl/jimtcl.mk +15 -0
index 5e09e776ad..e81b2a250d 100644
@@ -24,6 +24,20 @@ define JIMTCL_LINK_TCLSH
 endef
 endif
 
+# jimtcl automatically enables ssl support in the aio extension and
+# the zlib extension when the libraries are found
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+JIMTCL_DEPENDENCIES += host-pkgconf openssl
+else
+JIMTCL_CONF_OPTS += --disable-ssl
+endif
+
+ifeq ($(BR2_PACKAGE_ZLIB),y)
+JIMTCL_DEPENDENCIES += host-pkgconf zlib
+else
+JIMTCL_CONF_OPTS += --without-ext=zlib
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 define JIMTCL_INSTALL_LIB
 	$(INSTALL) -m 0644 -D $(@D)/libjim.a $(1)/usr/lib/libjim.a
@@ -55,6 +69,7 @@ define JIMTCL_CONFIGURE_CMDS
 		--host=$(GNU_TARGET_NAME) \
 		--build=$(GNU_HOST_NAME) \
 		$(JIMTCL_SHARED) \
+		$(JIMTCL_CONF_OPTS) \
 	)
 endef
 
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 3/3] package/jimtcl: fix optional openssl and zlib dependencies

In reply of:

Quoted 10 lines

Since jimtcl 0.83, the "full" configuration is the default, so jimtcl automatically enables ssl support in the aio extension and the zlib extension when openssl and zlib are found. As these dependencies are not declared, the result depends on whether openssl and zlib happen to be built before jimtcl.

Add them to the dependencies when they are enabled (with host-pkgconf, which jimtcl uses to find them), and otherwise pass --disable-ssl and --without-ext=zlib.

Quoted 7 lines

This issue has been present since commit 283821fc31c4 ("package/jimtcl:
bump to version 0.83"), as jimtcl 0.83 made its optional features enabled by default. It therefore affects 2025.11 and later.

Fixes 283821fc31c4890f141111cbc5994e36703c91eb ("package/jimtcl: bump to version 0.83")
Assisted-by Claude:claude-opus-5-5

Applied to 2026.08.x. Thanks

Quoted 30 lines
---
 package/jimtcl/jimtcl.mk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
package/jimtcl/jimtcl.mk +14 -0
index 5e09e776ad..e81b2a250d 100644
@@ -24,6 +24,20 @@ define JIMTCL_LINK_TCLSH
 endef
 endif
 
+# jimtcl automatically enables ssl support in the aio extension and
+# the zlib extension when the libraries are found
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+JIMTCL_DEPENDENCIES += host-pkgconf openssl
+else
+JIMTCL_CONF_OPTS += --disable-ssl
+endif
+
+ifeq ($(BR2_PACKAGE_ZLIB),y)
+JIMTCL_DEPENDENCIES += host-pkgconf zlib
+else
+JIMTCL_CONF_OPTS += --without-ext=zlib
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 define JIMTCL_INSTALL_LIB
 	$(INSTALL) -m 0644 -D $(@D)/libjim.a $(1)/usr/lib/libjim.a

package/jimtcl/jimtcl.mk define JIMTCL_CONFIGURE_CMDS · line 75

Quoted 7 lines
package/jimtcl/jimtcl.mk +1 -0
@@ -55,6 +69,7 @@ define JIMTCL_CONFIGURE_CMDS
 		--host=$(GNU_TARGET_NAME) \
 		--build=$(GNU_HOST_NAME) \
 		$(JIMTCL_SHARED) \
+		$(JIMTCL_CONF_OPTS) \
 	)
 endef
 

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

PATCH 2/3 package/openocd: fix static build with jimtcl

In reply to Yegor Yefremov

Since jimtcl 0.83, jimtcl enables ssl support in the aio extension and the zlib extension when openssl and zlib are found. With BR2_STATIC_LIBS, openocd then fails to link, as it only uses -ljim to link against libjim.a:

jim-aio.c:(.text+0x16f4): undefined reference to `SSL_set_fd' [...]
jim-zlib.c:(.text+0x11c): undefined reference to `deflateInit2_'

Backport an upstream commit making openocd use pkg-config to find jimtcl, which adds the libraries from Libs.private when linking statically. This requires the jimtcl.pc file installed by the previous commit.

This issue has been present since commit 283821fc31c4 ("package/jimtcl:
bump to version 0.83"), as jimtcl 0.83 made its optional features enabled by default. It therefore affects 2025.11 and later.

Fixes:
https://autobuild.buildroot.org/results/6436c7c81cda5eeb8331f18d40f33f4bf1dadd79

Fixes 283821fc31c4890f141111cbc5994e36703c91eb ("package/jimtcl: bump to version 0.83")
Assisted-by Claude:claude-opus-5-5
---
 ...-configure-Use-pkg-config-for-jimtcl.patch | 83 +++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 package/openocd/0004-configure-Use-pkg-config-for-jimtcl.patch
package/openocd/0004-configure-Use-pkg-config-for-jimtcl.patch new file +83 -0
new file mode 100644
index 0000000000..65f0f9424b
@@ -0,0 +1,83 @@
+From a8a0b4c50768fb8bbcbd1683d020a31ad2bb0cad Mon Sep 17 00:00:00 2001
+From: Marc Schink <[email protected]>
+Date: Tue, 2 Jul 2024 17:14:22 +0200
+Subject: [PATCH] configure: Use pkg-config for jimtcl
+
+The jimtcl project supports pkg-config, use it for a simpler
+configuration of compiler and linker flags and to enforce the minimum
+required package version.
+
+Since the jimtcl pkg-config file is not available on all systems, use
+AC_CHECK_HEADER() as fallback.
+
+Change-Id: I6fdcc818a8fdd205a126b0a46356434dbe890226
+Upstream: https://github.com/openocd-org/openocd/commit/a8a0b4c50768fb8bbcbd1683d020a31ad2bb0cad
+Signed-off-by: Marc Schink <[email protected]>
+Reviewed-on: https://review.openocd.org/c/openocd/+/8383
+Reviewed-by: Antonio Borneo <[email protected]>
+Tested-by: jenkins
+Signed-off-by: Yegor Yefremov <[email protected]>
+---
+ Makefile.am     |  2 ++
+ configure.ac    | 10 ++++++++++
+ src/Makefile.am |  4 ++++
+ 3 files changed, 16 insertions(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index 647b571cfa..2230e628f8 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -48,6 +48,8 @@ AM_CPPFLAGS = $(HOST_CPPFLAGS)\
+ if INTERNAL_JIMTCL
+ AM_CPPFLAGS += -I$(top_srcdir)/jimtcl \
+ 			   -I$(top_builddir)/jimtcl
++else
++AM_CPPFLAGS += $(JIMTCL_CFLAGS)
+ endif
+ EXTRA_DIST += \
+ 	BUGS \
+diff --git a/configure.ac b/configure.ac
+index becc531b0d..b7aed245e6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -594,6 +594,15 @@ AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
+   ], [
+     AC_MSG_ERROR([jimtcl not found, run git submodule init and git submodule update.])
+   ])
++], [
++  PKG_CHECK_MODULES([JIMTCL], [jimtcl >= 0.79], [
++      have_jimtcl_pkg_config=yes
++    ], [
++      have_jimtcl_pkg_config=no
++      AC_CHECK_HEADER([jim.h], [], [
++        AC_MSG_ERROR([jimtcl is required but not found via pkg-config and system includes])
++      ])
++  ])
+ ])
+ 
+ AS_IF([test "x$build_remote_bitbang" = "xyes"], [
+@@ -781,6 +790,7 @@ AM_CONDITIONAL([DMEM], [test "x$build_dmem" = "xyes"])
+ AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$enable_capstone" != "xno"])
+ 
+ AM_CONDITIONAL([INTERNAL_JIMTCL], [test "x$use_internal_jimtcl" = "xyes"])
++AM_CONDITIONAL([HAVE_JIMTCL_PKG_CONFIG], [test "x$have_jimtcl_pkg_config" = "xyes"])
+ AM_CONDITIONAL([INTERNAL_LIBJAYLINK], [test "x$use_internal_libjaylink" = "xyes"])
+ 
+ # Look for environ alternatives.  Possibility #1: is environ in unistd.h or stdlib.h?
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 6d79cd6311..4d1c1a2509 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -17,8 +17,12 @@ bin_PROGRAMS += %D%/openocd
+ if INTERNAL_JIMTCL
+ %C%_openocd_LDADD += $(top_builddir)/jimtcl/libjim.a
+ else
++if HAVE_JIMTCL_PKG_CONFIG
++%C%_openocd_LDADD += $(JIMTCL_LIBS)
++else
+ %C%_openocd_LDADD += -ljim
+ endif
++endif
+ 
+ %C%_libopenocd_la_CPPFLAGS =
+ 
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Re: [Buildroot] [PATCH 2/3] package/openocd: fix static build with jimtcl

In reply of:

Quoted 18 lines

Since jimtcl 0.83, jimtcl enables ssl support in the aio extension and the zlib extension when openssl and zlib are found. With BR2_STATIC_LIBS, openocd then fails to link, as it only uses -ljim to link against libjim.a:

jim-aio.c:(.text+0x16f4): undefined reference to `SSL_set_fd' [...]
jim-zlib.c:(.text+0x11c): undefined reference to `deflateInit2_'

Backport an upstream commit making openocd use pkg-config to find jimtcl, which adds the libraries from Libs.private when linking statically. This requires the jimtcl.pc file installed by the previous commit.

This issue has been present since commit 283821fc31c4 ("package/jimtcl:
bump to version 0.83"), as jimtcl 0.83 made its optional features enabled by default. It therefore affects 2025.11 and later.

Quoted 6 lines

Fixes:
https://autobuild.buildroot.org/results/6436c7c81cda5eeb8331f18d40f33f4bf1dadd79

Fixes 283821fc31c4890f141111cbc5994e36703c91eb ("package/jimtcl: bump to version 0.83")
Assisted-by Claude:claude-opus-5-5

Applied to 2026.08.x. Thanks

Quoted 84 lines
---
 ...-configure-Use-pkg-config-for-jimtcl.patch | 83 +++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 package/openocd/0004-configure-Use-pkg-config-for-jimtcl.patch
package/openocd/0004-configure-Use-pkg-config-for-jimtcl.patch new file +73 -0
new file mode 100644
index 0000000000..65f0f9424b
@@ -0,0 +1,83 @@
+From a8a0b4c50768fb8bbcbd1683d020a31ad2bb0cad Mon Sep 17 00:00:00 2001
+From: Marc Schink <[email protected]>
+Date: Tue, 2 Jul 2024 17:14:22 +0200
+Subject: [PATCH] configure: Use pkg-config for jimtcl
+
+The jimtcl project supports pkg-config, use it for a simpler
+configuration of compiler and linker flags and to enforce the minimum
+required package version.
+
+Since the jimtcl pkg-config file is not available on all systems, use
+AC_CHECK_HEADER() as fallback.
+
+Change-Id: I6fdcc818a8fdd205a126b0a46356434dbe890226
+Upstream: https://github.com/openocd-org/openocd/commit/a8a0b4c50768fb8bbcbd1683d020a31ad2bb0cad
+Signed-off-by: Marc Schink <[email protected]>
+Reviewed-on: https://review.openocd.org/c/openocd/+/8383
+Reviewed-by: Antonio Borneo <[email protected]>
+Tested-by: jenkins
+Signed-off-by: Yegor Yefremov <[email protected]>
+---
+ Makefile.am     |  2 ++
+ configure.ac    | 10 ++++++++++
+ src/Makefile.am |  4 ++++
+ 3 files changed, 16 insertions(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index 647b571cfa..2230e628f8 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -48,6 +48,8 @@ AM_CPPFLAGS = $(HOST_CPPFLAGS)\
+ if INTERNAL_JIMTCL
+ AM_CPPFLAGS += -I$(top_srcdir)/jimtcl \
+ 			   -I$(top_builddir)/jimtcl
++else
++AM_CPPFLAGS += $(JIMTCL_CFLAGS)
+ endif
+ EXTRA_DIST += \
+ 	BUGS \
+diff --git a/configure.ac b/configure.ac
+index becc531b0d..b7aed245e6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -594,6 +594,15 @@ AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
+   ], [
+     AC_MSG_ERROR([jimtcl not found, run git submodule init and git submodule update.])
+   ])
++], [
++  PKG_CHECK_MODULES([JIMTCL], [jimtcl >= 0.79], [
++      have_jimtcl_pkg_config=yes
++    ], [
++      have_jimtcl_pkg_config=no
++      AC_CHECK_HEADER([jim.h], [], [
++        AC_MSG_ERROR([jimtcl is required but not found via pkg-config and system includes])
++      ])
++  ])
+ ])
+ 
+ AS_IF([test "x$build_remote_bitbang" = "xyes"], [
+@@ -781,6 +790,7 @@ AM_CONDITIONAL([DMEM], [test "x$build_dmem" = "xyes"])
+ AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$enable_capstone" != "xno"])
+ 
+ AM_CONDITIONAL([INTERNAL_JIMTCL], [test "x$use_internal_jimtcl" = "xyes"])
++AM_CONDITIONAL([HAVE_JIMTCL_PKG_CONFIG], [test "x$have_jimtcl_pkg_config" = "xyes"])
+ AM_CONDITIONAL([INTERNAL_LIBJAYLINK], [test "x$use_internal_libjaylink" = "xyes"])
+ 
+ # Look for environ alternatives.  Possibility #1: is environ in unistd.h or stdlib.h?
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 6d79cd6311..4d1c1a2509 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -17,8 +17,12 @@ bin_PROGRAMS += %D%/openocd
+ if INTERNAL_JIMTCL
+ %C%_openocd_LDADD += $(top_builddir)/jimtcl/libjim.a

package/openocd/0004-configure-Use-pkg-config-for-jimtcl.patch line 83

Quoted 10 lines
package/openocd/0004-configure-Use-pkg-config-for-jimtcl.patch new file +10 -0
+ else
++if HAVE_JIMTCL_PKG_CONFIG
++%C%_openocd_LDADD += $(JIMTCL_LIBS)
++else
+ %C%_openocd_LDADD += -ljim
+ endif
++endif
+ 
+ %C%_libopenocd_la_CPPFLAGS =
+ 

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw
In reply to Yegor Yefremov
Quoted 7 lines · Yegor Yefremov

Install jimtcl.pc to staging, so that packages can use pkg-config to find jimtcl. This is especially needed for static linking, as jimtcl lists the libraries it links against (e.g. openssl and zlib) in Libs.private.

Assisted-by Claude:claude-opus-5-5

Series applied, thanks!

Best regards,

Thomas Petazzoni

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw
In reply to Yegor Yefremov

In reply of:

Quoted 7 lines

Install jimtcl.pc to staging, so that packages can use pkg-config to find jimtcl. This is especially needed for static linking, as jimtcl lists the libraries it links against (e.g. openssl and zlib) in Libs.private.

Assisted-by Claude:claude-opus-5-5

Applied to 2025.02.x, 2026.08.x. Thanks

Quoted 9 lines
---
 package/jimtcl/jimtcl.mk | 2 ++
 1 file changed, 2 insertions(+)
package/jimtcl/jimtcl.mk +0 -0
index f2d59265ad..5e09e776ad 100644

package/jimtcl/jimtcl.mk define JIMTCL_INSTALL_STAGING_CMDS · line 78

Quoted 8 lines
package/jimtcl/jimtcl.mk +2 -0
@@ -71,6 +71,8 @@ define JIMTCL_INSTALL_STAGING_CMDS
 		cp -a $(@D)/$$i $(STAGING_DIR)/usr/include/ || exit 1 ; \
 	done; \
 	$(call JIMTCL_INSTALL_LIB,$(STAGING_DIR))
+	$(INSTALL) -m 0644 -D $(@D)/jimtcl.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/jimtcl.pc
 endef
 
 define JIMTCL_INSTALL_TARGET_CMDS

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot