/[svn]/qsampler/trunk/configure.ac
ViewVC logotype

Contents of /qsampler/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC