-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfigure.ac
162 lines (137 loc) · 5.71 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.71])
AC_INIT([calfbox],[0.0.3],[[email protected]])
AC_CONFIG_HEADERS([config.h])
LT_INIT([])
LT_LANG([C])
AM_INIT_AUTOMAKE(1.8)
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
fi
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
# Checks for headers.
AC_CHECK_INCLUDES_DEFAULT
AC_PROG_EGREP
# Set initial parameters
PYTHON_ENABLED="yes"
NCURSES_ENABLED="yes"
JACK_ENABLED="yes"
FLUIDSYNTH_ENABLED="yes"
LIBSMF_ENABLED="yes"
LIBUSB_ENABLED="yes"
SSE_ENABLED="no"
NEON_ENABLED="no"
# Check options
AC_MSG_CHECKING([whether to enable Python embedding])
AC_ARG_WITH(python,
AS_HELP_STRING([--without-python],[disable Python embedding]),
[if test "$withval" = "no"; then PYTHON_ENABLED="no"; fi],[])
AC_MSG_RESULT($PYTHON_ENABLED)
AC_MSG_CHECKING([whether to enable ncurses UI])
AC_ARG_WITH(ncurses,
AS_HELP_STRING([--without-ncurses],[disable ncurses ui]),
[if test "$withval" = "no"; then NCURSES_ENABLED="no"; fi],[])
AC_MSG_RESULT($NCURSES_ENABLED)
AC_MSG_CHECKING([whether to enable JACK I/O])
AC_ARG_WITH(jack,
AS_HELP_STRING([--without-jack],[disable JACK audio and MIDI]),
[if test "$withval" = "no"; then JACK_ENABLED="no"; fi],[])
AC_MSG_RESULT($JACK_ENABLED)
AC_MSG_CHECKING([whether to enable Fluidsynth])
AC_ARG_WITH(fluidsynth,
AS_HELP_STRING([--without-fluidsynth],[disable use of Fluidsynth]),
[if test "$withval" = "no"; then FLUIDSYNTH_ENABLED="no"; fi],[])
AC_MSG_RESULT($FLUIDSYNTH_ENABLED)
AC_MSG_CHECKING([whether to enable libsmf])
AC_ARG_WITH(libsmf,
AS_HELP_STRING([--without-libsmf],[disable use of libsmf]),
[if test "$withval" = "no"; then LIBSMF_ENABLED="no"; fi],[])
AC_MSG_RESULT($LIBSMF_ENABLED)
AC_MSG_CHECKING([whether to enable libusb])
AC_ARG_WITH(libusb,
AS_HELP_STRING([--without-libusb],[disable use of libusb]),
[if test "$withval" = "no"; then LIBUSB_ENABLED="no"; fi],[])
AC_MSG_RESULT($LIBUSB_ENABLED)
AC_MSG_CHECKING([whether to enable SSE (x86 family only)])
AC_ARG_WITH(sse,
AS_HELP_STRING([--with-sse],[enable use of SSE]),
[if test "$withval" = "yes"; then SSE_ENABLED="yes"; fi],[])
AC_MSG_RESULT($SSE_ENABLED)
AC_MSG_CHECKING([whether to enable NEON (ARM family only)])
AC_ARG_WITH(neon,
AS_HELP_STRING([--with-neon],[enable use of NEON]),
[if test "$withval" = "yes"; then NEON_ENABLED="yes"; fi],[])
AC_MSG_RESULT($NEON_ENABLED)
# Check dependencies
AC_CHECK_HEADER(uuid/uuid.h, true, AC_MSG_ERROR([libuuid header (uuid/uuid.h) is required]))
AC_CHECK_LIB(uuid, uuid_unparse, true, AC_MSG_ERROR([libuuid is required]))
PKG_CHECK_MODULES(GLIB_DEPS, glib-2.0 >= 2.6, true, AC_MSG_ERROR([libglib-2.0 is required]))
if test "$LIBUSB_ENABLED" = "yes"; then
PKG_CHECK_MODULES(LIBUSB_DEPS, libusb-1.0 >= 1.0, true, AC_MSG_ERROR([libusb-1.0 is required]))
fi
PKG_CHECK_MODULES(LIBSNDFILE_DEPS, sndfile, true, AC_MSG_ERROR([libsndfile is required]))
if test "$NCURSES_ENABLED" = "yes"; then
PKG_CHECK_MODULES(NCURSES_DEPS, ncurses, true, AC_MSG_ERROR([libncurses is required]))
fi
if test "$FLUIDSYNTH_ENABLED" = "yes"; then
PKG_CHECK_MODULES(FLUIDSYNTH_DEPS, fluidsynth >= 1.0.8, true, AC_MSG_ERROR([fluidsynth 1.0.8 is required]))
fi
if test "$LIBSMF_ENABLED" = "yes"; then
PKG_CHECK_MODULES(LIBSMF_DEPS, smf >= 1.3, true, AC_MSG_ERROR([libsmf 1.3 is required (libsmf.sourceforge.net)]))
fi
if test "$JACK_ENABLED" = "yes"; then
PKG_CHECK_MODULES(JACK_DEPS, jack >= 0.116.0, true, AC_MSG_ERROR([JACK is required (or use --without-jack)]))
AC_CHECK_HEADER(jack/jack.h, true, AC_MSG_ERROR([JACK is required (or use --without-jack)]))
PKG_CHECK_MODULES(JACK_RENAME_PORT, jack >= 0.124.2 jack < 1.9.0, JACK_HAS_RENAME="yes", JACK_HAS_RENAME="no")
PKG_CHECK_MODULES(JACK2_RENAME_PORT, jack >= 1.9.11, JACK_HAS_RENAME="yes", JACK_HAS_RENAME_DUMMY="no")
fi
if test "$PYTHON_ENABLED" = "yes"; then
PKG_CHECK_MODULES(PYTHON_DEPS, python3-embed >= 3.0, true, AC_MSG_ERROR([python 3.0 or newer is required (or use --without-python)]))
fi
# Generate Automake conditionals
AM_CONDITIONAL(USE_PYTHON, test "$PYTHON_ENABLED" = "yes")
AM_CONDITIONAL(USE_NCURSES, test "$NCURSES_ENABLED" = "yes")
AM_CONDITIONAL(USE_JACK, test "$JACK_ENABLED" = "yes")
AM_CONDITIONAL(USE_FLUIDSYNTH, test "$FLUIDSYNTH_ENABLED" = "yes")
AM_CONDITIONAL(USE_LIBSMF, test "$LIBSMF_ENABLED" = "yes")
AM_CONDITIONAL(USE_LIBUSB, test "$LIBUSB_ENABLED" = "yes")
AM_CONDITIONAL(USE_SSE, test "$SSE_ENABLED" = "yes")
AM_CONDITIONAL(USE_NEON, test "$NEON_ENABLED" = "yes")
# Generate config.h conditionals
if test "$PYTHON_ENABLED" = "yes"; then
AC_DEFINE(USE_PYTHON, 1, [Python will be included])
fi
if test "$NCURSES_ENABLED" = "yes"; then
AC_DEFINE(USE_NCURSES, 1, [ncurses will be included])
fi
if test "$JACK_ENABLED" = "yes"; then
AC_DEFINE(USE_JACK, 1, [JACK I/O will be included])
fi
if test "$JACK_HAS_RENAME" = "yes"; then
AC_DEFINE(JACK_HAS_RENAME, 1, [JACK function jack_port_rename should be used instead of jack_port_set_name])
fi
if test "$FLUIDSYNTH_ENABLED" = "yes"; then
AC_DEFINE(USE_FLUIDSYNTH, 1, [Fluidsynth will be included])
fi
if test "$LIBSMF_ENABLED" = "yes"; then
AC_DEFINE(USE_LIBSMF, 1, [libsmf will be used])
fi
if test "$LIBUSB_ENABLED" = "yes"; then
AC_DEFINE(USE_LIBUSB, 1, [libusb will be used])
fi
if test "$LIBUSB_ENABLED" = "no" && test "$JACK_ENABLED" = "no"; then
AC_MSG_ERROR([Neither JACK nor libusb are enabled, at least one is required])
fi
if test "$SSE_ENABLED" = "yes"; then
AC_DEFINE(USE_SSE, 1, [x86 Streaming SIMD Extensions will be used])
fi
if test "$NEON_ENABLED" = "yes"; then
AC_DEFINE(USE_NEON, 1, [ARM NEON SIMD Extensions will be used])
fi
# Generate files
AC_CONFIG_FILES([Makefile])
AC_OUTPUT