]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Add --with-ctl-plugins configure option
authorTakashi Iwai <tiwai@suse.de>
Wed, 28 Mar 2007 11:48:04 +0000 (13:48 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 28 Mar 2007 11:48:04 +0000 (13:48 +0200)
Added --with-ctl-plugins configure option to specify the optinal
plugins to build.

configure.in
src/control/Makefile.am
src/control/control_symbols.c

index 9aba9c90578d024cdca4fe629b34f60dabb353db..40e7674f4f81351ff5d3cf2786c2b8afcd19f1e3 100644 (file)
@@ -431,6 +431,42 @@ for t in $PCM_PLUGIN_LIST; do
   fi
 done
 
+dnl Control Plugins
+
+AC_ARG_WITH(ctl-plugins,
+  [  --with-ctl-plugins=<list>  Build Control plugins ],
+  [ctl_plugins="$withval"], [ctl_plugins="all"])
+
+CTL_PLUGIN_LIST="shm ext"
+
+build_ctl_plugin="no"
+for t in $CTL_PLUGIN_LIST; do
+  eval build_ctl_$t="no"
+done
+
+ctl_plugins=`echo $ctl_plugins | sed 's/,/ /g'`
+for p in $ctl_plugins; do
+  for t in $CTL_PLUGIN_LIST; do
+    if test "$p" = "$t" -o "$p" = "all"; then
+      eval build_ctl_$t="yes"
+      build_ctl_plugin="yes"
+    fi
+  done
+done
+
+AM_CONDITIONAL(BUILD_CTL_PLUGIN, test x$build_ctl_plugin = xyes)
+AM_CONDITIONAL(BUILD_CTL_PLUGIN_SHM, test x$build_ctl_shm = xyes)
+AM_CONDITIONAL(BUILD_CTL_PLUGIN_EXT, test x$build_ctl_ext = xyes)
+
+dnl Create ctl plugin symbol list for static library
+rm -f "$srcdir"/src/control/ctl_symbols_list.c
+touch "$srcdir"/src/control/ctl_symbols_list.c
+for t in $CTL_PLUGIN_LIST; do
+  if eval test \$build_ctl_$t = yes; then
+    echo \&_snd_module_control_$t, >> "$srcdir"/src/control/ctl_symbols_list.c
+  fi
+done
+
 dnl Make a symlink for inclusion of alsa/xxx.h
 if test ! -L "$srcdir"/include/alsa ; then
   echo "Making a symlink include/alsa"
index 771385a73fcdfb8a1b98b64df6ce8ae0a0217f4f..90c000aadd3634bf8fcccfd7defd7fab1848b051 100644 (file)
@@ -1,8 +1,13 @@
 EXTRA_LTLIBRARIES = libcontrol.la
 
 libcontrol_la_SOURCES = cards.c namehint.c hcontrol.c \
-                        control.c control_hw.c control_shm.c \
-                       control_ext.c setup.c control_symbols.c
+                        control.c control_hw.c setup.c control_symbols.c
+if BUILD_CTL_PLUGIN_SHM
+libcontrol_la_SOURCES += control_shm.c
+endif
+if BUILD_CTL_PLUGIN_EXT
+libcontrol_la_SOURCES += control_ext.c
+endif
 
 noinst_HEADERS = control_local.h
 
index 6924921f12fe24fb1953b5ea380f692741c67e84..3c0f62c1dd04019fbee794a0afd3fce65c19ca6a 100644 (file)
 
 extern const char *_snd_module_control_hw;
 extern const char *_snd_module_control_shm;
+extern const char *_snd_module_control_ext;
 
 static const char **snd_control_open_objects[] = {
        &_snd_module_control_hw,
-       &_snd_module_control_shm
+#include "ctl_symbols_list.c"
 };
        
 void *snd_control_open_symbols(void)