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

Contents of /qsampler/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1840 - (show annotations) (download)
Thu Feb 19 11:44:57 2009 UTC (15 years, 1 month ago) by capela
File size: 11448 byte(s)
* Converted obsolete QMessageBox forms to standard buttons.

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

  ViewVC Help
Powered by ViewVC