All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] audio/media: Fix build with --disable-hfp
@ 2026-10-30  9:05 Jacob Siverskog
  2026-10-30 15:39 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Jacob Siverskog @ 2026-10-30  9:05 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Frédéric Danis, Jacob Siverskog

The HFP MediaEndpoint support calls into hfp-hf.c, which is only built
when HFP is enabled, so linking bluetoothd fails with --disable-hfp:

  profiles/audio/media.c:242: undefined reference to `hfp_hf_sco_remove'
  profiles/audio/media.c:1467: undefined reference to `hfp_hf_get_device'

Guard the HFP code with HAVE_HFP, as is already done for the endpoint
table entry and in transport.c.

Fixes: 89b91a4806fb ("audio/hfp-hf: Add MediaEndpoint for HFP codecs")
Assisted-by: Claude:claude-opus-5-5
---
 profiles/audio/media.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 34ff251c7..abd3cb992 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -238,10 +238,12 @@ static void media_endpoint_destroy(struct media_endpoint *endpoint)
 		endpoint->pac = NULL;
 	}
 
+#ifdef HAVE_HFP
 	if (endpoint->sco) {
 		hfp_hf_sco_remove(endpoint->adapter->btd_adapter, endpoint);
 		endpoint->sco = false;
 	}
+#endif
 
 	g_dbus_remove_watch(btd_get_dbus_connection(), endpoint->watch);
 	g_free(endpoint->capabilities);
@@ -1457,6 +1459,7 @@ static bool endpoint_init_asha(struct media_endpoint *endpoint,
 	return true;
 }
 
+#ifdef HAVE_HFP
 gboolean hfp_hf_set_configuration(struct media_endpoint *endpoint,
 					const char *ep_path,
 					media_endpoint_cb_t cb,
@@ -1514,6 +1517,7 @@ static bool endpoint_init_sco(struct media_endpoint *endpoint,
 
 	return hfp_hf_sco_listen(endpoint->adapter->btd_adapter, endpoint);
 }
+#endif /* HAVE_HFP */
 
 static bool endpoint_properties_exists(const char *uuid,
 						struct btd_device *dev,
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-30 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30  9:05 [PATCH BlueZ] audio/media: Fix build with --disable-hfp Jacob Siverskog
2026-10-30 15:39 ` [BlueZ] " bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.