1 |
# Process this file with autoconf to produce a configure script. |
2 |
AC_INIT(Qsampler, 0.1.2.16, 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) |
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="debug"], |
20 |
[ac_debug="release"]) |
21 |
AC_SUBST(ac_debug) |
22 |
|
23 |
if test "x$ac_debug" = "xdebug"; then |
24 |
AC_DEFINE(CONFIG_DEBUG, 1, [Define if debugging is enabled.]) |
25 |
fi |
26 |
|
27 |
# Enable libgig availability. |
28 |
AC_ARG_ENABLE(libgig, |
29 |
AC_HELP_STRING([--disable-libgig], [disable libgig interface (default=no)]), |
30 |
[ac_libgig="no"], |
31 |
[ac_libgig="yes"]) |
32 |
|
33 |
# Set for alternate liblscp installation dir. |
34 |
AC_ARG_WITH(liblscp, |
35 |
AC_HELP_STRING([--with-liblscp=PATH], [use alternate liblscp install path]), |
36 |
[ac_with_paths="$ac_with_paths $withval"]) |
37 |
|
38 |
# Set for alternate libgig installation dir. |
39 |
AC_ARG_WITH(libgig, |
40 |
AC_HELP_STRING([--with-libgig=PATH], [use alternate libgig install path]), |
41 |
[ac_with_paths="$ac_with_paths $withval"]) |
42 |
|
43 |
# Checks for programs. |
44 |
AC_PROG_CC |
45 |
AC_PROG_CPP |
46 |
AC_PROG_CXX |
47 |
AC_PROG_CXXCPP |
48 |
AC_PROG_GCC_TRADITIONAL |
49 |
|
50 |
# Checks for languages. |
51 |
AC_LANG_C |
52 |
AC_LANG_CPLUSPLUS |
53 |
|
54 |
# Prepend alternate dependencies paths. |
55 |
for X in $ac_with_paths; do |
56 |
if test -d $X/include; then |
57 |
CFLAGS="$CFLAGS -I$X/include" |
58 |
CPPFLAGS="$CPPFLAGS -I$X/include" |
59 |
ac_incpath="$X/include $ac_incpath" |
60 |
fi |
61 |
if test -d $X/lib; then |
62 |
LIBS="$LIBS -L$X/lib" |
63 |
ac_libs="-L$X/lib $ac_libs" |
64 |
fi |
65 |
done |
66 |
|
67 |
# Check for QTDIR environment variable. |
68 |
AC_MSG_CHECKING([whether QTDIR environment variable is set]) |
69 |
if test "x$QTDIR" = "x"; then |
70 |
AC_MSG_RESULT([no]) |
71 |
AC_MSG_ERROR([QTDIR must be properly set.]) |
72 |
else |
73 |
AC_MSG_RESULT([$QTDIR]) |
74 |
fi |
75 |
|
76 |
CFLAGS="$CFLAGS -I$QTDIR/include" |
77 |
CPPFLAGS="$CPPFLAGS -I$QTDIR/include" |
78 |
LIBS="$LIBS -L$QTDIR/lib" |
79 |
for X in qt qt3; do |
80 |
if test -d $QTDIR/include/$X; then |
81 |
CFLAGS="$CFLAGS -I$QTDIR/include/$X" |
82 |
CPPFLAGS="$CPPFLAGS -I$QTDIR/include/$X" |
83 |
fi |
84 |
done |
85 |
|
86 |
# Checks for Qt library. |
87 |
for X in qt-mt qt; do |
88 |
if test "x$ac_qtlib" = "x"; then |
89 |
AC_CHECK_LIB($X, main, [ac_qtlib=$X]) |
90 |
fi |
91 |
done |
92 |
if test "x$ac_qtlib" = "x"; then |
93 |
AC_MSG_ERROR([Qt library not found. Maybe QTDIR isn't properly set.]) |
94 |
fi |
95 |
AC_SUBST(ac_qtlib) |
96 |
|
97 |
# Check for Qt multi-thread support. |
98 |
if test "x$ac_qtlib" = "xqt-mt"; then |
99 |
ac_thread="thread" |
100 |
fi |
101 |
AC_SUBST(ac_thread) |
102 |
|
103 |
AC_CACHE_CHECK([for Qt library version >= 3.1.1], |
104 |
ac_qtlib_version, [ |
105 |
AC_TRY_LINK([#include "qglobal.h"], [ |
106 |
#if QT_VERSION < 0x030101 |
107 |
#error Qt library 3.1.1 or greater required. |
108 |
#endif |
109 |
], |
110 |
ac_qtlib_version="yes", [ |
111 |
echo "no; Qt 3.1.1 or greater is required" |
112 |
exit |
113 |
]) |
114 |
]) |
115 |
|
116 |
# A common error message: |
117 |
ac_qtdir_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt3-devel)." |
118 |
|
119 |
# Check for Qt qmake utility. |
120 |
AC_PATH_PROG(ac_qmake, qmake, [no], $QTDIR/bin:${PATH}) |
121 |
if test "x$ac_qmake" = "xno"; then |
122 |
AC_MSG_ERROR([qmake $ac_qtdir_errmsg]) |
123 |
fi |
124 |
AC_SUBST(ac_qmake) |
125 |
|
126 |
# Check for Qt moc utility. |
127 |
AC_PATH_PROG(ac_moc, moc, [no], $QTDIR/bin:${PATH}) |
128 |
if test "x$ac_moc" = "xno"; then |
129 |
AC_MSG_ERROR([moc $ac_qtdir_errmsg]) |
130 |
fi |
131 |
AC_SUBST(ac_moc) |
132 |
|
133 |
# Check for Qt uic utility. |
134 |
AC_PATH_PROG(ac_uic, uic, [no], $QTDIR/bin:${PATH}) |
135 |
if test "x$ac_uic" = "xno"; then |
136 |
AC_MSG_ERROR([uic $ac_qtdir_errmsg]) |
137 |
fi |
138 |
AC_SUBST(ac_uic) |
139 |
|
140 |
# Checks for libraries. |
141 |
AC_CHECK_LIB(m, main) |
142 |
AC_CHECK_LIB(X11, main) |
143 |
AC_CHECK_LIB(Xext, main) |
144 |
AC_CHECK_LIB($ac_qtlib, main) |
145 |
|
146 |
# Check for round math function. |
147 |
AC_CHECK_LIB(m, round, [ac_round="yes"], [ac_round="no"]) |
148 |
if test "x$ac_round" = "xyes"; then |
149 |
AC_DEFINE(CONFIG_ROUND, 1, [Define if round is available.]) |
150 |
fi |
151 |
|
152 |
# Check for mandatory libraries. |
153 |
AC_CHECK_LIB(lscp, main, [ac_liblscp="yes"], [ac_liblscp="no"]) |
154 |
if test "x$ac_liblscp" = "xno"; then |
155 |
AC_MSG_ERROR([LSCP library not found.]) |
156 |
fi |
157 |
ac_libs="$ac_libs -llscp" |
158 |
|
159 |
AC_CACHE_CHECK([for instrument_name in lscp_channel_info_t], |
160 |
ac_instrument_name, [ |
161 |
AC_TRY_COMPILE([#include "lscp/client.h"], [ |
162 |
lscp_channel_info_t info; |
163 |
info.instrument_name = 0; |
164 |
], ac_instrument_name="yes", ac_instrument_name="no") |
165 |
]) |
166 |
if test "x$ac_instrument_name" = "xyes"; then |
167 |
AC_DEFINE(CONFIG_INSTRUMENT_NAME, 1, [Define if instrument_name is available.]) |
168 |
fi |
169 |
|
170 |
AC_CACHE_CHECK([for mute/solo in lscp_channel_info_t], |
171 |
ac_mute_solo, [ |
172 |
AC_TRY_COMPILE([#include "lscp/client.h"], [ |
173 |
lscp_channel_info_t info; |
174 |
info.mute = 0; |
175 |
info.solo = 0; |
176 |
], ac_mute_solo="yes", ac_mute_solo="no") |
177 |
]) |
178 |
if test "x$ac_mute_solo" = "xyes"; then |
179 |
AC_CHECK_LIB(lscp, lscp_set_channel_mute, [ac_mute_solo="yes"], [ac_mute_solo="no"]) |
180 |
fi |
181 |
if test "x$ac_mute_solo" = "xyes"; then |
182 |
AC_CHECK_LIB(lscp, lscp_set_channel_solo, [ac_mute_solo="yes"], [ac_mute_solo="no"]) |
183 |
fi |
184 |
if test "x$ac_mute_solo" = "xyes"; then |
185 |
AC_DEFINE(CONFIG_MUTE_SOLO, 1, [Define if mute/solo is available.]) |
186 |
fi |
187 |
|
188 |
# Check for optional libraries. |
189 |
if test "x$ac_libgig" = "xyes"; then |
190 |
AC_CHECK_LIB(gig, main, [ac_libgig="yes"], [ac_libgig="no"]) |
191 |
if test "x$ac_libgig" = "xyes"; then |
192 |
AC_DEFINE(CONFIG_LIBGIG, 1, [Define if libgig is available.]) |
193 |
ac_libs="$ac_libs -lgig" |
194 |
fi |
195 |
fi |
196 |
|
197 |
AC_SUBST(ac_libs) |
198 |
AC_SUBST(ac_incpath) |
199 |
|
200 |
# Checks for header files. |
201 |
AC_HEADER_STDC |
202 |
AC_HEADER_SYS_WAIT |
203 |
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h signal.h) |
204 |
|
205 |
AC_CHECK_HEADER(lscp/client.h, [ac_lscp_h="yes"], [ac_lscp_h="no"]) |
206 |
if test "x$ac_lscp_h" = "xno"; then |
207 |
AC_MSG_ERROR([LSCP headers not found.]) |
208 |
fi |
209 |
|
210 |
# Checks for typedefs, structures, and compiler characteristics. |
211 |
# AC_C_CONST |
212 |
|
213 |
# Checks for library functions. |
214 |
AC_CHECK_FUNCS(system) |
215 |
|
216 |
# Finally produce a configure header file and the makefiles. |
217 |
AC_OUTPUT |
218 |
|
219 |
# make clean > /dev/null 2>&1 |
220 |
|
221 |
echo "" |
222 |
echo "Now type 'make', followed by 'make install' as root." |
223 |
echo "" |