1 |
# Process this file with autoconf to produce a configure script. |
2 |
AC_INIT(Qsampler, 0.2.3.1, rncbc@rncbc.org, qsampler) |
3 |
|
4 |
AC_CONFIG_SRCDIR(src/qsampler.cpp) |
5 |
AC_CONFIG_HEADERS(src/config.h) |
6 |
AC_CONFIG_FILES(Makefile qsampler.spec src/src.pri src/qsampler.desktop) |
7 |
|
8 |
# Set default installation prefix. |
9 |
AC_PREFIX_DEFAULT(/usr/local) |
10 |
ac_prefix=$prefix |
11 |
if test "x$ac_prefix" = "xNONE"; then |
12 |
ac_prefix=$ac_default_prefix |
13 |
fi |
14 |
AC_SUBST(ac_prefix) |
15 |
AC_DEFINE_UNQUOTED(CONFIG_PREFIX, ["$ac_prefix"], [Default installation prefix.]) |
16 |
|
17 |
# Enable debugging argument option. |
18 |
AC_ARG_ENABLE(debug, |
19 |
AC_HELP_STRING([--enable-debug], [enable debugging (default=no)]), |
20 |
[ac_debug="$enableval"]) |
21 |
|
22 |
if test "x$ac_debug" = "xyes"; then |
23 |
AC_DEFINE(CONFIG_DEBUG, 1, [Define if debugging is enabled.]) |
24 |
ac_stacktrace="yes" |
25 |
ac_debug="debug" |
26 |
else |
27 |
ac_stacktrace="no" |
28 |
ac_debug="release" |
29 |
fi |
30 |
AC_SUBST(ac_debug) |
31 |
|
32 |
|
33 |
# Enable Qt4/5 availability. |
34 |
AC_ARG_ENABLE(qt4, |
35 |
AC_HELP_STRING([--enable-qt4], [enable Qt4 build (default=yes)]), |
36 |
[ac_qt4="$enableval"], |
37 |
[ac_qt4="yes"]) |
38 |
|
39 |
AC_ARG_ENABLE(qt5, |
40 |
AC_HELP_STRING([--enable-qt5], [enable Qt5 build (default=no)]), |
41 |
[ac_qt5="$enableval"], |
42 |
[ac_qt5="no"]) |
43 |
|
44 |
if test "x$ac_qt4" = "xno"; then |
45 |
ac_qt5="yes" |
46 |
fi |
47 |
if test "x$ac_qt5" = "xyes"; then |
48 |
ac_qt4="no" |
49 |
fi |
50 |
|
51 |
|
52 |
# Enable libgig availability. |
53 |
AC_ARG_ENABLE(libgig, |
54 |
AC_HELP_STRING([--enable-libgig], [enable libgig interface (default=yes)]), |
55 |
[ac_libgig="$enableval"], |
56 |
[ac_libgig="yes"]) |
57 |
|
58 |
# Enable debugger stack-trace option (assumes --enable-debug). |
59 |
AC_ARG_ENABLE(stacktrace, |
60 |
AC_HELP_STRING([--enable-stacktrace], [enable debugger stack-trace (default=no)]), |
61 |
[ac_stacktrace="$enableval"]) |
62 |
|
63 |
|
64 |
# Standard installation base dirs. |
65 |
ac_with_paths="/usr /usr/local" |
66 |
|
67 |
# Set for alternate Qt installation dir. |
68 |
AC_ARG_WITH(qt, |
69 |
AC_HELP_STRING([--with-qt=PATH], [use alternate Qt install path]), |
70 |
[ac_with_paths="$ac_with_paths $withval"]) |
71 |
|
72 |
# Set for alternate liblscp installation dir. |
73 |
AC_ARG_WITH(liblscp, |
74 |
AC_HELP_STRING([--with-liblscp=PATH], [use alternate liblscp install path]), |
75 |
[ac_with_paths="$ac_with_paths $withval"]) |
76 |
|
77 |
# Set for alternate libgig installation dir. |
78 |
AC_ARG_WITH(libgig, |
79 |
AC_HELP_STRING([--with-libgig=PATH], [use alternate libgig install path]), |
80 |
[ac_with_paths="$ac_with_paths $withval"]) |
81 |
|
82 |
# Checks for programs. |
83 |
AC_PROG_CC |
84 |
AC_PROG_CPP |
85 |
AC_PROG_CXX |
86 |
AC_PROG_CXXCPP |
87 |
AC_PROG_GCC_TRADITIONAL |
88 |
|
89 |
# Checks for languages. |
90 |
AC_LANG_C |
91 |
AC_LANG_CPLUSPLUS |
92 |
|
93 |
|
94 |
# Check for proper flags. |
95 |
ac_arch=`uname -m` |
96 |
|
97 |
# Check for some a-la-debian alternatives... |
98 |
ac_qtdirs="qt" |
99 |
|
100 |
if test "x$ac_qt4" = "xyes"; then |
101 |
ac_qtdirs="qt4 $ac_qtdirs" |
102 |
fi |
103 |
if test "x$ac_qt5" = "xyes"; then |
104 |
ac_qtdirs="qt5 $ac_qtdirs" |
105 |
fi |
106 |
|
107 |
ac_topdirs="/usr/share /usr/lib" |
108 |
|
109 |
if test "x$ac_arch" = "xx86_64"; then |
110 |
CFLAGS="-fPIC $CFLAGS" |
111 |
CPPFLAGS="-fPIC $CPPFLAGS" |
112 |
ac_topdirs="$ac_topdirs /usr/lib64" |
113 |
fi |
114 |
|
115 |
for X in $ac_topdirs; do |
116 |
for Y in $ac_qtdirs; do |
117 |
if test -d $X/$Y/bin; then |
118 |
ac_with_paths="$X/$Y $ac_with_paths" |
119 |
fi |
120 |
done |
121 |
done |
122 |
|
123 |
# Prepend alternate dependencies paths. |
124 |
ac_path=$PATH |
125 |
for X in $ac_with_paths; do |
126 |
if test -d $X/bin; then |
127 |
ac_path="$X/bin:$ac_path" |
128 |
fi |
129 |
# if test -x $X/qmake; then |
130 |
# ac_path="$X:$ac_path" |
131 |
# fi |
132 |
if test -d $X/include; then |
133 |
for Y in $ac_qtdirs; do |
134 |
if test -d $X/include/$Y; then |
135 |
CFLAGS="-I$X/include/$Y $CFLAGS" |
136 |
CPPFLAGS="-I$X/include/$Y $CPPFLAGS" |
137 |
ac_incpath="$X/include/$Y $ac_incpath" |
138 |
fi |
139 |
done |
140 |
CFLAGS="-I$X/include $CFLAGS" |
141 |
CPPFLAGS="-I$X/include $CPPFLAGS" |
142 |
ac_incpath="$X/include $ac_incpath" |
143 |
fi |
144 |
if test "x$ac_arch" = "xx86_64" -a -d $X/lib64; then |
145 |
LIBS="-L$X/lib64 $LIBS" |
146 |
ac_libs="-L$X/lib64 $ac_libs" |
147 |
fi |
148 |
if test -d $X/lib; then |
149 |
LIBS="-L$X/lib $LIBS" |
150 |
ac_libs="-L$X/lib $ac_libs" |
151 |
fi |
152 |
done |
153 |
|
154 |
|
155 |
# Check for proper Qt version. |
156 |
AC_CACHE_CHECK([for Qt library version >= 4.4], |
157 |
ac_cv_qtversion, [ |
158 |
AC_TRY_LINK([#include "QtCore/qglobal.h"], [ |
159 |
#if QT_VERSION < 0x040400 |
160 |
#error Qt library 4.4 or greater required. |
161 |
#endif |
162 |
], ac_cv_qtversion="yes", [ |
163 |
echo "no; Qt 4.4 or greater is required" |
164 |
exit |
165 |
]) |
166 |
]) |
167 |
|
168 |
|
169 |
# A common error message: |
170 |
ac_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt-devel)." |
171 |
|
172 |
# Check for Qt qmake utility. |
173 |
AC_PATH_PROG(ac_qmake, qmake, [no], $ac_path) |
174 |
if test "x$ac_qmake" = "xno"; then |
175 |
AC_MSG_ERROR([qmake $ac_errmsg]) |
176 |
fi |
177 |
AC_SUBST(ac_qmake) |
178 |
|
179 |
# Check for Qt moc utility. |
180 |
AC_PATH_PROG(ac_moc, moc, [no], $ac_path) |
181 |
if test "x$ac_moc" = "xno"; then |
182 |
AC_MSG_ERROR([moc $ac_errmsg]) |
183 |
fi |
184 |
AC_SUBST(ac_moc) |
185 |
|
186 |
# Check for Qt uic utility. |
187 |
AC_PATH_PROG(ac_uic, uic, [no], $ac_path) |
188 |
if test "x$ac_uic" = "xno"; then |
189 |
AC_MSG_ERROR([uic $ac_errmsg]) |
190 |
fi |
191 |
AC_SUBST(ac_uic) |
192 |
|
193 |
# Check for Qt lupdate utility. |
194 |
AC_PATH_PROG(ac_lupdate, lupdate, [no], $ac_path) |
195 |
if test "x$ac_lupdate" = "xno"; then |
196 |
AC_MSG_ERROR([lupdate $ac_errmsg]) |
197 |
fi |
198 |
AC_SUBST(ac_lupdate) |
199 |
|
200 |
# Check for Qt lrelease utility. |
201 |
AC_PATH_PROG(ac_lrelease, lrelease, [no], $ac_path) |
202 |
if test "x$ac_release" = "xno"; then |
203 |
AC_MSG_ERROR([lrelease $ac_errmsg]) |
204 |
fi |
205 |
AC_SUBST(ac_lrelease) |
206 |
|
207 |
# Checks for libraries. |
208 |
AC_CHECK_LIB(m, main) |
209 |
AC_CHECK_LIB(X11, main) |
210 |
AC_CHECK_LIB(Xext, main) |
211 |
|
212 |
# Check for round math function. |
213 |
AC_CHECK_LIB(m, round, [ac_round="yes"], [ac_round="no"]) |
214 |
if test "x$ac_round" = "xyes"; then |
215 |
AC_DEFINE(CONFIG_ROUND, 1, [Define if round is available.]) |
216 |
fi |
217 |
|
218 |
# Check for mandatory libraries. |
219 |
AC_CHECK_LIB(lscp, main, [ac_liblscp="yes"], [ac_liblscp="no"]) |
220 |
if test "x$ac_liblscp" = "xno"; then |
221 |
AC_MSG_ERROR([LSCP library not found.]) |
222 |
fi |
223 |
ac_libs="$ac_libs -llscp" |
224 |
case "{$host}" in |
225 |
*mingw*) |
226 |
ac_libs="$ac_libs -lws2_32" |
227 |
LIBS="$LIBS -lws2_32" |
228 |
;; |
229 |
esac |
230 |
|
231 |
AC_CACHE_CHECK([for instrument_name in lscp_channel_info_t], |
232 |
ac_cv_instrument_name, [ |
233 |
AC_TRY_COMPILE([#include "lscp/client.h"], [ |
234 |
lscp_channel_info_t info; |
235 |
info.instrument_name = 0; |
236 |
], ac_cv_instrument_name="yes", ac_cv_instrument_name="no") |
237 |
]) |
238 |
ac_instrument_name=$ac_cv_instrument_name |
239 |
if test "x$ac_instrument_name" = "xyes"; then |
240 |
AC_DEFINE(CONFIG_INSTRUMENT_NAME, 1, [Define if instrument_name is available.]) |
241 |
fi |
242 |
|
243 |
AC_CACHE_CHECK([for mute/solo in lscp_channel_info_t], |
244 |
ac_cv_mute_solo, [ |
245 |
AC_TRY_COMPILE([#include "lscp/client.h"], [ |
246 |
lscp_channel_info_t info; |
247 |
info.mute = 0; |
248 |
info.solo = 0; |
249 |
], ac_cv_mute_solo="yes", ac_cv_mute_solo="no") |
250 |
]) |
251 |
ac_mute_solo=$ac_cv_mute_solo |
252 |
if test "x$ac_mute_solo" = "xyes"; then |
253 |
AC_CHECK_LIB(lscp, lscp_set_channel_mute, [ac_mute_solo="yes"], [ac_mute_solo="no"]) |
254 |
fi |
255 |
if test "x$ac_mute_solo" = "xyes"; then |
256 |
AC_CHECK_LIB(lscp, lscp_set_channel_solo, [ac_mute_solo="yes"], [ac_mute_solo="no"]) |
257 |
fi |
258 |
if test "x$ac_mute_solo" = "xyes"; then |
259 |
AC_DEFINE(CONFIG_MUTE_SOLO, 1, [Define if mute/solo is available.]) |
260 |
fi |
261 |
|
262 |
AC_CHECK_LIB(lscp, lscp_map_midi_instrument, [ac_midi_instrument="yes"], [ac_midi_instrument="no"]) |
263 |
if test "x$ac_midi_instrument" = "xyes"; then |
264 |
AC_DEFINE(CONFIG_MIDI_INSTRUMENT, 1, [Define if MIDI instrument mapping is available.]) |
265 |
fi |
266 |
|
267 |
AC_CHECK_LIB(lscp, lscp_create_fxsend, [ac_fxsend="yes"], [ac_fxsend="no"]) |
268 |
if test "x$ac_fxsend" = "xyes"; then |
269 |
AC_DEFINE(CONFIG_FXSEND, 1, [Define if FX sends is available.]) |
270 |
AC_CACHE_CHECK([for FX send level in lscp_fxsend_info_t], |
271 |
ac_cv_fxsend_level, [ |
272 |
AC_TRY_COMPILE([#include "lscp/client.h"], [ |
273 |
lscp_fxsend_info_t info; |
274 |
info.level = 0.0f; |
275 |
], ac_cv_fxsend_level="yes", ac_cv_fxsend_level="no") |
276 |
]) |
277 |
ac_fxsend_level=$ac_cv_fxsend_level |
278 |
if test "x$ac_fxsend_level" = "xyes"; then |
279 |
AC_DEFINE(CONFIG_FXSEND_LEVEL, 1, [Define if FX send level is available.]) |
280 |
fi |
281 |
AC_CHECK_LIB(lscp, lscp_set_fxsend_name, [ac_fxsend_rename="yes"], [ac_fxsend_rename="no"]) |
282 |
if test "x$ac_fxsend_rename" = "xyes"; then |
283 |
AC_DEFINE(CONFIG_FXSEND_RENAME, 1, [Define if FX send rename is available.]) |
284 |
fi |
285 |
fi |
286 |
|
287 |
AC_CACHE_CHECK([for audio_routing array type], |
288 |
ac_cv_audio_routing, [ |
289 |
AC_TRY_COMPILE([#include "lscp/client.h"], [ |
290 |
lscp_channel_info_t info; |
291 |
char ch = info.audio_routing[0][0]; |
292 |
], ac_cv_audio_routing="no", ac_cv_audio_routing="yes") |
293 |
]) |
294 |
ac_audio_routing=$ac_cv_audio_routing |
295 |
if test "x$ac_audio_routing" = "xyes"; then |
296 |
AC_DEFINE(CONFIG_AUDIO_ROUTING, 1, [Define if audio_routing is an integer array.]) |
297 |
fi |
298 |
|
299 |
AC_CHECK_LIB(lscp, lscp_set_volume, [ac_volume="yes"], [ac_volume="no"]) |
300 |
if test "x$ac_volume" = "xyes"; then |
301 |
AC_DEFINE(CONFIG_VOLUME, 1, [Define if global volume is available.]) |
302 |
fi |
303 |
|
304 |
AC_CHECK_LIB(lscp, lscp_edit_channel_instrument, [ac_edit_instrument="yes"], [ac_edit_instrument="no"]) |
305 |
if test "x$ac_edit_instrument" = "xyes"; then |
306 |
AC_DEFINE(CONFIG_EDIT_INSTRUMENT, 1, [Define if instrument editing is available.]) |
307 |
fi |
308 |
|
309 |
AC_CACHE_CHECK([for CHANNEL_MIDI LSCP event support in liblscp], |
310 |
ac_cv_channel_midi_event, [ |
311 |
AC_TRY_COMPILE([ |
312 |
#include "lscp/client.h" |
313 |
#include "lscp/event.h" |
314 |
], [ |
315 |
lscp_event_t ev; |
316 |
ev = LSCP_EVENT_CHANNEL_MIDI; |
317 |
], ac_cv_channel_midi_event="yes", ac_cv_channel_midi_event="no") |
318 |
]) |
319 |
ac_channel_midi_event=$ac_cv_channel_midi_event |
320 |
if test "x$ac_channel_midi_event" = "xyes"; then |
321 |
AC_DEFINE(CONFIG_EVENT_CHANNEL_MIDI, 1, [Define if LSCP CHANNEL_MIDI event support is available.]) |
322 |
fi |
323 |
|
324 |
AC_CACHE_CHECK([for DEVICE_MIDI LSCP event support in liblscp], |
325 |
ac_cv_device_midi_event, [ |
326 |
AC_TRY_COMPILE([ |
327 |
#include "lscp/client.h" |
328 |
#include "lscp/event.h" |
329 |
], [ |
330 |
lscp_event_t ev; |
331 |
ev = LSCP_EVENT_DEVICE_MIDI; |
332 |
], ac_cv_device_midi_event="yes", ac_cv_device_midi_event="no") |
333 |
]) |
334 |
ac_device_midi_event=$ac_cv_device_midi_event |
335 |
if test "x$ac_device_midi_event" = "xyes"; then |
336 |
AC_DEFINE(CONFIG_EVENT_DEVICE_MIDI, 1, [Define if LSCP DEVICE_MIDI event support is available.]) |
337 |
fi |
338 |
|
339 |
AC_CHECK_LIB(lscp, lscp_get_voices, [ac_max_voices="yes"], [ac_max_voices="no"]) |
340 |
if test "x$ac_max_voices" = "xyes"; then |
341 |
AC_DEFINE(CONFIG_MAX_VOICES, 1, [Define if max. voices / streams is available.]) |
342 |
fi |
343 |
|
344 |
# Check for optional libraries. |
345 |
if test "x$ac_libgig" = "xyes"; then |
346 |
AC_CHECK_LIB(gig, main, [ac_libgig="yes"], [ac_libgig="no"]) |
347 |
if test "x$ac_libgig" = "xyes"; then |
348 |
AC_DEFINE(CONFIG_LIBGIG, 1, [Define if libgig is available.]) |
349 |
ac_libs="$ac_libs -lgig" |
350 |
AC_MSG_CHECKING([for gig::File::SetAutoLoad() method in libgig]) |
351 |
AC_LANG_SAVE |
352 |
AC_LANG_CPLUSPLUS |
353 |
CXXFLAGS="$ac_libs" |
354 |
AC_TRY_COMPILE([ |
355 |
#include <stdlib.h> |
356 |
#include <gig.h> |
357 |
],[ |
358 |
gig::File file; |
359 |
file.SetAutoLoad(false); |
360 |
], |
361 |
have_libgig_setautoload="yes", |
362 |
have_libgig_setautoload="no" |
363 |
) |
364 |
AC_LANG_RESTORE |
365 |
AC_MSG_RESULT([$have_libgig_setautoload]) |
366 |
if test "x$have_libgig_setautoload" = "xyes"; then |
367 |
AC_DEFINE(HAVE_LIBGIG_SETAUTOLOAD, 1, [Define if libgig provides gig::File::SetAutoLoad() method.]) |
368 |
fi |
369 |
fi |
370 |
fi |
371 |
|
372 |
# Check for round math function. |
373 |
AC_CHECK_LIB(m, lroundf, [ac_round="yes"], [ac_round="no"]) |
374 |
if test "x$ac_round" = "xyes"; then |
375 |
AC_DEFINE(CONFIG_ROUND, 1, [Define if round is available.]) |
376 |
fi |
377 |
|
378 |
# Check for debugging stack-trace. |
379 |
if test "x$ac_stacktrace" = "xyes"; then |
380 |
AC_DEFINE(CONFIG_STACKTRACE, 1, [Define if debugger stack-trace is enabled.]) |
381 |
fi |
382 |
|
383 |
# Some recent distros (eg. fedora, debian) require this. |
384 |
if test "x$ac_cv_lib_X11_main" = "xyes"; then |
385 |
ac_libs="$ac_libs -lX11" |
386 |
fi |
387 |
|
388 |
AC_SUBST(ac_libs) |
389 |
AC_SUBST(ac_incpath) |
390 |
|
391 |
# Checks for header files. |
392 |
AC_HEADER_STDC |
393 |
AC_HEADER_SYS_WAIT |
394 |
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h signal.h sys/socket.h) |
395 |
|
396 |
AC_CHECK_HEADER(lscp/client.h, [ac_lscp_h="yes"], [ac_lscp_h="no"]) |
397 |
if test "x$ac_lscp_h" = "xno"; then |
398 |
AC_MSG_ERROR([LSCP headers not found.]) |
399 |
fi |
400 |
|
401 |
# Checks for typedefs, structures, and compiler characteristics. |
402 |
# AC_C_CONST |
403 |
|
404 |
# Checks for library functions. |
405 |
AC_CHECK_FUNCS(system) |
406 |
|
407 |
# Finally produce a configure header file and the makefiles. |
408 |
AC_OUTPUT |
409 |
|
410 |
# make clean > /dev/null 2>&1 |
411 |
|
412 |
# Output summary message |
413 |
|
414 |
echo |
415 |
echo " $PACKAGE_NAME $PACKAGE_VERSION" |
416 |
echo |
417 |
echo " Build target . . . . . . . . . . . . . . . . . . .: $ac_debug" |
418 |
echo |
419 |
echo " LSCP instrument name support . . . . . . . . . . .: $ac_instrument_name" |
420 |
echo " LSCP mute/solo support . . . . . . . . . . . . . .: $ac_mute_solo" |
421 |
echo " LSCP MIDI instrument support . . . . . . . . . . .: $ac_midi_instrument" |
422 |
echo " LSCP FX send support . . . . . . . . . . . . . . .: $ac_fxsend" |
423 |
echo " LSCP FX send level support . . . . . . . . . . . .: $ac_fxsend_level" |
424 |
echo " LSCP FX send rename support . . . . . . . . . . .: $ac_fxsend_rename" |
425 |
echo " LSCP audio routing support . . . . . . . . . . . .: $ac_audio_routing" |
426 |
echo " LSCP volume support . . . . . . . . . . . . . . .: $ac_volume" |
427 |
echo " LSCP edit instrument support . . . . . . . . . . .: $ac_edit_instrument" |
428 |
echo " GigaSampler instrument file support (libgig) . . .: $ac_libgig" |
429 |
if test "x$ac_libgig" = "xyes"; then |
430 |
echo " libgig supports fast information retrieval . . . .: $have_libgig_setautoload" |
431 |
fi |
432 |
echo " LSCP channel MIDI event support . . . . . . . . .: $ac_channel_midi_event" |
433 |
echo " LSCP device MIDI event support . . . . . . . . . .: $ac_device_midi_event" |
434 |
echo " LSCP runtime max. voices / disk streams support .: $ac_max_voices" |
435 |
echo |
436 |
echo " Debugger stack-trace (gdb) . . . . . . . . . . . .: $ac_stacktrace" |
437 |
echo |
438 |
echo " Install prefix . . . . . . . . . . . . . . . . . .: $ac_prefix" |
439 |
echo |
440 |
echo "Now type 'make', followed by 'make install' as root." |
441 |
echo |