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