1 |
# Process this file with autoconf to produce a configure script. |
2 |
AC_INIT(Qsampler, 0.1.4.5, rncbc@rncbc.org, qsampler) |
3 |
AC_CONFIG_SRCDIR(src/qsamplerMainForm.ui.h) |
4 |
AC_CONFIG_HEADERS(config.h) |
5 |
AC_CONFIG_FILES(Makefile qsampler.pro qsampler.spec qsampler.desktop) |
6 |
|
7 |
# Set default installation prefix. |
8 |
AC_PREFIX_DEFAULT(/usr/local) |
9 |
ac_prefix=$prefix |
10 |
if test "x$ac_prefix" = "xNONE"; then |
11 |
ac_prefix=$ac_default_prefix |
12 |
fi |
13 |
AC_SUBST(ac_prefix) |
14 |
AC_DEFINE_UNQUOTED(CONFIG_PREFIX, ["$ac_prefix"], [Default installation prefix.]) |
15 |
|
16 |
# Enable debugging argument option. |
17 |
AC_ARG_ENABLE(debug, |
18 |
AC_HELP_STRING([--enable-debug], [enable debugging (default=no)]), |
19 |
[ac_debug="$enableval"]) |
20 |
|
21 |
if test "x$ac_debug" = "xyes"; then |
22 |
AC_DEFINE(CONFIG_DEBUG, 1, [Define if debugging is enabled.]) |
23 |
ac_debug="debug" |
24 |
else |
25 |
ac_debug="release" |
26 |
fi |
27 |
AC_SUBST(ac_debug) |
28 |
|
29 |
# Enable libgig availability. |
30 |
AC_ARG_ENABLE(libgig, |
31 |
AC_HELP_STRING([--enable-libgig], [enable libgig interface (default=yes)]), |
32 |
[ac_libgig="$enableval"], |
33 |
[ac_libgig="yes"]) |
34 |
|
35 |
# Standard installation base dirs. |
36 |
ac_with_paths="/usr /usr/local" |
37 |
|
38 |
# Some a-la-debian alternatives... |
39 |
for X in /usr/lib /usr/share; do |
40 |
for Y in qt qt3; do |
41 |
if test -d $X/$Y/bin; then |
42 |
ac_with_paths="$ac_with_paths $X/$Y" |
43 |
fi |
44 |
done |
45 |
done |
46 |
|
47 |
# Set for alternate liblscp installation dir. |
48 |
AC_ARG_WITH(liblscp, |
49 |
AC_HELP_STRING([--with-liblscp=PATH], [use alternate liblscp install path]), |
50 |
[ac_with_paths="$ac_with_paths $withval"]) |
51 |
|
52 |
# Set for alternate libgig installation dir. |
53 |
AC_ARG_WITH(libgig, |
54 |
AC_HELP_STRING([--with-libgig=PATH], [use alternate libgig install path]), |
55 |
[ac_with_paths="$ac_with_paths $withval"]) |
56 |
|
57 |
# Checks for programs. |
58 |
AC_PROG_CC |
59 |
AC_PROG_CPP |
60 |
AC_PROG_CXX |
61 |
AC_PROG_CXXCPP |
62 |
AC_PROG_GCC_TRADITIONAL |
63 |
|
64 |
# Checks for languages. |
65 |
AC_LANG_C |
66 |
AC_LANG_CPLUSPLUS |
67 |
|
68 |
# Check for QTDIR environment variable. |
69 |
AC_MSG_CHECKING([whether QTDIR environment variable is set]) |
70 |
if test "x$QTDIR" = "x"; then |
71 |
AC_MSG_RESULT([no]) |
72 |
else |
73 |
AC_MSG_RESULT([$QTDIR]) |
74 |
ac_with_paths="$ac_with_paths $QTDIR" |
75 |
fi |
76 |
|
77 |
# Prepend alternate dependencies paths. |
78 |
ac_path=$PATH |
79 |
for X in $ac_with_paths; do |
80 |
if test -d $X/bin; then |
81 |
ac_path="$X/bin:$ac_path" |
82 |
fi |
83 |
if test -d $X/include; then |
84 |
for Y in qt qt3; 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 |
# Checks for Qt library. |
106 |
for X in qt-mt qt; do |
107 |
if test "x$ac_qtlib" = "x"; then |
108 |
AC_CHECK_LIB($X, main, [ac_qtlib=$X]) |
109 |
fi |
110 |
done |
111 |
if test "x$ac_qtlib" = "x"; then |
112 |
AC_MSG_ERROR([Qt library not found. Maybe QTDIR isn't properly set.]) |
113 |
fi |
114 |
AC_SUBST(ac_qtlib) |
115 |
|
116 |
# Check for Qt multi-thread support. |
117 |
if test "x$ac_qtlib" = "xqt-mt"; then |
118 |
ac_thread="thread" |
119 |
fi |
120 |
AC_SUBST(ac_thread) |
121 |
|
122 |
AC_CACHE_CHECK([for Qt library version >= 3.1.1], |
123 |
ac_qtlib_version, [ |
124 |
AC_TRY_LINK([#include "qglobal.h"], [ |
125 |
#if QT_VERSION < 0x030101 |
126 |
#error Qt library 3.1.1 or greater required. |
127 |
#endif |
128 |
], |
129 |
ac_qtlib_version="yes", [ |
130 |
echo "no; Qt 3.1.1 or greater is required" |
131 |
exit |
132 |
]) |
133 |
]) |
134 |
|
135 |
# A common error message: |
136 |
ac_qtdir_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt3-devel)." |
137 |
|
138 |
# Check for Qt qmake utility. |
139 |
AC_PATH_PROG(ac_qmake, qmake, [no], $ac_path) |
140 |
if test "x$ac_qmake" = "xno"; then |
141 |
AC_MSG_ERROR([qmake $ac_qtdir_errmsg]) |
142 |
fi |
143 |
AC_SUBST(ac_qmake) |
144 |
|
145 |
# Check for Qt moc utility. |
146 |
AC_PATH_PROG(ac_moc, moc, [no], $ac_path) |
147 |
if test "x$ac_moc" = "xno"; then |
148 |
AC_MSG_ERROR([moc $ac_qtdir_errmsg]) |
149 |
fi |
150 |
AC_SUBST(ac_moc) |
151 |
|
152 |
# Check for Qt uic utility. |
153 |
AC_PATH_PROG(ac_uic, uic, [no], $ac_path) |
154 |
if test "x$ac_uic" = "xno"; then |
155 |
AC_MSG_ERROR([uic $ac_qtdir_errmsg]) |
156 |
fi |
157 |
AC_SUBST(ac_uic) |
158 |
|
159 |
# Checks for libraries. |
160 |
AC_CHECK_LIB(m, main) |
161 |
AC_CHECK_LIB(X11, main) |
162 |
AC_CHECK_LIB(Xext, main) |
163 |
AC_CHECK_LIB($ac_qtlib, main) |
164 |
|
165 |
# Check for round math function. |
166 |
AC_CHECK_LIB(m, round, [ac_round="yes"], [ac_round="no"]) |
167 |
if test "x$ac_round" = "xyes"; then |
168 |
AC_DEFINE(CONFIG_ROUND, 1, [Define if round is available.]) |
169 |
fi |
170 |
|
171 |
# Check for mandatory libraries. |
172 |
AC_CHECK_LIB(lscp, main, [ac_liblscp="yes"], [ac_liblscp="no"]) |
173 |
if test "x$ac_liblscp" = "xno"; then |
174 |
AC_MSG_ERROR([LSCP library not found.]) |
175 |
fi |
176 |
ac_libs="$ac_libs -llscp" |
177 |
|
178 |
AC_CACHE_CHECK([for instrument_name in lscp_channel_info_t], |
179 |
ac_instrument_name, [ |
180 |
AC_TRY_COMPILE([#include "lscp/client.h"], [ |
181 |
lscp_channel_info_t info; |
182 |
info.instrument_name = 0; |
183 |
], ac_instrument_name="yes", ac_instrument_name="no") |
184 |
]) |
185 |
if test "x$ac_instrument_name" = "xyes"; then |
186 |
AC_DEFINE(CONFIG_INSTRUMENT_NAME, 1, [Define if instrument_name is available.]) |
187 |
fi |
188 |
|
189 |
AC_CACHE_CHECK([for mute/solo in lscp_channel_info_t], |
190 |
ac_mute_solo, [ |
191 |
AC_TRY_COMPILE([#include "lscp/client.h"], [ |
192 |
lscp_channel_info_t info; |
193 |
info.mute = 0; |
194 |
info.solo = 0; |
195 |
], ac_mute_solo="yes", ac_mute_solo="no") |
196 |
]) |
197 |
if test "x$ac_mute_solo" = "xyes"; then |
198 |
AC_CHECK_LIB(lscp, lscp_set_channel_mute, [ac_mute_solo="yes"], [ac_mute_solo="no"]) |
199 |
fi |
200 |
if test "x$ac_mute_solo" = "xyes"; then |
201 |
AC_CHECK_LIB(lscp, lscp_set_channel_solo, [ac_mute_solo="yes"], [ac_mute_solo="no"]) |
202 |
fi |
203 |
if test "x$ac_mute_solo" = "xyes"; then |
204 |
AC_DEFINE(CONFIG_MUTE_SOLO, 1, [Define if mute/solo is available.]) |
205 |
fi |
206 |
|
207 |
AC_CHECK_LIB(lscp, lscp_map_midi_instrument, [ac_midi_instrument="yes"], [ac_midi_instrument="no"]) |
208 |
if test "x$ac_midi_instrument" = "xyes"; then |
209 |
AC_DEFINE(CONFIG_MIDI_INSTRUMENT, 1, [Define if MIDI instrument mapping is available.]) |
210 |
fi |
211 |
|
212 |
AC_CHECK_LIB(lscp, lscp_create_fxsend, [ac_fxsend="yes"], [ac_fxsend="no"]) |
213 |
if test "x$ac_fxsend" = "xyes"; then |
214 |
AC_DEFINE(CONFIG_FXSEND, 1, [Define if FX sends is available.]) |
215 |
AC_CACHE_CHECK([for FX send level in lscp_fxsend_info_t], |
216 |
ac_fxsend_level, [ |
217 |
AC_TRY_COMPILE([#include "lscp/client.h"], [ |
218 |
lscp_fxsend_info_t info; |
219 |
info.level = 0.0f; |
220 |
], ac_fxsend_level="yes", ac_fxsend_level="no") |
221 |
]) |
222 |
if test "x$ac_fxsend_level" = "xyes"; then |
223 |
AC_DEFINE(CONFIG_FXSEND_LEVEL, 1, [Define if FX send level is available.]) |
224 |
fi |
225 |
fi |
226 |
|
227 |
AC_CACHE_CHECK([for audio_routing array type], |
228 |
ac_audio_routing, [ |
229 |
AC_TRY_COMPILE([#include "lscp/client.h"], [ |
230 |
lscp_channel_info_t info; |
231 |
char ch = info.audio_routing[0][0]; |
232 |
], ac_audio_routing="no", ac_audio_routing="yes") |
233 |
]) |
234 |
if test "x$ac_audio_routing" = "xyes"; then |
235 |
AC_DEFINE(CONFIG_AUDIO_ROUTING, 1, [Define if audio_routing is an integer array.]) |
236 |
fi |
237 |
|
238 |
AC_CHECK_LIB(lscp, lscp_set_volume, [ac_volume="yes"], [ac_volume="no"]) |
239 |
if test "x$ac_volume" = "xyes"; then |
240 |
AC_DEFINE(CONFIG_VOLUME, 1, [Define if global volume is available.]) |
241 |
fi |
242 |
|
243 |
AC_CHECK_LIB(lscp, lscp_edit_instrument, [ac_edit_instrument="yes"], [ac_edit_instrument="no"]) |
244 |
if test "x$ac_edit_instrument" = "xyes"; then |
245 |
AC_DEFINE(CONFIG_EDIT_INSTRUMENT, 1, [Define if instrument editing is available.]) |
246 |
fi |
247 |
|
248 |
# Check for optional libraries. |
249 |
if test "x$ac_libgig" = "xyes"; then |
250 |
AC_CHECK_LIB(gig, main, [ac_libgig="yes"], [ac_libgig="no"]) |
251 |
if test "x$ac_libgig" = "xyes"; then |
252 |
AC_DEFINE(CONFIG_LIBGIG, 1, [Define if libgig is available.]) |
253 |
ac_libs="$ac_libs -lgig" |
254 |
fi |
255 |
fi |
256 |
|
257 |
# Check for round math function. |
258 |
AC_CHECK_LIB(m, lroundf, [ac_round="yes"], [ac_round="no"]) |
259 |
if test "x$ac_round" = "xyes"; then |
260 |
AC_DEFINE(CONFIG_ROUND, 1, [Define if round is available.]) |
261 |
fi |
262 |
|
263 |
AC_SUBST(ac_libs) |
264 |
AC_SUBST(ac_incpath) |
265 |
|
266 |
# Checks for header files. |
267 |
AC_HEADER_STDC |
268 |
AC_HEADER_SYS_WAIT |
269 |
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h signal.h) |
270 |
|
271 |
AC_CHECK_HEADER(lscp/client.h, [ac_lscp_h="yes"], [ac_lscp_h="no"]) |
272 |
if test "x$ac_lscp_h" = "xno"; then |
273 |
AC_MSG_ERROR([LSCP headers not found.]) |
274 |
fi |
275 |
|
276 |
# Checks for typedefs, structures, and compiler characteristics. |
277 |
# AC_C_CONST |
278 |
|
279 |
# Checks for library functions. |
280 |
AC_CHECK_FUNCS(system) |
281 |
|
282 |
# Finally produce a configure header file and the makefiles. |
283 |
AC_OUTPUT |
284 |
|
285 |
# make clean > /dev/null 2>&1 |
286 |
|
287 |
echo "" |
288 |
echo "Now type 'make', followed by 'make install' as root." |
289 |
echo "" |