Buggy but almost working implementation of JACK transport control.
[calfbox.git] / configure.ac
blob728c48fbebd6e9de78a5ee037ad92a26405e5104
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.63)
5 AC_INIT([calfbox],[0.0.3],[wdev@foltman.com])
6 AC_CONFIG_HEADER([config.h])
7 LT_LANG([C])
9 AM_INIT_AUTOMAKE(1.8)
11 if test "x$prefix" = "xNONE"; then 
12   prefix=$ac_default_prefix
15 # Checks for programs.
16 AC_PROG_CC_C99
17 AC_PROG_INSTALL
19 # Checks for headers.
20 AC_HEADER_STDC
22 # Set initial parameters
23 PYTHON_ENABLED="yes"
24 JACK_ENABLED="yes"
25 FLUIDSYNTH_ENABLED="yes"
27 # Check options
29 AC_MSG_CHECKING([whether to enable Python embedding])
30 AC_ARG_WITH(python,
31 AC_HELP_STRING([--without-python],[disable Python embedding]),
32   [if test "$withval" = "no"; then PYTHON_ENABLED="no"; fi],[])
33 AC_MSG_RESULT($PYTHON_ENABLED)
35 AC_MSG_CHECKING([whether to enable JACK I/O])
36 AC_ARG_WITH(jack,
37 AC_HELP_STRING([--without-jack],[disable JACK audio and MIDI]),
38   [if test "$withval" = "no"; then JACK_ENABLED="no"; fi],[])
39 AC_MSG_RESULT($JACK_ENABLED)
41 AC_MSG_CHECKING([whether to enable Fluidsynth])
42 AC_ARG_WITH(fluidsynth,
43 AC_HELP_STRING([--without-fluidsynth],[disable use of Fluidsynth]),
44   [if test "$withval" = "no"; then FLUIDSYNTH_ENABLED="no"; fi],[])
45 AC_MSG_RESULT($FLUIDSYNTH_ENABLED)
47 AC_MSG_CHECKING([whether to enable libsmf])
48 AC_ARG_WITH(libsmf,
49 AC_HELP_STRING([--without-libsmf],[disable use of libsmf]),
50   [if test "$withval" = "no"; then LIBSMF_ENABLED="no"; fi],[])
51 AC_MSG_RESULT($LIBSMF_ENABLED)
53 # Check dependencies
54 AC_CHECK_HEADER(uuid/uuid.h, true, AC_MSG_ERROR([libuuid header (uuid/uuid.h) is required]))
55 AC_CHECK_LIB(uuid, uuid_unparse, true, AC_MSG_ERROR([libuuid is required]))
56 PKG_CHECK_MODULES(GLIB_DEPS, glib-2.0 >= 2.6, true, AC_MSG_ERROR([libglib-2.0 is required]))
57 PKG_CHECK_MODULES(LIBUSB_DEPS, libusb-1.0 >= 1.0, true, AC_MSG_ERROR([libusb-1.0 is required]))
58 PKG_CHECK_MODULES(LIBSNDFILE_DEPS, sndfile, true, AC_MSG_ERROR([libsndfile is required]))
60 if test "$FLUIDSYNTH_ENABLED" = "yes"; then
61     PKG_CHECK_MODULES(FLUIDSYNTH_DEPS, fluidsynth >= 1.0.8, true, AC_MSG_ERROR([fluidsynth 1.0.8 is required]))
64 if test "$LIBSMF_ENABLED" = "yes"; then
65     PKG_CHECK_MODULES(LIBSMF_DEPS, smf >= 1.3, true, AC_MSG_ERROR([libsmf 1.3 is required (libsmf.sourceforge.net)]))
68 if test "$JACK_ENABLED" = "yes"; then
69     PKG_CHECK_MODULES(JACK_DEPS, jack >= 0.116.0, true, AC_MSG_ERROR([JACK is required (or use --without-jack)]))
70     AC_CHECK_HEADER(jack/jack.h, true, AC_MSG_ERROR([JACK is required (or use --without-jack)]))
73 if test "$PYTHON_ENABLED" = "yes"; then
74     PKG_CHECK_MODULES(PYTHON_DEPS, python3 >= 3.0, true, AC_MSG_ERROR([python 3.0 or newer is required (or use --without-python)]))
77 # Generate Automake conditionals
78 AM_CONDITIONAL(USE_PYTHON, test "$PYTHON_ENABLED" = "yes")
79 AM_CONDITIONAL(USE_JACK, test "$JACK_ENABLED" = "yes")
80 AM_CONDITIONAL(USE_FLUIDSYNTH, test "$FLUIDSYNTH_ENABLED" = "yes")
81 AM_CONDITIONAL(USE_LIBSMF, test "$LIBSMF_ENABLED" = "yes")
83 # Generate config.h conditionals
84 if test "$PYTHON_ENABLED" = "yes"; then
85     AC_DEFINE(USE_PYTHON, 1, [Python will be included])
87 if test "$JACK_ENABLED" = "yes"; then
88     AC_DEFINE(USE_JACK, 1, [JACK I/O will be included])
90 if test "$FLUIDSYNTH_ENABLED" = "yes"; then
91     AC_DEFINE(USE_FLUIDSYNTH, 1, [Fluidsynth will be included])
93 if test "$LIBSMF_ENABLED" = "yes"; then
94     AC_DEFINE(USE_LIBSMF, 1, [libsmf will be used])
97 # Generate files
98 AC_CONFIG_FILES([Makefile])
100 AC_OUTPUT