diff --git a/Makefile.tools b/Makefile.tools
index 044342e..c172446 100644
--- a/Makefile.tools
+++ b/Makefile.tools
endif
if CUPS
-cupsdir = $(libdir)/cups/backend
+
+cupsdir = $(CUPSDIR)
cups_PROGRAMS = profiles/cups/bluetooth
diff --git a/configure.ac b/configure.ac
index 6248eb0..af0e990 100644
--- a/configure.ac
+++ b/configure.ac
AC_ARG_ENABLE(cups, AS_HELP_STRING([--disable-cups],
[disable CUPS printer support]), [enable_cups=${enableval}])
AM_CONDITIONAL(CUPS, test "${enable_cups}" != "no")
+if (test "${enable_cups}" != "no"); then
+ AC_SUBST(CUPSDIR, `$PKG_CONFIG cups --variable=cups_serverbin`/backend)
+fi
AC_ARG_ENABLE(mesh, AS_HELP_STRING([--enable-mesh],
[enable Mesh profile support]), [enable_mesh=${enableval}])