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

Contents of /qsampler/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2107 - (show annotations) (download)
Sat Jul 10 09:47:33 2010 UTC (8 years, 2 months ago) by capela
File size: 12323 byte(s)
- Outrageous HACK: GTK+ ppl won't see green on black thing =)

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

  ViewVC Help
Powered by ViewVC