1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-11 00:04:04 +02:00
openwrt-packages/gjay/patches/0003-Provide-a-.-configure-disable-audclient-option.patch
2011-07-08 09:44:31 +08:00

108 lines
2.7 KiB
Diff

From 4d3796be444f7b42041d111e2c91b7ce6faff786 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Tue, 26 Apr 2011 22:35:23 -0400
Subject: [PATCH 03/17] Provide a "./configure --disable-audclient" option
to build without support for Audacious.
---
config.h.in | 3 +++
configure.ac | 10 +++++++++-
play_audacious.c | 4 ++--
play_common.c | 2 ++
prefs.c | 2 ++
5 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/config.h.in b/config.h.in
index 9054b03..17decf1 100644
--- a/config.h.in
+++ b/config.h.in
@@ -85,5 +85,8 @@
/* Version number of package */
#undef VERSION
+/* Enable Audacious music player */
+#undef WITH_AUDCLIENT
+
/* Enable mpd music player */
#undef WITH_MPDCLIENT
diff --git a/configure.ac b/configure.ac
index c5545e8..bfe7ca4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,15 @@ if test "$enable_mpdclient" = "yes"; then
PKG_CHECK_MODULES([MPDCLIENT], [libmpdclient])
fi
+AC_SUBST([WITH_AUDCLIENT])
+AC_ARG_ENABLE([audclient],
+ AS_HELP_STRING([--disable-audclient], [Disable Audacious client (enabled by default)]),
+ [enable_audclient=$enableval],
+ [enable_audclient="yes"])
+if test "$enable_audclient" = "yes"; then
+ AC_DEFINE([WITH_AUDCLIENT], [1], [Enable Audacious music player])
+ PKG_CHECK_MODULES([AUDACIOUS], [audacious])
+fi
# Checks for programs.
AC_PROG_CC
@@ -31,7 +40,6 @@ AM_GNU_GETTEXT_VERSION([0.18.1])
# Checks for libraries.
AM_PATH_GTK_2_0
PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
-PKG_CHECK_MODULES([AUDACIOUS], [audacious])
AX_PATH_GSL
dnl AC_CHECK_LIB([audclient], [audacious_remote_playlist])
diff --git a/play_audacious.c b/play_audacious.c
index 4ca8cee..93e5f52 100644
--- a/play_audacious.c
+++ b/play_audacious.c
@@ -22,6 +22,7 @@
#include "config.h"
#endif /* HAVE_CONFIG_H */
+#ifdef WITH_AUDCLIENT
#include <stdio.h>
#include <sys/types.h>
@@ -171,5 +172,4 @@ audacious_connect(void)
}
-
-
+#endif /* WITH_AUDCLIENT */
diff --git a/play_common.c b/play_common.c
index f0968b5..9034dbc 100644
--- a/play_common.c
+++ b/play_common.c
@@ -40,9 +40,11 @@ player_init(void)
case PLAYER_NONE:
/* break out, configured later */
break;
+#ifdef WITH_AUDCLIENT
case PLAYER_AUDACIOUS:
player_configured = audacious_init();
break;
+#endif /* WITH_AUDCLIENT */
/*case PLAYER_EXAILE:
exaile_init();
break;*/
diff --git a/prefs.c b/prefs.c
index 33a6016..3232d32 100644
--- a/prefs.c
+++ b/prefs.c
@@ -122,7 +122,9 @@ char * pref_element_strs[PE_LAST] = {
const char *music_player_names[] =
{
"None",
+#ifdef WITH_AUDCLIENT
"Audacious",
+#endif
#ifdef WITH_MPDCLIENT
"MPD",
#endif
--
1.7.2.5