Package: bluez-tools
Version: 0.1.38+git662e-2
Severity: normal
Tags: patch
Hello,
bluez-tools fails to build in Ubuntu as it uses "ld --as-needed" for
linking by default and blueztools misuses AM_LDFLAGS to specify the
libraries to link with. As configure uses AM_LDFLAGS before the object
files in the linker call the linking fails. The proper variable for them
is LDADD, program_LDADD or even LIBS (I'm not very familiar with
automake which one is prefered when).
The attached patch renames AM_LDFLAGS in src/Makefile.{am,in} to LDADD
(instead of adding program_LDADD for each binary).
Regards,
Michael
https://launchpadlibrarian.net/71108320/buildlog_ubuntu-oneiric-i386.bluez-tools_0.1.38%2Bgit662e-2_FAILEDTOBUILD.txt.gz
gcc -std=gnu99 -g -O2 -L/usr/lib/i386-linux-gnu -ldbus-1 -lpthread -lrt
-L/usr/lib/i386-linux-gnu -lglib-2.0 -pthread -L/usr/lib/i386-linux-gnu
-ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0
-Wl,-Bsymbolic-functions -o bt-monitor lib/marshallers.o lib/dbus-common.o
lib/helpers.o lib/sdp.o lib/bluez/adapter.o lib/bluez/agent.o
lib/bluez/audio.o lib/bluez/device.o lib/bluez/input.o lib/bluez/manager.o
lib/bluez/network.o lib/bluez/network_server.o lib/bluez/serial.o
lib/obexd/obexagent.o lib/obexd/obexclient.o
lib/obexd/obexclient_file_transfer.o lib/obexd/obexclient_session.o
lib/obexd/obexclient_transfer.o lib/obexd/obexmanager.o lib/obexd/obexsession.o
lib/obexd/obextransfer.o bt-monitor.o
bt-monitor.o: In function `adapter_device_disappeared':
/build/buildd/bluez-tools-0.1.38+git662e/src/bt-monitor.c:123: undefined
reference to `g_print'
bt-monitor.o: In function `device_disconnect_requested':
/build/buildd/bluez-tools-0.1.38+git662e/src/bt-monitor.c:182: undefined
reference to `g_print'
bt-monitor.o: In function `reload_device_services':
/build/buildd/bluez-tools-0.1.38+git662e/src/bt-monitor.c:371: undefined
reference to `g_hash_table_lookup'
/build/buildd/bluez-tools-0.1.38+git662e/src/bt-monitor.c:378: undefined
reference to `g_slist_nth_data'
/build/buildd/bluez-tools-0.1.38+git662e/src/bt-monitor.c:379: undefined
reference to `g_slist_remove'
/build/buildd/bluez-tools-0.1.38+git662e/src/bt-monitor.c:380: undefined
reference to `g_object_unref'
[...]
Index: bluez-tools-0.1.38+git662e/src/Makefile.am
===================================================================
--- bluez-tools-0.1.38+git662e.orig/src/Makefile.am 2011-05-07 17:06:38.000000000 +0200
+++ bluez-tools-0.1.38+git662e/src/Makefile.am 2011-05-07 17:07:10.000000000 +0200
@@ -1,5 +1,5 @@
AM_CPPFLAGS = $(DBUS_CFLAGS) $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
-AM_LDFLAGS = $(DBUS_LIBS) $(GLIB_LIBS) $(DBUS_GLIB_LIBS)
+LDADD = $(DBUS_LIBS) $(GLIB_LIBS) $(DBUS_GLIB_LIBS)
# Marshallers generation
#BUILT_SOURCES = lib/marshallers.c lib/marshallers.h
@@ -57,7 +57,7 @@
if OBEX
bin_PROGRAMS += bt-obex
bt_obex_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-obex.c
-bt_obex_LDADD = $(LIBREADLINE)
+bt_obex_LDADD = $(LDADD) $(LIBREADLINE)
endif
dist_man_MANS = bt-monitor.1 bt-adapter.1 bt-agent.1 bt-device.1 bt-input.1 bt-audio.1 bt-network.1 bt-serial.1
Index: bluez-tools-0.1.38+git662e/src/Makefile.in
===================================================================
--- bluez-tools-0.1.38+git662e.orig/src/Makefile.in 2011-05-07 17:07:16.000000000 +0200
+++ bluez-tools-0.1.38+git662e/src/Makefile.in 2011-05-07 17:07:58.000000000 +0200
@@ -419,7 +419,7 @@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = $(DBUS_CFLAGS) $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
-AM_LDFLAGS = $(DBUS_LIBS) $(GLIB_LIBS) $(DBUS_GLIB_LIBS)
+LDADD = $(DBUS_LIBS) $(GLIB_LIBS) $(DBUS_GLIB_LIBS)
# Marshallers generation
#BUILT_SOURCES = lib/marshallers.c lib/marshallers.h
@@ -462,7 +462,7 @@
bt_network_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-network.c
bt_serial_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-serial.c
@OBEX_TRUE@bt_obex_SOURCES = $(lib_sources) $(bluez_sources) $(obexd_sources) bt-obex.c
-@OBEX_TRUE@bt_obex_LDADD = $(LIBREADLINE)
+@OBEX_TRUE@bt_obex_LDADD = $(LDADD) $(LIBREADLINE)
dist_man_MANS = bt-monitor.1 bt-adapter.1 bt-agent.1 bt-device.1 \
bt-input.1 bt-audio.1 bt-network.1 bt-serial.1 $(am__append_3)
all: all-am