From: openocd-gerrit <ope...@us...> - 2024-08-02 15:59:36
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via a8a0b4c50768fb8bbcbd1683d020a31ad2bb0cad (commit) from 16c114c05891509054079e8d5d82905f1690a7a8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a8a0b4c50768fb8bbcbd1683d020a31ad2bb0cad Author: Marc Schink <de...@za...> Date: Tue Jul 2 17:14:22 2024 +0200 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 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/8383 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/Makefile.am b/Makefile.am index 647b571cf..2230e628f 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 becc531b0..b7aed245e 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 6d79cd631..4d1c1a250 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 = ----------------------------------------------------------------------- Summary of changes: Makefile.am | 2 ++ configure.ac | 10 ++++++++++ src/Makefile.am | 4 ++++ 3 files changed, 16 insertions(+) hooks/post-receive -- Main OpenOCD repository |