-if HAVE_JACK
-JACK_LIB = -ljack
-else
-JACK_LIB =
-endif
-
bin_PROGRAMS = aserver
aserver_SOURCES = aserver.c
# aserver_LDADD = -lasound
-aserver_LDADD = ../src/libasound.la $(JACK_LIB)
+aserver_LDADD = ../src/libasound.la
all: aserver
esac
AC_DEFINE_UNQUOTED(DATADIR, "$dir", [directory containing ALSA configuration database])
+test "x$exec_prefix" = xNONE && exec_prefix=$prefix
+
+eval dir="$libdir"
+case "$dir" in
+/*) ;;
+*) dir="$PWD/$dir"
+esac
+AC_DEFINE_UNQUOTED(PKGLIBDIR, "$dir/$PACKAGE", [directory containing ALSA add-on modules])
+
dnl Check for versioned symbols
AC_MSG_CHECKING(for versioned symbols)
AC_ARG_WITH(versioned,
AC_MSG_RESULT(no)
fi
-dnl Check for jack...
-AC_MSG_CHECKING(for jack)
-AC_ARG_WITH(jack,
- [ --with-jack do you have installed Jack Audio Connection Kit (optional)],
- [ AC_DEFINE(HAVE_JACK, "1", [enabled])
- jack=yes ],)
-if test "$jack" = "yes" ; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-AM_CONDITIONAL(HAVE_JACK, test x$jack = xyes)
-
dnl Check for architecture
AC_MSG_CHECKING(for architecture)
case "$target" in
AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile include/Makefile
include/sound/Makefile src/Makefile \
- src/control/Makefile src/mixer/Makefile src/pcm/Makefile \
+ src/control/Makefile src/mixer/Makefile
+ src/pcm/Makefile src/pcm/ext/Makefile \
src/rawmidi/Makefile src/timer/Makefile \
src/hwdep/Makefile src/seq/Makefile src/instr/Makefile \
src/compat/Makefile src/conf/Makefile \
EXTRA_DIST=Versions
COMPATNUM=@LIBTOOL_VERSION_INFO@
-if HAVE_JACK
-JACK_LIB = -ljack
-else
-JACK_LIB =
-endif
-
lib_LTLIBRARIES = libasound.la
libasound_la_SOURCES = conf.c confmisc.c input.c output.c async.c error.c dlmisc.c
libasound_la_LIBADD = control/libcontrol.la mixer/libmixer.la pcm/libpcm.la \
-EXTRA_LTLIBRARIES = libpcm.la
+SUBDIRS = ext
-if HAVE_JACK
-JACK_PLUGIN = pcm_jack.c
-else
-JACK_PLUGIN =
-endif
+EXTRA_LTLIBRARIES = libpcm.la
libpcm_la_SOURCES = atomic.c mask.c interval.c \
pcm.c pcm_params.c \
pcm_rate.c pcm_plug.c pcm_misc.c pcm_mmap.c pcm_multi.c \
pcm_shm.c pcm_file.c pcm_null.c pcm_share.c \
pcm_meter.c pcm_hooks.c pcm_lfloat.c pcm_ladspa.c \
- pcm_dmix.c $(JACK_PLUGIN) pcm_symbols.c
+ pcm_dmix.c pcm_symbols.c
noinst_HEADERS = pcm_local.h pcm_plugin.h mask.h mask_inline.h \
interval.h interval_inline.h plugin_ops.h ladspa.h \
pcm_dmix_i386.h
-EXTRA_libpcm_la_SOURCES = pcm_jack.c
-
alsadir = $(datadir)/alsa
all: libpcm.la
--- /dev/null
+COMPATNUM=@LIBTOOL_VERSION_INFO@
+
+pkglib_LTLIBRARIES = libasound_module_pcm_jack.la
+
+libasound_module_pcm_jack_la_SOURCES = pcm_jack.c
+libasound_module_pcm_jack_la_LDFLAGS = -version-info $(COMPATNUM)
+libasound_module_pcm_jack_la_LIBADD = -ljack
+alsadir = $(libdir)/alsa_modules
+
+INCLUDES=-I$(top_srcdir)/include -I$(top_srcdir)/src/pcm
+
+.PHONY : help
+
+help:
+ @echo "Specify target by hand, please"
+ @echo "Type 'make jack' to build the jack pcm plugin..."
+ @echo "Type 'make install-jack' to install the jack pcm plugin..."
+
+all: help
+
+all-am: help
+
+install-am: help
+
+hand-install: install-exec-am
+
+jack: libasound_module_pcm_jack.la
+
+install-jack:
+ $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) libasound_module_pcm_jack.la $(DESTDIR)$(pkglibdir)/libasound_module_pcm_jack.la
return handler->u.pcm;
}
+static char *build_in_pcms[] = {
+ "adpcm", "alaw", "copy", "dmix", "file", "hooks", "hw", "ladspa", "lfloat",
+ "linear", "meter", "mulaw", "multi", "null", "plug", "rate", "route", "share",
+ "shm", NULL
+};
+
static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
snd_config_t *pcm_root, snd_config_t *pcm_conf,
snd_pcm_stream_t stream, int mode)
{
const char *str;
- char buf[256];
+ char *buf = NULL, *buf1 = NULL;
int err;
snd_config_t *conf, *type_conf = NULL;
snd_config_iterator_t i, next;
}
}
if (!open_name) {
+ buf = malloc(strlen(str) + 32);
+ if (buf == NULL) {
+ err = -ENOMEM;
+ goto _err;
+ }
open_name = buf;
- snprintf(buf, sizeof(buf), "_snd_pcm_%s_open", str);
+ sprintf(buf, "_snd_pcm_%s_open", str);
+ }
+ if (!lib) {
+ char **build_in = build_in_pcms;
+ while (*build_in) {
+ if (!strcmp(*build_in, str))
+ break;
+ build_in++;
+ }
+ if (*build_in == NULL) {
+ buf1 = malloc(strlen(str) + sizeof(PKGLIBDIR) + 32);
+ if (buf1 == NULL) {
+ err = -ENOMEM;
+ goto _err;
+ }
+ lib = buf1;
+ sprintf(buf1, "%s/libasound_module_pcm_%s.so", PKGLIBDIR, str);
+ }
}
#ifndef PIC
snd_pcm_open_symbols(); /* this call is for static linking only */
err = open_func(pcmp, name, pcm_root, pcm_conf, stream, mode);
if (err >= 0) {
(*pcmp)->dl_handle = h;
- return 0;
+ err = 0;
} else {
snd_dlclose(h);
}
}
+ if (buf)
+ free(buf);
+ if (buf1)
+ free(buf1);
return err;
}
extern const char *_snd_module_pcm_lfloat;
extern const char *_snd_module_pcm_ladspa;
extern const char *_snd_module_pcm_dmix;
-#ifdef HAVE_JACK
-extern const char *_snd_module_pcm_jack;
-#endif
static const char **snd_pcm_open_objects[] = {
&_snd_module_pcm_adpcm,
&_snd_module_pcm_shm,
&_snd_module_pcm_lfloat,
&_snd_module_pcm_ladspa,
- &_snd_module_pcm_dmix,
-#ifdef HAVE_JACK
- &_snd_module_pcm_jack
-#endif
+ &_snd_module_pcm_dmix
};
void *snd_pcm_open_symbols(void)