2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(QjackMMC, 4, apmontgo@users.sourceforge.net, qjackmmc)
6 AC_CONFIG_SRCDIR([main.c])
7 AC_CONFIG_HEADERS([config.h])
9 AC_PREFIX_DEFAULT(/usr/local)
11 if test "x$ac_prefix" = "xNONE"; then
12 ac_prefix=$ac_default_prefix
15 AC_DEFINE_UNQUOTED(CONFIG_PREFIX, ["$ac_prefix"], [Default installation prefix.])
17 ac_cflags="$ac_cflags -Wall"
18 ac_build_jackctlmmc="yes"
19 ac_build_qjackmmc="yes"
21 # Enable debugging argument option.
23 AC_HELP_STRING([--enable-debug], [enable debugging (default=no)]),
24 [ac_debug="$enableval"])
26 if test "x$ac_debug" = "xyes"; then
34 # check if the user wants QJackMMC built
36 AC_HELP_STRING([--enable-gui], [build the gui program qjackmmc (default=yes)]),
37 [ac_build_qjackmmc="$enableval"],
38 [ac_build_qjackmmc="yes"])
40 # check if the user wants jackctlmmc built
42 AC_HELP_STRING([--enable-cli], [build the command line program jackctlmmc (default=no)]),
43 [ac_build_jackctlmmc="$enableval"],
44 [ac_build_jackctlmmc="yes"])
46 AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
48 # Standard installation base dirs.
49 ac_with_paths="/usr /usr/local"
51 # Some a-la-debian alternatives...
52 for X in /usr/lib /usr/lib64 /usr/share; do
54 if test -d $X/$Y/bin; then
55 ac_with_paths="$ac_with_paths $X/$Y"
60 # Set for alternate Qt installation dir.
62 AC_HELP_STRING([--with-qt=PATH], [use alternate Qt install path]),
63 [ac_with_paths="$ac_with_paths $withval"])
65 # Set for alternate JACK installation dir.
67 AC_HELP_STRING([--with-jack=PATH], [use alternate JACK install path]),
68 [ac_with_paths="$ac_with_paths $withval"])
70 # Set for alternate ALSA installation dir.
72 AC_HELP_STRING([--with-alsa=PATH], [use alternate ALSA install path]),
73 [ac_with_paths="$ac_with_paths $withval"])
75 # Set for alternate LASH installation dir.
77 AC_HELP_STRING([--with-lash=PATH], [use alternate LASH install path]),
78 [ac_with_paths="$ac_with_paths $withval"])
80 # Checks for programs.
87 # Checks for languages.
91 # Prepend alternate dependencies paths.
93 for X in $ac_with_paths; do
94 if test -d $X/bin; then
95 ac_path="$X/bin:$ac_path"
97 if test -x $X/qmake; then
100 if test -d $X/lib64; then
101 ac_libs="-L$X/lib64 $ac_libs"
103 if test -d $X/lib; then
104 ac_libs="-L$X/lib $ac_libs"
111 # Check for JACK and ALSA libraries.
112 PKG_CHECK_MODULES([REQUIREDPKGS], [jack >= 0.99.0 alsa >= 1.0.0])
113 ac_cflags="$CFLAGS $REQUIREDPKGS_CFLAGS"
114 ac_libs="$ac_libs $REQUIREDPKGS_LIBS"
117 # Check for proper Qt version.
118 PKG_CHECK_MODULES(QT_UP_TO_DATE, [QtCore >= 4.2], [], [ac_build_qjackmmc="no"])
120 # A common error message:
121 ac_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt-devel). QJackMMC cannot be built."
123 # Check for Qt qmake utility.
124 AC_PATH_PROG(ac_qmake, qmake, [no], $ac_path)
125 if test "x$ac_qmake" = "xno"; then
126 AC_MSG_WARN([*** qmake $ac_errmsg])
127 ac_build_qjackmmc="no"
131 # Check for Qt moc utility.
132 AC_PATH_PROG(ac_moc, moc, [no], $ac_path)
133 if test "x$ac_moc" = "xno"; then
134 AC_MSG_WARN([*** moc $ac_errmsg])
135 ac_build_qjackmmc="no"
139 # Check for Qt uic utility.
140 AC_PATH_PROG(ac_uic, uic, [no], $ac_path)
141 if test "x$ac_uic" = "xno"; then
142 AC_MSG_WARN([*** uic $ac_errmsg])
143 ac_build_qjackmmc="no"
147 if test "x$ac_build_qjackmmc" = "xyes"; then
148 AC_DEFINE(ENABLE_QJACKMMC, 1, [Define if QJackMMC can be built.])
149 ac_libs="$ac_libs -lX11"
151 AC_DEFINE(ENABLE_QJACKMMC, 0, [Define if QJackMMC can be built.])
155 ac_default_install=""
156 ac_default_uninstall=""
158 if test "x$ac_build_jackctlmmc" = "xyes"; then
159 ac_default_deps="jackctlmmc"
160 ac_default_install="cli_install"
161 ac_default_uninstall="cli_uninstall"
164 if test "x$ac_build_qjackmmc" = "xyes"; then
165 ac_default_deps="$ac_default_deps qjackmmc"
166 ac_default_install="$ac_default_install gui_install"
167 ac_default_uninstall="$ac_default_uninstall gui_uninstall"
170 if test "x$ac_default_deps" = "x"; then
171 AC_MSG_ERROR([both jackctlmmc and qjackmmc have been disabled, either voluntarily or by missing dependencies, bailing out.])
174 AC_SUBST(ac_default_deps)
175 AC_SUBST(ac_default_install)
176 AC_SUBST(ac_default_uninstall)
179 # Check for JACK headers.
180 AC_CHECK_HEADER(jack/jack.h, [ac_jack_h="yes"], [ac_jack_h="no"])
181 if test "x$ac_jack_h" = "xno"; then
182 AC_MSG_ERROR([JACK headers not found.])
185 # Check for ALSA headers and ultimately
186 # for ALSA/MIDI sequencer support.
187 if test "x$ac_alsa_seq" = "xyes"; then
188 AC_CHECK_HEADER(alsa/asoundlib.h, [ac_alsa_h="yes"], [ac_alsa_h="no"])
189 if test "x$ac_alsa_h" = "xyes"; then
190 AC_DEFINE(CONFIG_ALSA_SEQ, 1, [Define if ALSA/MIDI sequencer support is enabled.])
192 AC_MSG_ERROR([*** ALSA headers not found.])
196 # check if the user wants LASH support
197 AC_ARG_ENABLE(lash_support,
198 AC_HELP_STRING([--enable-lash_support], [enable LASH support (default=yes)]),
199 [ac_lashsupport="$enableval"],
200 [ac_lashsupport="yes"])
202 # check if the user wants JACK midi support
203 AC_ARG_ENABLE(jack_midi,
204 AC_HELP_STRING([--enable-jack_midi], [enable JACK MIDI support (default=yes)]),
205 [ac_jack_midi="$enableval"],
206 [ac_jack_midi="yes"])
208 # Check for JACK MIDI headers availability.
209 if test "x$ac_jack_midi" = "xyes"; then
210 AC_CHECK_HEADER(jack/midiport.h, [ac_jack_midi="yes"], [ac_jack_midi="no"])
211 if test "x$ac_jack_midi" = "xyes"; then
212 AC_DEFINE(JACK_MIDI_SUPPORT, 1, [Define if JACK MIDI support is available.])
214 AC_DEFINE(JACK_MIDI_SUPPORT, 0, [Define if JACK MIDI support is available.])
215 AC_MSG_WARN([*** jack/midiport.h file not found.])
216 AC_MSG_WARN([*** JACK 0.103.0 or later may be required.])
217 AC_MSG_WARN([*** JACK MIDI support will be disabled.])
220 AC_DEFINE(JACK_MIDI_SUPPORT, 0, [Define if JACK MIDI support is available.])
223 PKG_CHECK_MODULES(LASH, lash-1.0 >= 0.5.0, have_lash="yes", have_lash="no")
224 if test "x$ac_lashsupport" = "xyes"; then
225 if test "$have_lash" = "yes"; then
226 AC_DEFINE(LASH_SUPPORT, 1, [Has lash.h])
227 ac_cflags="$ac_cflags $LASH_CFLAGS"
228 ac_libs="$ac_libs $LASH_LIBS"
229 ac_pkgs="$ac_pkgs lash-1.0"
231 AC_MSG_WARN([LASH not found, session support will not be built.])
232 AC_DEFINE(LASH_SUPPORT, 0, [Has lash.h])
235 AC_MSG_WARN([LASH intentionally disabled.])
236 AC_DEFINE(LASH_SUPPORT, 0, [Has lash.h])
239 # export makefile variables
244 # Checks for library functions.
245 AC_CHECK_FUNCS(system)
247 # Checks for header files.
248 AC_CHECK_HEADERS([stdlib.h unistd.h])
250 # Checks for typedefs, structures, and compiler characteristics.
257 # Checks for library functions.
259 AC_FUNC_ERROR_AT_LINE
260 AC_CHECK_FUNCS([strtol])
262 AC_CONFIG_FILES([GNUmakefile qt/qjackmmc.desktop qt/src/src.pro])