2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([calfbox],[0.0.3],[wdev@foltman.com])
6 AC_CONFIG_HEADER([config.h])
11 if test "x$prefix" = "xNONE"; then
12 prefix=$ac_default_prefix
15 # Checks for programs.
23 # Set initial parameters
26 FLUIDSYNTH_ENABLED="yes"
33 AC_MSG_CHECKING([whether to enable Python embedding])
35 AC_HELP_STRING([--without-python],[disable Python embedding]),
36 [if test "$withval" = "no"; then PYTHON_ENABLED="no"; fi],[])
37 AC_MSG_RESULT($PYTHON_ENABLED)
39 AC_MSG_CHECKING([whether to enable JACK I/O])
41 AC_HELP_STRING([--without-jack],[disable JACK audio and MIDI]),
42 [if test "$withval" = "no"; then JACK_ENABLED="no"; fi],[])
43 AC_MSG_RESULT($JACK_ENABLED)
45 AC_MSG_CHECKING([whether to enable Fluidsynth])
46 AC_ARG_WITH(fluidsynth,
47 AC_HELP_STRING([--without-fluidsynth],[disable use of Fluidsynth]),
48 [if test "$withval" = "no"; then FLUIDSYNTH_ENABLED="no"; fi],[])
49 AC_MSG_RESULT($FLUIDSYNTH_ENABLED)
51 AC_MSG_CHECKING([whether to enable libsmf])
53 AC_HELP_STRING([--without-libsmf],[disable use of libsmf]),
54 [if test "$withval" = "no"; then LIBSMF_ENABLED="no"; fi],[])
55 AC_MSG_RESULT($LIBSMF_ENABLED)
57 AC_MSG_CHECKING([whether to enable SSE (x86 family only)])
59 AC_HELP_STRING([--with-sse],[enable use of SSE]),
60 [if test "$withval" = "yes"; then SSE_ENABLED="yes"; fi],[])
61 AC_MSG_RESULT($SSE_ENABLED)
63 AC_MSG_CHECKING([whether to enable NEON (ARM family only)])
65 AC_HELP_STRING([--with-neon],[enable use of NEON]),
66 [if test "$withval" = "yes"; then NEON_ENABLED="yes"; fi],[])
67 AC_MSG_RESULT($NEON_ENABLED)
70 AC_CHECK_HEADER(uuid/uuid.h, true, AC_MSG_ERROR([libuuid header (uuid/uuid.h) is required]))
71 AC_CHECK_LIB(uuid, uuid_unparse, true, AC_MSG_ERROR([libuuid is required]))
72 PKG_CHECK_MODULES(GLIB_DEPS, glib-2.0 >= 2.6, true, AC_MSG_ERROR([libglib-2.0 is required]))
73 PKG_CHECK_MODULES(LIBUSB_DEPS, libusb-1.0 >= 1.0, true, AC_MSG_ERROR([libusb-1.0 is required]))
74 PKG_CHECK_MODULES(LIBSNDFILE_DEPS, sndfile, true, AC_MSG_ERROR([libsndfile is required]))
76 if test "$FLUIDSYNTH_ENABLED" = "yes"; then
77 PKG_CHECK_MODULES(FLUIDSYNTH_DEPS, fluidsynth >= 1.0.8, true, AC_MSG_ERROR([fluidsynth 1.0.8 is required]))
80 if test "$LIBSMF_ENABLED" = "yes"; then
81 PKG_CHECK_MODULES(LIBSMF_DEPS, smf >= 1.3, true, AC_MSG_ERROR([libsmf 1.3 is required (libsmf.sourceforge.net)]))
84 if test "$JACK_ENABLED" = "yes"; then
85 PKG_CHECK_MODULES(JACK_DEPS, jack >= 0.116.0, true, AC_MSG_ERROR([JACK is required (or use --without-jack)]))
86 AC_CHECK_HEADER(jack/jack.h, true, AC_MSG_ERROR([JACK is required (or use --without-jack)]))
89 if test "$PYTHON_ENABLED" = "yes"; then
90 PKG_CHECK_MODULES(PYTHON_DEPS, python3 >= 3.0, true, AC_MSG_ERROR([python 3.0 or newer is required (or use --without-python)]))
93 # Generate Automake conditionals
94 AM_CONDITIONAL(USE_PYTHON, test "$PYTHON_ENABLED" = "yes")
95 AM_CONDITIONAL(USE_JACK, test "$JACK_ENABLED" = "yes")
96 AM_CONDITIONAL(USE_FLUIDSYNTH, test "$FLUIDSYNTH_ENABLED" = "yes")
97 AM_CONDITIONAL(USE_LIBSMF, test "$LIBSMF_ENABLED" = "yes")
98 AM_CONDITIONAL(USE_SSE, test "$SSE_ENABLED" = "yes")
99 AM_CONDITIONAL(USE_NEON, test "$NEON_ENABLED" = "yes")
101 # Generate config.h conditionals
102 if test "$PYTHON_ENABLED" = "yes"; then
103 AC_DEFINE(USE_PYTHON, 1, [Python will be included])
105 if test "$JACK_ENABLED" = "yes"; then
106 AC_DEFINE(USE_JACK, 1, [JACK I/O will be included])
108 if test "$FLUIDSYNTH_ENABLED" = "yes"; then
109 AC_DEFINE(USE_FLUIDSYNTH, 1, [Fluidsynth will be included])
111 if test "$LIBSMF_ENABLED" = "yes"; then
112 AC_DEFINE(USE_LIBSMF, 1, [libsmf will be used])
114 if test "$SSE_ENABLED" = "yes"; then
115 AC_DEFINE(USE_SSE, 1, [x86 Streaming SIMD Extensions will be used])
117 if test "$NEON_ENABLED" = "yes"; then
118 AC_DEFINE(USE_NEON, 1, [ARM NEON SIMD Extensions will be used])
122 AC_CONFIG_FILES([Makefile])