1
# Process this file with autoconf to produce a configure script.
2
AC_INIT(synthv1, 0.3.6, rncbc@rncbc.org)
4
AC_CONFIG_SRCDIR(src/synthv1.cpp)
5
AC_CONFIG_HEADERS(src/config.h)
6
AC_CONFIG_FILES(Makefile synthv1.spec src/src_jack.pri src/src_lv2.pri src/synthv1.desktop)
8
# Set default installation prefix.
9
AC_PREFIX_DEFAULT(/usr/local)
11
if test "x$ac_prefix" = "xNONE"; then
12
ac_prefix=$ac_default_prefix
16
# Enable debugging argument option.
18
AC_HELP_STRING([--enable-debug], [enable debugging (default=no)]),
19
[ac_debug="$enableval"])
21
# Enable JACK standalone build.
23
AC_HELP_STRING([--enable-jack], [enable JACK stand-alone build (default=yes)]),
24
[ac_jack="$enableval"],
27
# Enable JACK session support.
28
AC_ARG_ENABLE(jack-session,
29
AC_HELP_STRING([--enable-jack-session], [enable JACK session support (default=yes)]),
30
[ac_jack_session="$enableval"],
31
[ac_jack_session="yes"])
33
# Enable JACK MIDI support option.
34
AC_ARG_ENABLE(jack-midi,
35
AC_HELP_STRING([--enable-jack-midi], [enable JACK MIDI support (default=yes)]),
36
[ac_jack_midi="$enableval"],
39
# Enable ALSA MIDI support option.
40
AC_ARG_ENABLE(alsa-midi,
41
AC_HELP_STRING([--enable-alsa-midi], [enable ALSA MIDI support (default=yes)]),
42
[ac_alsa_midi="$enableval"],
45
# Enable LV2 plugin build.
47
AC_HELP_STRING([--enable-lv2], [enable LV2 plug-in build (default=yes)]),
48
[ac_lv2="$enableval"],
51
AC_ARG_ENABLE(lv2-external-ui,
52
AC_HELP_STRING([--enable-lv2-external-ui], [enable LV2 plug-in External UI support (default=yes)]),
53
[ac_lv2_external_ui="$enableval"],
54
[ac_lv2_external_ui="yes"])
56
# Enable liblo availability.
58
AC_HELP_STRING([--enable-liblo], [enable liblo interface (default=yes)]),
59
[ac_liblo="$enableval"],
64
AC_HELP_STRING([--enable-nsm], [enable NSM support (default=yes)]),
65
[ac_nsm="$enableval"],
69
if test "x$ac_debug" = "xyes"; then
70
AC_DEFINE(CONFIG_DEBUG, 1, [Define if debugging is enabled.])
79
# Enable Qt4/5 availability.
81
AC_HELP_STRING([--enable-qt4], [enable Qt4 build (default=yes)]),
82
[ac_qt4="$enableval"],
86
AC_HELP_STRING([--enable-qt5], [enable Qt5 build (default=no)]),
87
[ac_qt5="$enableval"],
90
if test "x$ac_qt4" = "xno"; then
93
if test "x$ac_qt5" = "xyes"; then
97
# Standard installation base dirs.
98
ac_with_paths="/usr /usr/local"
102
if test "x$ac_qt4" = "xyes"; then
103
ac_qtdirs="qt4 $ac_qtdirs"
105
if test "x$ac_qt5" = "xyes"; then
106
ac_qtdirs="qt5 $ac_qtdirs"
109
# Some a-la-debian alternatives...
110
for X in /usr/lib /usr/lib64 /usr/share; do
111
for Y in $ac_qtdirs; do
112
if test -d $X/$Y/bin; then
113
ac_with_paths="$ac_with_paths $X/$Y"
118
# Set for alternate Qt installation dir.
120
AC_HELP_STRING([--with-qt=PATH], [use alternate Qt install path]),
121
[ac_with_paths="$ac_with_paths $withval"])
123
# Set for alternate ALSA installation dir.
125
AC_HELP_STRING([--with-alsa=PATH], [use alternate ALSA install path]),
126
[ac_with_paths="$ac_with_paths $withval"])
128
# Set for alternate JACK installation dir.
130
AC_HELP_STRING([--with-jack=PATH], [use alternate JACK install path]),
131
[ac_with_paths="$ac_with_paths $withval"])
133
# Set for alternate LV2 installation dir.
135
AC_HELP_STRING([--with-lv2=PATH], [use alternate LV2 install path]),
136
[ac_with_paths="$ac_with_paths $withval"])
138
# Set for alternate liblo installation dir.
140
AC_HELP_STRING([--with-liblo=PATH], [use alternate liblo path]),
141
[ac_with_paths="$ac_with_paths $withval"])
144
# Check for LV2 support.
145
if test "x$ac_lv2" = "xno"; then
146
ac_lv2_external_ui="no"
150
# Checks for programs.
155
AC_PROG_GCC_TRADITIONAL
157
# Checks for languages.
161
# Prepend alternate dependencies paths.
163
for X in $ac_with_paths; do
164
if test -d $X/bin; then
165
ac_path="$X/bin:$ac_path"
167
# if test -x $X/qmake; then
168
# ac_path="$X:$ac_path"
170
if test -d $X/include; then
171
for Y in $ac_qtdirs; do
172
if test -d $X/include/$Y; then
173
CFLAGS="-I$X/include/$Y $CFLAGS"
174
CPPFLAGS="-I$X/include/$Y $CPPFLAGS"
175
ac_incpath="$X/include/$Y $ac_incpath"
178
CFLAGS="-I$X/include $CFLAGS"
179
CPPFLAGS="-I$X/include $CPPFLAGS"
180
ac_incpath="$X/include $ac_incpath"
182
if test -d $X/lib64; then
183
LIBS="-L$X/lib64 $LIBS"
184
ac_libs="-L$X/lib64 $ac_libs"
186
if test -d $X/lib; then
187
LIBS="-L$X/lib $LIBS"
188
ac_libs="-L$X/lib $ac_libs"
193
# Check for proper flags.
195
if test "x$ac_arch" = "xx86_64"; then
196
CFLAGS="-fPIC $CFLAGS"
197
CPPFLAGS="-fPIC $CPPFLAGS"
200
# Check for proper Qt version.
201
AC_CACHE_CHECK([for Qt library version >= 4.4],
203
AC_TRY_LINK([#include "QtCore/qglobal.h"], [
204
#if QT_VERSION < 0x040400
205
#error Qt library 4.4 or greater required.
207
], ac_cv_qtversion="yes", [
208
echo "no; Qt 4.4 or greater is required"
214
ac_cflags="-ffast-math $ac_cflags"
218
# A common error message:
219
ac_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt-devel)."
221
# Check for Qt qmake utility.
222
AC_PATH_PROG(ac_qmake, qmake, [no], $ac_path)
223
if test "x$ac_qmake" = "xno"; then
224
AC_MSG_ERROR([qmake $ac_errmsg])
228
# Check for Qt moc utility.
229
AC_PATH_PROG(ac_moc, moc, [no], $ac_path)
230
if test "x$ac_moc" = "xno"; then
231
AC_MSG_ERROR([moc $ac_errmsg])
235
# Check for Qt uic utility.
236
AC_PATH_PROG(ac_uic, uic, [no], $ac_path)
237
if test "x$ac_uic" = "xno"; then
238
AC_MSG_ERROR([uic $ac_errmsg])
243
# Checks for libraries.
244
AC_CHECK_LIB(m, main)
245
AC_CHECK_LIB(X11, main)
246
AC_CHECK_LIB(Xext, main)
248
ac_jack_libs="$ac_libs"
249
ac_lv2_libs="$ac_libs"
251
# Check for JACK libraries.
252
if test "x$ac_jack" = "xyes"; then
253
AC_CHECK_LIB(jack, main, [ac_jack="yes"], [ac_jack="no"])
254
if test "x$ac_jack" = "xno"; then
255
AC_MSG_WARN([*** JACK library not found.])
256
AC_MSG_WARN([*** JACK stand-alone build will be disabled.])
258
ac_jack_libs="$ac_jack_libs -ljack"
262
if test "x$ac_jack" = "xyes"; then
263
# Check for JACK session event callback availability.
264
if test "x$ac_jack_session" = "xyes"; then
265
AC_CHECK_LIB(jack, jack_set_session_callback, [ac_jack_session="yes"], [ac_jack_session="no"])
267
AC_MSG_WARN([*** JACK session support will be disabled.])
269
# Check for ALSA libraries.
270
if test "x$ac_alsa_midi" = "xyes"; then
271
AC_CHECK_LIB(pthread, main, [ac_alsa_midi="yes"], [ac_alsa_midi="no"])
273
if test "x$ac_alsa_midi" = "xyes"; then
274
AC_CHECK_LIB(asound, main, [ac_alsa_midi="yes"], [ac_alsa_midi="no"])
275
if test "x$ac_alsa_midi" = "xno"; then
276
AC_MSG_WARN([*** ALSA library not found.])
277
AC_MSG_WARN([*** ALSA MIDI support will be disabled.])
279
ac_jack_libs="$ac_jack_libs -lasound -lpthread"
284
# Check for optional liblo library.
285
if test "x$ac_liblo" = "xyes"; then
286
AC_CHECK_LIB(lo, main, [ac_liblo="yes"], [ac_liblo="no"])
287
if test "x$ac_liblo" = "xyes"; then
288
AC_DEFINE(CONFIG_LIBLO, 1, [Define if liblo is available.])
289
ac_jack_libs="$ac_jack_libs -llo"
291
AC_MSG_WARN([*** liblo library not found.])
292
AC_MSG_WARN([*** OSC service support will be disabled.])
299
AC_SUBST(ac_jack_libs)
300
AC_SUBST(ac_lv2_libs)
303
# Checks for header files.
306
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/stat.h unistd.h signal.h)
308
ac_jack_incpath="$ac_incpath"
309
ac_lv2_incpath="$ac_incpath"
312
ac_install_targets=""
313
ac_uninstall_targets=""
316
# Check for JACK headers.
317
if test "x$ac_jack" = "xyes"; then
318
AC_CHECK_HEADERS(jack/jack.h, [ac_jack="yes"], [ac_jack="no"])
319
if test "x$ac_jack" = "xno"; then
320
AC_MSG_WARN([*** JACK header files not found.])
321
AC_MSG_WARN([*** JACK stand-alone build will be disabled.])
323
AC_DEFINE(CONFIG_JACK, 1, [Define if JACK stand-alone build is enabled.])
324
ac_all_targets="jack $ac_all_targets"
325
ac_install_targets="install_jack $ac_install_targets"
326
ac_uninstall_targets="uninstall_jack $ac_uninstall_targets"
327
ac_clean_targets="clean_jack $ac_clean_targets"
331
if test "x$ac_jack" = "xno"; then
339
# Check for JACK session headers availability.
340
if test "x$ac_jack_session" = "xyes"; then
341
AC_CHECK_HEADER(jack/session.h, [ac_jack_session="yes"], [ac_jack_session="no"])
342
if test "x$ac_jack_session" = "xyes"; then
343
AC_DEFINE(CONFIG_JACK_SESSION, 1, [Define if JACK session support is available.])
345
AC_MSG_WARN([*** JACK session header file not found.])
346
AC_MSG_WARN([*** JACK session support will be disabled.])
350
# Check for JACK MIDI headers availability.
351
if test "x$ac_jack_midi" = "xyes"; then
352
AC_CHECK_HEADER(jack/midiport.h, [ac_jack_midi="yes"], [ac_jack_midi="no"])
353
if test "x$ac_jack_midi" = "xyes"; then
354
AC_DEFINE(CONFIG_JACK_MIDI, 1, [Define if JACK MIDI support is enabled.])
356
AC_MSG_WARN([*** JACK MIDI header files not found.])
357
AC_MSG_WARN([*** JACK MIDI support will be disabled.])
361
# Check for ALSA MIDI headers availability.
362
if test "x$ac_alsa_midi" = "xyes"; then
363
AC_CHECK_HEADER(alsa/asoundlib.h, [ac_alsa_midi="yes"], [ac_alsa_midi="no"])
364
if test "x$ac_alsa_midi" = "xyes"; then
365
AC_DEFINE(CONFIG_ALSA_MIDI, 1, [Define if ALSA MIDI support is enabled.])
367
AC_MSG_WARN([*** ALSA MIDI header files not found.])
368
AC_MSG_WARN([*** ALSA MIDI support will be disabled.])
372
# Check for LV2 headers.
373
if test "x$ac_lv2" = "xyes"; then
374
AC_CHECK_HEADERS(lv2.h, [ac_lv2="yes"], [ac_lv2="no"])
375
if test "x$ac_lv2" = "xno"; then
376
AC_MSG_WARN([*** LV2 header files not found.])
378
AC_DEFINE(CONFIG_LV2, 1, [Define if LV2 plug-in build is enabled.])
379
ac_all_targets="lv2 lv2ui $ac_all_targets"
380
ac_install_targets="install_lv2 $ac_install_targets"
381
ac_uninstall_targets="uninstall_lv2 $ac_uninstall_targets"
382
ac_clean_targets="clean_lv2 $ac_clean_targets"
386
if test "x$ac_lv2" = "xno"; then
390
if test "x$ac_lv2_external_ui" = "xyes"; then
391
CFLAGS="$CFLAGS -Isrc/lv2"
392
CPPFLAGS="$CPPFLAGS -Isrc/lv2"
393
AC_CHECK_HEADER(lv2_external_ui.h, [ac_lv2_external_ui="yes"], [ac_lv2_external_ui="no"])
394
if test "x$ac_lv2_external_ui" = "xyes"; then
395
AC_DEFINE(CONFIG_LV2_EXTERNAL_UI, 1, [Define if LV2 External UI extension is available.])
396
ac_lv2_incpath="lv2 $ac_lv2_incpath"
398
AC_MSG_WARN([*** LV2 External UI extension will be disabled.])
402
# Check for liblo headers.
403
if test "x$ac_liblo" = "xyes"; then
404
AC_CHECK_HEADER(lo/lo.h, [ac_lo_h="yes"], [ac_lo_h="no"])
405
if test "x$ac_lo_h" = "xno"; then
406
AC_MSG_ERROR([lo.h header file not found.])
412
AC_SUBST(ac_all_targets)
413
AC_SUBST(ac_install_targets)
414
AC_SUBST(ac_uninstall_targets)
415
AC_SUBST(ac_clean_targets)
417
AC_SUBST(ac_jack_incpath)
418
AC_SUBST(ac_lv2_incpath)
421
# Check for NSM support.
422
if test "x$ac_nsm" = "xyes"; then
423
AC_DEFINE(CONFIG_NSM, 1, [Define if NSM support is available.])
427
# Checks for build targets
428
if test "x$ac_jack" = "xno" -a "x$ac_lv2" = "xno"; then
429
AC_MSG_ERROR([*** JACK and LV2 build options disabled.])
432
if test "x$ac_jack" = "xyes"; then
433
if test "x$ac_jack_midi" = "xno" -a "x$ac_alsa_midi" = "xno"; then
434
AC_MSG_ERROR([*** JACK MIDI and ALSA MIDI support disabled.])
439
# Checks for typedefs, structures, and compiler characteristics.
442
# Finally produce a configure header file and the makefiles.
445
# make clean > /dev/null 2>&1
447
# Output summary message
450
echo " $PACKAGE_NAME $PACKAGE_VERSION"
452
echo " Build target . . . . . . . . . . . . . . . . . . .: $ac_debug"
454
echo " JACK stand-alone build . . . . . . . . . . . . . .: $ac_jack"
455
echo " JACK session support . . . . . . . . . . . . . . .: $ac_jack_session"
456
echo " JACK MIDI support . . . . . . . . . . . . . . . .: $ac_jack_midi"
457
echo " ALSA MIDI support . . . . . . . . . . . . . . . .: $ac_alsa_midi"
458
echo " LV2 plug-in build . . . . . . . . . . . . . . . .: $ac_lv2"
459
echo " LV2 plug-in External UI support . . . . . . . . .: $ac_lv2_external_ui"
460
echo " OSC service support (liblo) . . . . . . . . . . .: $ac_liblo"
461
echo " NSM (Non Session Management) support . . . . . . .: $ac_nsm"
463
echo " Install prefix . . . . . . . . . . . . . . . . . .: $ac_prefix"
465
echo "Now type 'make', followed by 'make install' as root."