KORG microX utility.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

92 lines
2.9 KiB

dnl Configure template for the kmxtool package
AC_INIT([KORG microX utility], [0.1.0],
[dgouttegattat@incenp.org], [kmxtool])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_LIBOBJ_DIR([lib])
AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE([foreign])
dnl Check for development tools
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
dnl Check for some non-ubiquitous functions
ICP_CHECK_NOTCH_FUNCS
dnl Check for MIDI backends
AM_PATH_ALSA([1.0.0], [alsa_available=yes], [alsa_available=no])
oss_available=yes
dnl Select MIDI backends to enable
AC_ARG_ENABLE([alsa],
[AS_HELP_STRING([--enable-alsa],
[Enable ALSA MIDI backend (default=auto)])],
[], [])
AC_ARG_ENABLE([oss],
[AS_HELP_STRING([--enable-oss],
[Enable OSS MIDI backend (default=yes)])])
dnl Now decide which backends to use
midi_backends=
AS_IF([test "x$alsa_available" = xyes],
[AS_IF([test "x$enable_alsa" != xno],
[use_alsa=yes],
[use_alsa=no
CFLAGS="$alsa_save_CFLAGS"
LDFLAGS="$alsa_save_LDFLAGS"
LIBS="$alsa_save_LIBS"])],
[use_alsa=no
AS_IF([test "x$enable_alsa" = xyes],
[AC_MSG_ERROR([ALSA backend requested but not available.])])])
AS_IF([test "x$oss_available" = xyes],
[AS_IF([test "x$enable_oss" != xno],
[use_oss=yes],
[use_oss=no])],
[use_oss=no
AS_IF([test "x$enable_oss" = xyes],
[AC_MSG_ERROR([OSS backend requested but not available.])])])
dnl Backend(s) selected, now act accordingly
AS_IF([test "x$use_alsa" = xyes],
[AS_IF([test -z "$midi_backends"],
[midi_backends="alsa"], [midi_backends="$midi_backends alsa"])
AC_DEFINE([HAVE_ALSA], [1],
[Whether ALSA MIDI backend is available.])
midi_default_port=hw:1,0,0])
AS_IF([test "x$use_oss" = xyes],
[AS_IF([test -z "$midi_backends"],
[midi_backends="oss"], [midi_backends="$midi_backends oss"])
AC_DEFINE([HAVE_OSS], [1],
[Whether OSS MIDI backend is available.])
midi_default_port=/dev/midi00])
dnl At least one backend must be available and enabled
AS_IF([test -z "$midi_backends"],
[AC_MSG_ERROR([No MIDI backend enabled.])])
AC_DEFINE_UNQUOTED([DEFAULT_MIDI_PORT], ["$midi_default_port"],
[Default MIDI port to use.])
AC_SUBST([DEFAULT_MIDI_PORT], [$midi_default_port])
dnl Output files
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile
man/Makefile man/asysex.1 man/kmxtool.1])
AC_OUTPUT
dnl Summary
echo "
${PACKAGE_NAME} version ${PACKAGE_VERSION}
Configuration complete
Prefix: '${prefix}'
Compiler: '${CC} ${CFLAGS} ${CPPFLAGS}'
MIDI backends: '${midi_backends}'
"