Browse Source

Add selection of MIDI backend in configure script

There is no default backend nor automatic selection when only
one backend is available: for now, it is mandatory to explicitly
select the backend to use with one of the --with-`backend'
options.
master
Damien Goutte-Gattat 9 years ago
parent
commit
07a87aa1f5
  1. 31
      configure.ac

31
configure.ac

@ -18,11 +18,31 @@ AC_PROG_INSTALL
dnl Check for some non-ubiquitous functions
ICP_CHECK_NOTCH_FUNCS
dnl Check for ALSA
dnl TODO: Search for other MIDI APIs
AM_PATH_ALSA([1.0.0],
[AC_DEFINE([USE_ALSA_MIDI_API], [1],
[Define whether to use the ALSA MIDI API.])])
dnl Choice of MIDI backend
midi_backend=
AC_ARG_WITH([alsa],
[AS_HELP_STRING([--with-alsa],
[use ALSA MIDI backend])],
[AS_IF([test "x$with_alsa" = xyes],
[midi_backend=alsa])])
AC_ARG_WITH([oss],
[AS_HELP_STRING([--with-oss],
[use OSS MIDI backend])],
[AS_IF([test "x$with_oss" = xyes],
[midi_backend=oss])])
dnl Check for selected backend
AS_CASE(["x$midi_backend"],
[xalsa],
[AM_PATH_ALSA([1.0.0],
[AC_DEFINE([USE_ALSA_MIDI_API], [1],
[Define wether to use the ALSA MIDI API.])])],
[xoss],
[AC_CHECK_HEADERS([soundcard.h],
[AC_DEFINE([USE_OSS_MIDI_API], [1],
[Define whether to use the OSS MIDI API.])],
[AC_MSG_ERROR([OSS header not found.])])],
[AC_MSG_ERROR([No MIDI backend selected.])])
dnl Output files
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile man/Makefile])
@ -36,5 +56,6 @@ Configuration complete
Prefix: '${prefix}'
Compiler: '${CC} ${CFLAGS} ${CPPFLAGS}'
MIDI backend: '${midi_backend}'
"
Loading…
Cancel
Save