* [PATCH BlueZ] build: use pkg-config to find readline
@ 2025-07-03 18:29 Alyssa Ross
2025-07-03 20:01 ` [BlueZ] " bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Alyssa Ross @ 2025-07-03 18:29 UTC (permalink / raw)
To: linux-bluetooth
Hardcoding -lreadline won't do the right thing when other libraries
need to be linked too, which is the case when static linking.
pkg-config can take care of finding the right libraries for us, so use
it instead of checking for headers.
---
Makefile.tools | 18 +++++++++---------
configure.ac | 3 +--
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/Makefile.tools b/Makefile.tools
index e60c31b1d..6d7fcffa1 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -18,7 +18,7 @@ client_bluetoothctl_SOURCES = client/main.c \
client/hci.h client/hci.c
client_bluetoothctl_LDADD = lib/libbluetooth-internal.la \
gdbus/libgdbus-internal.la src/libshared-glib.la \
- $(GLIB_LIBS) $(DBUS_LIBS) -lreadline
+ $(GLIB_LIBS) $(DBUS_LIBS) $(READLINE_LIBS)
endif
if ZSH_COMPLETIONS
@@ -380,7 +380,7 @@ tools_meshctl_SOURCES = tools/meshctl.c \
tools/mesh-gatt/onoff-model.c
tools_meshctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
lib/libbluetooth-internal.la \
- $(GLIB_LIBS) $(DBUS_LIBS) -ljson-c -lreadline
+ $(GLIB_LIBS) $(DBUS_LIBS) -ljson-c $(READLINE_LIBS)
EXTRA_DIST += tools/mesh-gatt/local_node.json tools/mesh-gatt/prov_db.json
endif
@@ -399,7 +399,7 @@ tools_mesh_cfgclient_SOURCES = tools/mesh-cfgclient.c \
mesh/crypto.h mesh/crypto.c
tools_mesh_cfgclient_LDADD = lib/libbluetooth-internal.la src/libshared-ell.la \
- $(ell_ldadd) -ljson-c -lreadline
+ $(ell_ldadd) -ljson-c $(READLINE_LIBS)
bin_PROGRAMS += tools/mesh-cfgtest
@@ -506,7 +506,7 @@ noinst_PROGRAMS += tools/btmgmt tools/obex-client-tool tools/obex-server-tool \
tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \
tools/obex-client-tool.c
tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \
- src/libshared-glib.la $(GLIB_LIBS) -lreadline
+ src/libshared-glib.la $(GLIB_LIBS) $(READLINE_LIBS)
tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \
tools/obex-server-tool.c
@@ -517,16 +517,16 @@ tools_bluetooth_player_SOURCES = tools/bluetooth-player.c client/print.c \
client/player.c
tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \
src/libshared-glib.la \
- $(GLIB_LIBS) $(DBUS_LIBS) -lreadline
+ $(GLIB_LIBS) $(DBUS_LIBS) $(READLINE_LIBS)
tools_obexctl_SOURCES = tools/obexctl.c
tools_obexctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
- $(GLIB_LIBS) $(DBUS_LIBS) -lreadline
+ $(GLIB_LIBS) $(DBUS_LIBS) $(READLINE_LIBS)
tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c \
client/mgmt.c
tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \
- -lreadline
+ $(READLINE_LIBS)
if DEPRECATED
noinst_PROGRAMS += attrib/gatttool
@@ -536,7 +536,7 @@ attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \
attrib/utils.c src/log.c client/display.c \
client/display.h
attrib_gatttool_LDADD = lib/libbluetooth-internal.la \
- src/libshared-glib.la $(GLIB_LIBS) -lreadline
+ src/libshared-glib.la $(GLIB_LIBS) $(READLINE_LIBS)
endif
endif
@@ -586,5 +586,5 @@ tools/btpclient.$(OBJEXT): src/libshared-ell.la ell/internal
tools_btpclientctl_SOURCES = tools/btpclientctl.c client/display.c
tools_btpclientctl_LDADD = src/libshared-mainloop.la src/libshared-glib.la \
- lib/libbluetooth-internal.la -lreadline
+ lib/libbluetooth-internal.la $(READLINE_LIBS)
endif
diff --git a/configure.ac b/configure.ac
index 10d63d67f..cae4e6f0c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -330,8 +330,7 @@ AC_ARG_ENABLE(client, AS_HELP_STRING([--disable-client],
AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
if (test "${enable_client}" != "no" || test "${enable_mesh}" = "yes"); then
- AC_CHECK_HEADERS(readline/readline.h, enable_readline=yes,
- AC_MSG_ERROR(readline header files are required))
+ PKG_CHECK_MODULES([READLINE], [readline], enable_readline=yes)
fi
AM_CONDITIONAL(READLINE, test "${enable_readline}" = "yes")
base-commit: 50fb9042e1ad471115e21ed83daebae278594aa7
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [BlueZ] build: use pkg-config to find readline
2025-07-03 18:29 [PATCH BlueZ] build: use pkg-config to find readline Alyssa Ross
@ 2025-07-03 20:01 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2025-07-03 20:01 UTC (permalink / raw)
To: linux-bluetooth, hi
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=978771
---Test result---
Test Summary:
CheckPatch PENDING 0.27 seconds
GitLint PENDING 0.26 seconds
BuildEll PASS 20.02 seconds
BluezMake PASS 2686.40 seconds
MakeCheck PASS 20.22 seconds
MakeDistcheck PASS 197.69 seconds
CheckValgrind PASS 272.98 seconds
CheckSmatch PASS 303.04 seconds
bluezmakeextell PASS 126.92 seconds
IncrementalBuild PENDING 0.27 seconds
ScanBuild PASS 910.74 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-03 20:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-03 18:29 [PATCH BlueZ] build: use pkg-config to find readline Alyssa Ross
2025-07-03 20:01 ` [BlueZ] " bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox