###################################
if HAVE_OSS_WRAPPER
-pkglib_LTLIBRARIES += libpulsedsp.la
+padsplibdir = $(pkglibdir)
+padsplib_LTLIBRARIES = libpulsedsp.la
bin_SCRIPTS += utils/padsp
edit = @sed \
update-all: update-ffmpeg update-sbc update-map-file
+# Force installation order of libraries. libtool relinks on install time, in
+# which case libpulsecommon has to be install before others, but the padsp
+# preload library has to be done after the normal libraries (e.g. libpulse)
+# ...
+# Unfortunately automake behaviour means that rules without commands also
+# override build-in rules, so it's not trivial to add dependencies.
+# See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7328 for the workaround
+# ...
+# Isn't libtool/autotools fun!
+
+installlibLTLIBRARIES = install-libLTLIBRARIES
+$(installlibLTLIBRARIES): install-pkglibLTLIBRARIES
+
+installmodlibexecLTLIBRARIES = install-modlibexecLTLIBRARIES
+$(installmodlibexecLTLIBRARIES): install-pkglibLTLIBRARIES
+
+installpadsplibLTLIBRARIES = install-padsplibLTLIBRARIES
+$(installpadsplibLTLIBRARIES): install-libLTLIBRARIES
+
.PHONY: utils/padsp massif update-all update-ffmpeg update-sbc update-map-file