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

Contents of /qsampler/trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 600 - (show annotations) (download)
Thu Jun 2 08:52:47 2005 UTC (18 years, 10 months ago) by capela
File size: 4887 byte(s)
- Minor configure fix, a debian specialty.

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 dnl Checks for Qt library.
52 AC_CACHE_CHECK([for Qt library],
53 ac_qtlib, [
54 for X in qt-mt qt; do
55 if test "x$ac_qtlib" = "x"; then
56 if test -f $QTDIR/lib/lib$X.so -o -f $QTDIR/lib/lib$X.a \
57 -o -f $QTDIR/lib/lib$X.la -o -f $QTDIR/lib/lib$X.dylib; then
58 ac_qtlib=$X
59 fi
60 fi
61 done
62 ])
63 if test "x$ac_qtlib" = "x"; then
64 AC_MSG_ERROR([Qt library not found. Maybe QTDIR isn't properly set.])
65 fi
66 AC_SUBST(ac_qtlib)
67
68 dnl Check for Qt multi-thread support.
69 if test "x$ac_qtlib" = "xqt-mt"; then
70 ac_thread="thread"
71 fi
72 AC_SUBST(ac_thread)
73
74 CFLAGS="$CFLAGS -I$QTDIR/include"
75 CPPFLAGS="$CPPFLAGS -I$QTDIR/include"
76 LIBS="-L$QTDIR/lib"
77 for X in qt qt3; do
78 if test -d $QTDIR/include/$X; then
79 CFLAGS="$CFLAGS -I$QTDIR/include/$X"
80 CPPFLAGS="$CPPFLAGS -I$QTDIR/include/$X"
81 fi
82 done
83
84 AC_CACHE_CHECK([for Qt library version >= 3.1.1],
85 ac_qtlib_version, [
86 AC_TRY_LINK([#include "qglobal.h"], [
87 #if QT_VERSION < 0x030101
88 #error Qt library 3.1.1 or greater required.
89 #endif
90 ],
91 ac_qtlib_version="yes", [
92 echo "no; Qt 3.1.1 or greater is required"
93 exit
94 ])
95 ])
96
97 dnl A common error message:
98 ac_qtdir_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt3-devel)."
99
100 dnl Check for Qt qmake utility.
101 AC_PATH_PROG(ac_qmake, qmake, [no], $QTDIR/bin:${PATH})
102 if test "x$ac_qmake" = "xno"; then
103 AC_MSG_ERROR([qmake $ac_qtdir_errmsg])
104 fi
105 AC_SUBST(ac_qmake)
106
107 dnl Check for Qt moc utility.
108 AC_PATH_PROG(ac_moc, moc, [no], $QTDIR/bin:${PATH})
109 if test "x$ac_moc" = "xno"; then
110 AC_MSG_ERROR([moc $ac_qtdir_errmsg])
111 fi
112 AC_SUBST(ac_moc)
113
114 dnl Check for Qt uic utility.
115 AC_PATH_PROG(ac_uic, uic, [no], $QTDIR/bin:${PATH})
116 if test "x$ac_uic" = "xno"; then
117 AC_MSG_ERROR([uic $ac_qtdir_errmsg])
118 fi
119 AC_SUBST(ac_uic)
120
121 dnl Checks for libraries.
122 AC_CHECK_LIB(m, main)
123 AC_CHECK_LIB(X11, main)
124 AC_CHECK_LIB(Xext, main)
125 AC_CHECK_LIB($ac_qtlib, main)
126
127 dnl Check for round math function.
128 AC_CHECK_LIB(m, round, [ac_round="yes"], [ac_round="no"])
129 if test "x$ac_round" = "xyes"; then
130 AC_DEFINE(CONFIG_ROUND, 1, [Define if round is available.])
131 fi
132
133 dnl Check for mandatory libraries.
134 AC_CHECK_LIB(lscp, main, [ac_liblscp="yes"], [ac_liblscp="no"])
135 if test "x$ac_liblscp" = "xno"; then
136 AC_MSG_ERROR([LSCP library not found.])
137 fi
138 ac_libs="-llscp"
139
140 AC_CACHE_CHECK([for instrument_name in lscp_channel_info_t],
141 ac_instrument_name, [
142 AC_TRY_COMPILE([#include "lscp/client.h"], [
143 lscp_channel_info_t info;
144 info.instrument_name = 0;
145 ], ac_instrument_name="yes", ac_instrument_name="no")
146 ])
147 if test "x$ac_instrument_name" = "xyes"; then
148 AC_DEFINE(CONFIG_INSTRUMENT_NAME, 1, [Define if instrument_name is available.])
149 fi
150
151 dnl Check for optional libraries.
152 if test "x$ac_libgig" = "xyes"; then
153 AC_CHECK_LIB(gig, main, [ac_libgig="yes"], [ac_libgig="no"])
154 if test "x$ac_libgig" = "xyes"; then
155 AC_DEFINE(CONFIG_LIBGIG, 1, [Define if libgig is available.])
156 ac_libs="-lgig $ac_libs"
157 fi
158 fi
159
160 AC_SUBST(ac_libs)
161
162 dnl Checks for header files.
163 AC_HEADER_STDC
164 AC_HEADER_SYS_WAIT
165 AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h signal.h)
166
167 dnl AC_CHECK_HEADER(lscp/client.h, [ac_lscp_h="yes"], [ac_lscp_h="no"])
168 dnl if test "x$ac_lscp_h" = "xno"; then
169 dnl AC_MSG_ERROR([LSCP headers not found.])
170 dnl fi
171
172 dnl Checks for typedefs, structures, and compiler characteristics.
173 dnl AC_C_CONST
174
175 dnl Checks for library functions.
176 AC_CHECK_FUNCS(system)
177
178 dnl Finally produce a configure header file and the makefiles.
179 AC_OUTPUT(Makefile qsampler.pro)
180
181 dnl make clean > /dev/null 2>&1
182
183 echo ""
184 echo "Now type 'make', followed by 'make install' as root."
185 echo ""

  ViewVC Help
Powered by ViewVC