1 |
dnl Process this file with autoconf to produce a configure script. |
2 |
AC_INIT(src/qsamplerMainForm.ui.h) |
3 |
AC_CONFIG_HEADER(config.h) |
4 |
|
5 |
dnl Set default installation prefix. |
6 |
AC_PREFIX_DEFAULT(/usr/local) |
7 |
ac_prefix=$prefix |
8 |
if test "x$ac_prefix" = "xNONE"; then |
9 |
ac_prefix=$ac_default_prefix |
10 |
fi |
11 |
AC_SUBST(ac_prefix) |
12 |
AC_DEFINE_UNQUOTED(CONFIG_PREFIX, ["$ac_prefix"], [Default installation prefix.]) |
13 |
|
14 |
dnl Enable debugging argument option. |
15 |
AC_ARG_ENABLE(debug, |
16 |
AC_HELP_STRING([--enable-debug], [enable debugging (default=no)]), |
17 |
[ac_debug="debug"], |
18 |
[ac_debug="release"]) |
19 |
AC_SUBST(ac_debug) |
20 |
|
21 |
if test "x$ac_debug" = "xdebug"; then |
22 |
AC_DEFINE(CONFIG_DEBUG, 1, [Define if debugging is enabled.]) |
23 |
fi |
24 |
|
25 |
dnl Enable libgig availability. |
26 |
AC_ARG_ENABLE(libgig, |
27 |
AC_HELP_STRING([--disable-libgig], [disable libgig interface (default=no)]), |
28 |
[ac_libgig="no"], |
29 |
[ac_libgig="yes"]) |
30 |
|
31 |
dnl Checks for programs. |
32 |
AC_PROG_CC |
33 |
AC_PROG_CPP |
34 |
AC_PROG_CXX |
35 |
AC_PROG_CXXCPP |
36 |
AC_PROG_GCC_TRADITIONAL |
37 |
|
38 |
dnl Checks for languages. |
39 |
AC_LANG_C |
40 |
AC_LANG_CPLUSPLUS |
41 |
|
42 |
dnl Check for QTDIR environment variable. |
43 |
AC_MSG_CHECKING([whether QTDIR environment variable is set]) |
44 |
if test "x$QTDIR" = "x"; then |
45 |
AC_MSG_RESULT([no]) |
46 |
AC_MSG_ERROR([QTDIR must be properly set.]) |
47 |
else |
48 |
AC_MSG_RESULT([$QTDIR]) |
49 |
fi |
50 |
|
51 |
CFLAGS="$CFLAGS -I$QTDIR/include" |
52 |
CPPFLAGS="$CPPFLAGS -I$QTDIR/include" |
53 |
LIBS="-L$QTDIR/lib" |
54 |
for X in qt qt3; do |
55 |
if test -d $QTDIR/include/$X; then |
56 |
CFLAGS="$CFLAGS -I$QTDIR/include/$X" |
57 |
CPPFLAGS="$CPPFLAGS -I$QTDIR/include/$X" |
58 |
fi |
59 |
done |
60 |
|
61 |
dnl Checks for Qt library. |
62 |
for X in qt-mt qt; do |
63 |
if test "x$ac_qtlib" = "x"; then |
64 |
AC_CHECK_LIB($X, main, [ac_qtlib=$X]) |
65 |
fi |
66 |
done |
67 |
if test "x$ac_qtlib" = "x"; then |
68 |
AC_MSG_ERROR([Qt library not found. Maybe QTDIR isn't properly set.]) |
69 |
fi |
70 |
AC_SUBST(ac_qtlib) |
71 |
|
72 |
dnl Check for Qt multi-thread support. |
73 |
if test "x$ac_qtlib" = "xqt-mt"; then |
74 |
ac_thread="thread" |
75 |
fi |
76 |
AC_SUBST(ac_thread) |
77 |
|
78 |
AC_CACHE_CHECK([for Qt library version >= 3.1.1], |
79 |
ac_qtlib_version, [ |
80 |
AC_TRY_LINK([#include "qglobal.h"], [ |
81 |
#if QT_VERSION < 0x030101 |
82 |
#error Qt library 3.1.1 or greater required. |
83 |
#endif |
84 |
], |
85 |
ac_qtlib_version="yes", [ |
86 |
echo "no; Qt 3.1.1 or greater is required" |
87 |
exit |
88 |
]) |
89 |
]) |
90 |
|
91 |
dnl A common error message: |
92 |
ac_qtdir_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt3-devel)." |
93 |
|
94 |
dnl Check for Qt qmake utility. |
95 |
AC_PATH_PROG(ac_qmake, qmake, [no], $QTDIR/bin:${PATH}) |
96 |
if test "x$ac_qmake" = "xno"; then |
97 |
AC_MSG_ERROR([qmake $ac_qtdir_errmsg]) |
98 |
fi |
99 |
AC_SUBST(ac_qmake) |
100 |
|
101 |
dnl Check for Qt moc utility. |
102 |
AC_PATH_PROG(ac_moc, moc, [no], $QTDIR/bin:${PATH}) |
103 |
if test "x$ac_moc" = "xno"; then |
104 |
AC_MSG_ERROR([moc $ac_qtdir_errmsg]) |
105 |
fi |
106 |
AC_SUBST(ac_moc) |
107 |
|
108 |
dnl Check for Qt uic utility. |
109 |
AC_PATH_PROG(ac_uic, uic, [no], $QTDIR/bin:${PATH}) |
110 |
if test "x$ac_uic" = "xno"; then |
111 |
AC_MSG_ERROR([uic $ac_qtdir_errmsg]) |
112 |
fi |
113 |
AC_SUBST(ac_uic) |
114 |
|
115 |
dnl Checks for libraries. |
116 |
AC_CHECK_LIB(m, main) |
117 |
AC_CHECK_LIB(X11, main) |
118 |
AC_CHECK_LIB(Xext, main) |
119 |
AC_CHECK_LIB($ac_qtlib, main) |
120 |
|
121 |
dnl Check for round math function. |
122 |
AC_CHECK_LIB(m, round, [ac_round="yes"], [ac_round="no"]) |
123 |
if test "x$ac_round" = "xyes"; then |
124 |
AC_DEFINE(CONFIG_ROUND, 1, [Define if round is available.]) |
125 |
fi |
126 |
|
127 |
dnl Check for mandatory libraries. |
128 |
AC_CHECK_LIB(lscp, main, [ac_liblscp="yes"], [ac_liblscp="no"]) |
129 |
if test "x$ac_liblscp" = "xno"; then |
130 |
AC_MSG_ERROR([LSCP library not found.]) |
131 |
fi |
132 |
ac_libs="-llscp" |
133 |
|
134 |
AC_CACHE_CHECK([for instrument_name in lscp_channel_info_t], |
135 |
ac_instrument_name, [ |
136 |
AC_TRY_COMPILE([#include "lscp/client.h"], [ |
137 |
lscp_channel_info_t info; |
138 |
info.instrument_name = 0; |
139 |
], ac_instrument_name="yes", ac_instrument_name="no") |
140 |
]) |
141 |
if test "x$ac_instrument_name" = "xyes"; then |
142 |
AC_DEFINE(CONFIG_INSTRUMENT_NAME, 1, [Define if instrument_name is available.]) |
143 |
fi |
144 |
|
145 |
dnl Check for optional libraries. |
146 |
if test "x$ac_libgig" = "xyes"; then |
147 |
AC_CHECK_LIB(gig, main, [ac_libgig="yes"], [ac_libgig="no"]) |
148 |
if test "x$ac_libgig" = "xyes"; then |
149 |
AC_DEFINE(CONFIG_LIBGIG, 1, [Define if libgig is available.]) |
150 |
ac_libs="-lgig $ac_libs" |
151 |
fi |
152 |
fi |
153 |
|
154 |
AC_SUBST(ac_libs) |
155 |
|
156 |
dnl Checks for header files. |
157 |
AC_HEADER_STDC |
158 |
AC_HEADER_SYS_WAIT |
159 |
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h signal.h) |
160 |
|
161 |
dnl AC_CHECK_HEADER(lscp/client.h, [ac_lscp_h="yes"], [ac_lscp_h="no"]) |
162 |
dnl if test "x$ac_lscp_h" = "xno"; then |
163 |
dnl AC_MSG_ERROR([LSCP headers not found.]) |
164 |
dnl fi |
165 |
|
166 |
dnl Checks for typedefs, structures, and compiler characteristics. |
167 |
dnl AC_C_CONST |
168 |
|
169 |
dnl Checks for library functions. |
170 |
AC_CHECK_FUNCS(system) |
171 |
|
172 |
dnl Finally produce a configure header file and the makefiles. |
173 |
AC_OUTPUT(Makefile qsampler.pro) |
174 |
|
175 |
dnl make clean > /dev/null 2>&1 |
176 |
|
177 |
echo "" |
178 |
echo "Now type 'make', followed by 'make install' as root." |
179 |
echo "" |