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

Annotation of /qsampler/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC