1
# Process this file with autoconf to produce a configure script.
2
AC_INIT(drumkv1, 0.3.6, rncbc@rncbc.org)
4
AC_CONFIG_SRCDIR(src/drumkv1.cpp)
5
AC_CONFIG_HEADERS(src/config.h)
6
AC_CONFIG_FILES(Makefile drumkv1.spec src/src_jack.pri src/src_lv2.pri src/drumkv1.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/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 libsndfile installation dir.
140
AC_HELP_STRING([--with-sndfile=PATH], [use alternate libsndfile path]),
141
[ac_with_paths="$ac_with_paths $withval"])
143
# Set for alternate liblo installation dir.
145
AC_HELP_STRING([--with-liblo=PATH], [use alternate liblo path]),
146
[ac_with_paths="$ac_with_paths $withval"])
149
# Check for LV2 support.
150
if test "x$ac_lv2" = "xno"; then
151
ac_lv2_external_ui="no"
155
# Checks for programs.
160
AC_PROG_GCC_TRADITIONAL
162
# Checks for languages.
166
# Prepend alternate dependencies paths.
168
for X in $ac_with_paths; do
169
if test -d $X/bin; then
170
ac_path="$X/bin:$ac_path"
172
# if test -x $X/qmake; then
173
# ac_path="$X:$ac_path"
175
if test -d $X/include; then
176
for Y in $ac_qtdirs; do
177
if test -d $X/include/$Y; then
178
CFLAGS="-I$X/include/$Y $CFLAGS"
179
CPPFLAGS="-I$X/include/$Y $CPPFLAGS"
180
ac_incpath="$X/include/$Y $ac_incpath"
183
CFLAGS="-I$X/include $CFLAGS"
184
CPPFLAGS="-I$X/include $CPPFLAGS"
185
ac_incpath="$X/include $ac_incpath"
187
if test -d $X/lib; then
188
LIBS="-L$X/lib $LIBS"
189
ac_libs="-L$X/lib $ac_libs"
194
# Check for proper flags.
196
if test "x$ac_arch" = "xx86_64"; then
197
CFLAGS="-fPIC $CFLAGS"
198
CPPFLAGS="-fPIC $CPPFLAGS"
201
# Check for proper Qt version.
202
AC_CACHE_CHECK([for Qt library version >= 4.4],
204
AC_TRY_LINK([#include "QtCore/qglobal.h"], [
205
#if QT_VERSION < 0x040400
206
#error Qt library 4.4 or greater required.
208
], ac_cv_qtversion="yes", [
209
echo "no; Qt 4.4 or greater is required"
215
ac_cflags="-ffast-math $ac_cflags"
219
# A common error message:
220
ac_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt-devel)."
222
# Check for Qt qmake utility.
223
AC_PATH_PROG(ac_qmake, qmake, [no], $ac_path)
224
if test "x$ac_qmake" = "xno"; then
225
AC_MSG_ERROR([qmake $ac_errmsg])
229
# Check for Qt moc utility.
230
AC_PATH_PROG(ac_moc, moc, [no], $ac_path)
231
if test "x$ac_moc" = "xno"; then
232
AC_MSG_ERROR([moc $ac_errmsg])
236
# Check for Qt uic utility.
237
AC_PATH_PROG(ac_uic, uic, [no], $ac_path)
238
if test "x$ac_uic" = "xno"; then
239
AC_MSG_ERROR([uic $ac_errmsg])
244
# Checks for libraries.
245
AC_CHECK_LIB(m, main)
246
AC_CHECK_LIB(X11, main)
247
AC_CHECK_LIB(Xext, main)
249
ac_jack_libs="$ac_libs"
250
ac_lv2_libs="$ac_libs"
252
# Check for JACK libraries.
253
if test "x$ac_jack" = "xyes"; then
254
AC_CHECK_LIB(jack, main, [ac_jack="yes"], [ac_jack="no"])
255
if test "x$ac_jack" = "xno"; then
256
AC_MSG_WARN([*** JACK library not found.])
257
AC_MSG_WARN([*** JACK stand-alone build will be disabled.])
259
ac_jack_libs="$ac_jack_libs -ljack"
263
if test "x$ac_jack" = "xyes"; then
264
# Check for JACK session event callback availability.
265
if test "x$ac_jack_session" = "xyes"; then
266
AC_CHECK_LIB(jack, jack_set_session_callback, [ac_jack_session="yes"], [ac_jack_session="no"])
268
AC_MSG_WARN([*** JACK session support will be disabled.])
270
# Check for ALSA libraries.
271
if test "x$ac_alsa_midi" = "xyes"; then
272
AC_CHECK_LIB(pthread, main, [ac_alsa_midi="yes"], [ac_alsa_midi="no"])
274
if test "x$ac_alsa_midi" = "xyes"; then
275
AC_CHECK_LIB(asound, main, [ac_alsa_midi="yes"], [ac_alsa_midi="no"])
276
if test "x$ac_alsa_midi" = "xno"; then
277
AC_MSG_WARN([*** ALSA library not found.])
278
AC_MSG_WARN([*** ALSA MIDI support will be disabled.])
280
ac_jack_libs="$ac_jack_libs -lasound -lpthread"
285
# Check for sndfile library.
286
AC_CHECK_LIB(sndfile, main, [ac_sndfile="yes"], [ac_sndfile="no"])
287
if test "x$ac_sndfile" = "xno"; then
288
AC_MSG_ERROR([*** sndfile library not found.])
290
ac_jack_libs="$ac_jack_libs -lsndfile"
291
ac_lv2_libs="$ac_lv2_libs -lsndfile"
294
# Check for optional liblo library.
295
if test "x$ac_liblo" = "xyes"; then
296
AC_CHECK_LIB(lo, main, [ac_liblo="yes"], [ac_liblo="no"])
297
if test "x$ac_liblo" = "xyes"; then
298
AC_DEFINE(CONFIG_LIBLO, 1, [Define if liblo is available.])
299
ac_jack_libs="$ac_jack_libs -llo"
301
AC_MSG_WARN([*** liblo library not found.])
302
AC_MSG_WARN([*** OSC service support will be disabled.])
309
AC_SUBST(ac_jack_libs)
310
AC_SUBST(ac_lv2_libs)
313
# Checks for header files.
316
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/stat.h unistd.h signal.h)
318
ac_jack_incpath="$ac_incpath"
319
ac_lv2_incpath="$ac_incpath"
322
ac_install_targets=""
323
ac_uninstall_targets=""
326
# Check for JACK headers.
327
if test "x$ac_jack" = "xyes"; then
328
AC_CHECK_HEADERS(jack/jack.h, [ac_jack="yes"], [ac_jack="no"])
329
if test "x$ac_jack" = "xno"; then
330
AC_MSG_WARN([*** JACK header files not found.])
331
AC_MSG_WARN([*** JACK stand-alone build will be disabled.])
333
AC_DEFINE(CONFIG_JACK, 1, [Define if JACK stand-alone build is enabled.])
334
ac_all_targets="jack $ac_all_targets"
335
ac_install_targets="install_jack $ac_install_targets"
336
ac_uninstall_targets="uninstall_jack $ac_uninstall_targets"
337
ac_clean_targets="clean_jack $ac_clean_targets"
341
if test "x$ac_jack" = "xno"; then
349
# Check for JACK session headers availability.
350
if test "x$ac_jack_session" = "xyes"; then
351
AC_CHECK_HEADER(jack/session.h, [ac_jack_session="yes"], [ac_jack_session="no"])
352
if test "x$ac_jack_session" = "xyes"; then
353
AC_DEFINE(CONFIG_JACK_SESSION, 1, [Define if JACK session support is available.])
355
AC_MSG_WARN([*** JACK session header file not found.])
356
AC_MSG_WARN([*** JACK session support will be disabled.])
360
# Check for JACK MIDI headers availability.
361
if test "x$ac_jack_midi" = "xyes"; then
362
AC_CHECK_HEADER(jack/midiport.h, [ac_jack_midi="yes"], [ac_jack_midi="no"])
363
if test "x$ac_jack_midi" = "xyes"; then
364
AC_DEFINE(CONFIG_JACK_MIDI, 1, [Define if JACK MIDI support is enabled.])
366
AC_MSG_WARN([*** JACK MIDI header files not found.])
367
AC_MSG_WARN([*** JACK MIDI support will be disabled.])
371
# Check for ALSA MIDI headers availability.
372
if test "x$ac_alsa_midi" = "xyes"; then
373
AC_CHECK_HEADER(alsa/asoundlib.h, [ac_alsa_midi="yes"], [ac_alsa_midi="no"])
374
if test "x$ac_alsa_midi" = "xyes"; then
375
AC_DEFINE(CONFIG_ALSA_MIDI, 1, [Define if ALSA MIDI support is enabled.])
377
AC_MSG_WARN([*** ALSA MIDI header files not found.])
378
AC_MSG_WARN([*** ALSA MIDI support will be disabled.])
382
# Check for LV2 headers.
383
if test "x$ac_lv2" = "xyes"; then
384
AC_CHECK_HEADERS(lv2.h, [ac_lv2="yes"], [ac_lv2="no"])
385
if test "x$ac_lv2" = "xno"; then
386
AC_MSG_WARN([*** LV2 header files not found.])
388
AC_DEFINE(CONFIG_LV2, 1, [Define if LV2 plug-in build is enabled.])
389
ac_all_targets="lv2 lv2ui $ac_all_targets"
390
ac_install_targets="install_lv2 $ac_install_targets"
391
ac_uninstall_targets="uninstall_lv2 $ac_uninstall_targets"
392
ac_clean_targets="clean_lv2 $ac_clean_targets"
396
if test "x$ac_lv2" = "xno"; then
400
if test "x$ac_lv2_external_ui" = "xyes"; then
401
CFLAGS="$CFLAGS -Isrc/lv2"
402
CPPFLAGS="$CPPFLAGS -Isrc/lv2"
403
AC_CHECK_HEADER(lv2_external_ui.h, [ac_lv2_external_ui="yes"], [ac_lv2_external_ui="no"])
404
if test "x$ac_lv2_external_ui" = "xyes"; then
405
AC_DEFINE(CONFIG_LV2_EXTERNAL_UI, 1, [Define if LV2 External UI extension is available.])
406
ac_lv2_incpath="lv2 $ac_lv2_incpath"
408
AC_MSG_WARN([*** LV2 External UI extension will be disabled.])
412
# Check for liblo headers.
413
if test "x$ac_liblo" = "xyes"; then
414
AC_CHECK_HEADER(lo/lo.h, [ac_lo_h="yes"], [ac_lo_h="no"])
415
if test "x$ac_lo_h" = "xno"; then
416
AC_MSG_ERROR([lo.h header file not found.])
422
AC_SUBST(ac_all_targets)
423
AC_SUBST(ac_install_targets)
424
AC_SUBST(ac_uninstall_targets)
425
AC_SUBST(ac_clean_targets)
427
AC_SUBST(ac_jack_incpath)
428
AC_SUBST(ac_lv2_incpath)
431
# Check for NSM support.
432
if test "x$ac_nsm" = "xyes"; then
433
AC_DEFINE(CONFIG_NSM, 1, [Define if NSM support is available.])
437
# Checks for build targets
438
if test "x$ac_jack" = "xno" -a "x$ac_lv2" = "xno"; then
439
AC_MSG_ERROR([*** JACK and LV2 build options disabled.])
442
if test "x$ac_jack" = "xyes"; then
443
if test "x$ac_jack_midi" = "xno" -a "x$ac_alsa_midi" = "xno"; then
444
AC_MSG_ERROR([*** JACK MIDI and ALSA MIDI support disabled.])
449
# Checks for typedefs, structures, and compiler characteristics.
452
# Finally produce a configure header file and the makefiles.
455
# make clean > /dev/null 2>&1
457
# Output summary message
460
echo " $PACKAGE_NAME $PACKAGE_VERSION"
462
echo " Build target . . . . . . . . . . . . . . . . . . .: $ac_debug"
464
echo " JACK stand-alone build . . . . . . . . . . . . . .: $ac_jack"
465
echo " JACK session support . . . . . . . . . . . . . . .: $ac_jack_session"
466
echo " JACK MIDI support . . . . . . . . . . . . . . . .: $ac_jack_midi"
467
echo " ALSA MIDI support . . . . . . . . . . . . . . . .: $ac_alsa_midi"
468
echo " LV2 plug-in build . . . . . . . . . . . . . . . .: $ac_lv2"
469
echo " LV2 plug-in External UI support . . . . . . . . .: $ac_lv2_external_ui"
470
echo " OSC service support (liblo) . . . . . . . . . . .: $ac_liblo"
471
echo " NSM (Non Session Management) support . . . . . . .: $ac_nsm"
473
echo " Install prefix . . . . . . . . . . . . . . . . . .: $ac_prefix"
475
echo "Now type 'make', followed by 'make install' as root."