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

Annotation of /qsampler/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1740 - (hide annotations) (download)
Fri May 23 23:35:55 2008 UTC (15 years, 10 months ago) by capela
File size: 10923 byte(s)
* Attempt to load Qt's own translation support and get rid of
  the ever warning startup message, unless built in debug mode.
  (transaction by Guido Scholz, while on qsynth-devel, thanks).

* Only one application instance is now allowed to be up and running,
  with immediate but graceful termination upon startup iif an already
  running instance is detected, which will see its main widget shown
  up automatically (Qt/X11 platform only).

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

  ViewVC Help
Powered by ViewVC