Build time selecting ALSA/OSS volume plugin.
authorJim Huang <jserv.tw@gmail.com>
Mon, 11 Feb 2008 16:15:11 +0000 (16:15 +0000)
committerJim Huang <jserv.tw@gmail.com>
Mon, 11 Feb 2008 16:15:11 +0000 (16:15 +0000)
TODO: real OSS checking.

configure.ac
src/plugins/volume/Makefile.am
src/plugins/volumealsa/Makefile.am
src/plugins/volumealsa/volumealsa.c

index 370f477..6f586f8 100644 (file)
@@ -32,6 +32,21 @@ if test x"$cast_checks" = "xno"; then
 fi
 AC_SUBST(G_CAST_CHECKS)
 
+AC_ARG_ENABLE([alsa],
+       AS_HELP_STRING([--disable-alsa],
+                       [compile ALSA providers (default: enable)]),
+                       compile_alsa=$enableval, compile_alsa="yes")
+if test x"$compile_alsa" = "xyes"; then
+       AC_CHECK_HEADERS([alsa/asoundlib.h],
+                        [AC_CHECK_LIB([asound],
+                                      [snd_seq_open],
+                                      compile_alsa=yes,compile_alsa=no)],
+                          compile_alsa=no)
+fi
+AM_CONDITIONAL(BUILD_ALSA_PLUGINS, test x$compile_alsa = xyes)
+dnl FIXME: check OSS existence
+AM_CONDITIONAL(BUILD_OSS_PLUGINS, test x$compile_alsa = xno)
+
 AC_ARG_ENABLE([plugins-loading],
        AS_HELP_STRING([--disable-plugins-loading],
                       [disable plugin loading (default: enable)]),
@@ -108,6 +123,16 @@ else
        fi
 fi
 
+dnl FIXME: OSS/ALSA checking
+if test x"$compile_alsa" = "xno"; then
+       if test ! -z $plugin_volumealsa; then
+               AC_MSG_RESULT([no ALSA headers/libraries found!])
+               plugin_volumealsa=
+       fi
+else
+       dnl force OSS plugin to <null>
+       plugin_volume=
+fi
 PLUGINS_LIST="$plugin_netstatus $plugin_volume $plugin_volumealsa $plugin_cpu $plugin_deskno $plugin_batt"
 AC_SUBST(PLUGINS_LIST)
 
index e2d108d..d51ce6f 100644 (file)
@@ -1,3 +1,5 @@
+if BUILD_OSS_PLUGINS
+
 INCLUDES = \
        -I. \
        -I$(top_srcdir)/src \
@@ -22,3 +24,5 @@ volume_la_LDFLAGS = \
        -rpath $(moduledir) \
        -module \
        -export-symbols-regex '_plugin_class$$'
+
+endif
index 316d541..1471071 100644 (file)
@@ -1,3 +1,5 @@
+if BUILD_ALSA_PLUGINS
+
 INCLUDES = \
        -I. \
        -I$(top_srcdir)/src \
@@ -18,3 +20,5 @@ volumealsa_la_LDFLAGS = \
        -rpath $(moduledir) \
        -module \
        -export-symbols-regex '_plugin_class$$'
+
+endif
index ece1e45..4052f12 100644 (file)
@@ -1,5 +1,5 @@
-/**                                                                                                 
- * Copyright (c) 2006 LxDE Developers, see the file AUTHORS for details.
+/**
+ * Copyright (c) 2008 LxDE Developers, see the file AUTHORS for details.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by