summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2019-03-20 23:19:48 -0400
committerlukefromdc <[email protected]>2019-03-21 01:29:21 -0400
commit5dfb6527f45b012b328cdcc037c2510bae5039d9 (patch)
tree1e7a4cb215e2dd5802220a45fdb92d4ceb314ad2
parent0b24e9e5aca8a93990103d752ced4967cc9bd82b (diff)
downloadmate-media-5dfb6527f45b012b328cdcc037c2510bae5039d9.tar.bz2
mate-media-5dfb6527f45b012b328cdcc037c2510bae5039d9.tar.xz
Allow disabling either statusicon or panelapplet
Add --enable-statusicon (yes/no default is yes) and --enable-panelapplet (yes/no default is yes) configuration flags
-rw-r--r--configure.ac56
-rw-r--r--mate-volume-control/Makefile.am17
2 files changed, 71 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 66298df..5767b0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,46 @@ if test "x$enable_deprecated" = "xyes"; then
AC_SUBST(DISABLE_DEPRECATED)
fi
+#============================================================================
+# status icon
+#============================================================================
+
+dnl Whether to build the volume control statusicon
+dnl --
+
+AC_ARG_ENABLE(statusicon, AS_HELP_STRING([--enable-statusicon], [Enable volume control status icon (default: yes)]))
+if (test "${enable-statusicon}" == "no"); then
+ AC_DEFINE(ENABLE_STATUSICON, 0, [Enable if you want to build the tray applet])
+else
+
+ AC_DEFINE(ENABLE_STATUSICON, 1, [Enable if you want to build the tray applet])
+fi
+AM_CONDITIONAL(ENABLE_STATUSICON, test "${enable_statusicon}" != "no")
+
+#============================================================================
+# panel applet
+#============================================================================
+
+dnl Whether to build the standalone volume control applet
+dnl --
+
+
+AC_ARG_ENABLE(panelapplet, AS_HELP_STRING([--enable-panelapplet], [Enable volume control panel applet (gives better icon rendering than a status icon on hidpi displays) (default: yes)]))
+if (test "${enable-panelapplet}" == "no"); then
+ AC_DEFINE(ENABLE_PANELAPPLET, 0, [Enable if you want to build the panel applet])
+else
+ AC_DEFINE(ENABLE_PANELAPPLET, 1, [Enable if you want to build the panel applet])
+fi
+AM_CONDITIONAL(ENABLE_PANELAPPLET, test "${enable_panelapplet}" != "no")
+
+#============================================================================
+# Sanity check: must build either status icon or panel applet
+#============================================================================
+
+if test "x$enable_statusicon" == "xno" && test "x$enable_panelapplet" == "xno"; then
+ AC_MSG_ERROR([must build either volume control status icon or volume control applet])
+fi
+
# Turn on the additional warnings last, so warnings don't affect other tests.
AC_ARG_ENABLE(more-warnings,
[AC_HELP_STRING([--enable-more-warnings],
@@ -170,3 +210,19 @@ echo "
Compiler: ${CC}
CFLAGS: ${CFLAGS}
"
+#this is needed to get any output when the default is used
+#rather than explicitly specifying whether to build the applet or the tray icon
+
+if test "x$enable_statusicon" = "xno"; then
+ echo " Building status icon: no"
+else
+ echo " Building status icon: yes"
+fi
+
+if test "x$enable_panelapplet" = "xno"; then
+ echo " Building panel applet: no"
+else
+ echo " Building panel applet: yes"
+fi
+#get a newline in the terminal
+echo ""
diff --git a/mate-volume-control/Makefile.am b/mate-volume-control/Makefile.am
index a2173bb..3812a52 100644
--- a/mate-volume-control/Makefile.am
+++ b/mate-volume-control/Makefile.am
@@ -1,11 +1,17 @@
-NULL =
-
+if ENABLE_STATUSICON
bin_PROGRAMS = \
mate-volume-control-status-icon \
mate-volume-control \
$(NULL)
+else
+bin_PROGRAMS = \
+ mate-volume-control \
+ $(NULL)
+endif
+if ENABLE_PANELAPPLET
libexec_PROGRAMS = mate-volume-control-applet
+endif
AM_CPPFLAGS = \
$(WARN_CFLAGS) \
@@ -18,6 +24,7 @@ AM_CPPFLAGS = \
-I$(srcdir) \
$(NULL)
+if ENABLE_PANELAPPLET
APPLET_LOCATION = $(libexecdir)/mate-volume-control-applet
appletsdir = $(datadir)/mate-panel/applets
@@ -43,12 +50,15 @@ EXTRA_DIST = \
$(applets_in_files).in \
$(service_in_files)
+endif
+
noinst_LTLIBRARIES = libmatevolumecontrol.la
libmatevolumecontrol_la_SOURCES = \
gvc-channel-bar.h \
gvc-channel-bar.c \
$(NULL)
+if ENABLE_STATUSICON
mate_volume_control_status_icon_LDADD = \
-lm \
libmatevolumecontrol.la \
@@ -64,7 +74,9 @@ mate_volume_control_status_icon_SOURCES = \
$(NULL)
mate_volume_control_status_icon_CFLAGS = $(WARN_CFLAGS)
+endif
+if ENABLE_PANELAPPLET
mate_volume_control_applet_LDADD = \
-lm \
libmatevolumecontrol.la \
@@ -81,6 +93,7 @@ mate_volume_control_applet_SOURCES = \
$(NULL)
mate_volume_control_applet_CFLAGS = $(WARN_CFLAGS)
+endif
mate_volume_control_LDADD = \
-lm \