make aul optional 89/12789/1
authorJaska Uimonen <jaska.uimonen@helsinki.fi>
Wed, 20 Nov 2013 15:45:53 +0000 (17:45 +0200)
committerJaska Uimonen <jaska.uimonen@helsinki.fi>
Wed, 20 Nov 2013 15:48:53 +0000 (17:48 +0200)
Change-Id: I90a30da092ef40afb279c5603dcdf772a2369ccf

configure.ac
murphy/Makefile.am
murphy/classify.c

index 997184f..f1e4480 100644 (file)
@@ -83,10 +83,15 @@ PKG_CHECK_MODULES(LUA, lua >= 5.1.1)
 AC_SUBST(LUA_CFLAGS)
 AC_SUBST(LUA_LIBS)
 
-PKG_CHECK_MODULES(AUL, aul)
+PKG_CHECK_MODULES(AUL, aul, [have_aul=yes], [have_aul=no])
+if test "$have_aul" = "no" -a "$enable_aul" = "yes"; then
+   AC_MSG_ERROR([AUL development headers not found.])
+fi
 AC_SUBST(AUL_CFLAGS)
 AC_SUBST(AUL_LIBS)
 
+AM_CONDITIONAL(HAVE_AUL,  [ test x$have_aul = "xyes" ])
+
 # D-Bus
 AC_ARG_WITH([dbus],
             [ AS_HELP_STRING([--with-dbus],
index bf3df26..c4c8323 100644 (file)
@@ -52,6 +52,10 @@ if BUILD_WITH_MURPHYIF
 CONDITIONAL_CFLAGS += -DWITH_MURPHYIF
 endif
 
+if HAVE_AUL
+CONDITIONAL_CFLAGS += -DWITH_AUL
+endif
+
 
 module_murphy_ivi_la_LDFLAGS = -module -avoid-version -Wl,--no-undefined
 
index 74b3364..dfa0f9e 100644 (file)
@@ -34,8 +34,10 @@ ot, write to the
 #include <pulsecore/device-port.h>
 #include <pulsecore/core-util.h>
 
+#ifdef WITH_AUL
 #include <aul.h>
 #include <bundle.h>
+#endif
 
 #include "classify.h"
 #include "node.h"
@@ -313,6 +315,7 @@ mir_node_type pa_classify_guess_stream_node_type(struct userdata *u,
                 if (!pid)
                     break;
 
+#ifdef WITH_AUL
                 if (aul_app_get_appid_bypid(pid, buf, sizeof(buf)) < 0 &&
                     pid2exe(pid, buf, sizeof(buf)) < 0)
                 {
@@ -320,7 +323,13 @@ mir_node_type pa_classify_guess_stream_node_type(struct userdata *u,
                            "(pid %d)", bin, pid);
                     break;
                 }
-
+#else
+                if (pid2exe(pid, buf, sizeof(buf)) < 0) {
+                    pa_log("can't obtain real application name for wrt '%s' "
+                           "(pid %d)", bin, pid);
+                    break;
+                }
+#endif
                 if ((name = strrchr(buf, '.')))
                     name++;
                 else