build-sys: Link libpulse directly to libdbus-1 if needed
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Mon, 16 May 2011 10:00:37 +0000 (10:00 +0000)
committerColin Guthrie <colin@mageia.org>
Mon, 16 May 2011 10:08:32 +0000 (11:08 +0100)
Linking libpulse with gold or when using ld --no-add-needed fails
as libpulse uses dbus methods directly but isn't explicitly linked to it.
So link to it when needed :)

src/Makefile.am

index 7a4a32d..d4f595c 100644 (file)
@@ -806,10 +806,15 @@ libpulse_la_SOURCES = \
                pulse/volume.c pulse/volume.h \
                pulse/xmalloc.c pulse/xmalloc.h
 
-libpulse_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
+libpulse_la_CFLAGS = $(AM_CFLAGS)
 libpulse_la_LIBADD = $(AM_LIBADD) $(WINSOCK_LIBS) $(LTLIBICONV) libpulsecommon-@PA_MAJORMINOR@.la
 libpulse_la_LDFLAGS = $(AM_LDFLAGS) $(VERSIONING_LDFLAGS) -version-info $(LIBPULSE_VERSION_INFO)
 
+if HAVE_DBUS
+libpulse_la_CFLAGS += $(DBUS_CFLAGS)
+libpulse_la_LIBADD += $(DBUS_LIBS)
+endif
+
 libpulse_simple_la_SOURCES = pulse/simple.c pulse/simple.h
 libpulse_simple_la_CFLAGS = $(AM_CFLAGS)
 libpulse_simple_la_LIBADD = $(AM_LIBADD) libpulse.la libpulsecommon-@PA_MAJORMINOR@.la