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="debug"],[ac_debug="release"])
28 # check if the user wants only jackctlmmc built
29 AC_ARG_ENABLE(cli_only,
30 AC_HELP_STRING([--enable-cli_only], [only build command line program jackctlmmc (default=no)]),
31 [AC_MSG_WARN([qjackmmc intentionally disabled.])
32 ac_build_qjackmmc="no"])
34 # check if the user wants only qjackmmc built
35 AC_ARG_ENABLE(gui_only,
36 AC_HELP_STRING([--enable-gui_only], [only build graphical program qjackmmc (default=no)]),
37 [AC_MSG_WARN([jackctlmmc intentionally disabled.])
38 ac_build_jackctlmmc="no"])
40 AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
42 # Standard installation base dirs.
43 ac_with_paths="/usr /usr/local"
45 # Some a-la-debian alternatives...
46 for X in /usr/lib /usr/lib64 /usr/share; do
48 if test -d $X/$Y/bin; then
49 ac_with_paths="$ac_with_paths $X/$Y"
54 # Set for alternate Qt installation dir.
56 AC_HELP_STRING([--with-qt=PATH], [use alternate Qt install path]),
57 [ac_with_paths="$ac_with_paths $withval"])
59 # Set for alternate JACK installation dir.
61 AC_HELP_STRING([--with-jack=PATH], [use alternate JACK install path]),
62 [ac_with_paths="$ac_with_paths $withval"])
64 # Set for alternate ALSA installation dir.
66 AC_HELP_STRING([--with-alsa=PATH], [use alternate ALSA install path]),
67 [ac_with_paths="$ac_with_paths $withval"])
69 # Set for alternate LASH installation dir.
71 AC_HELP_STRING([--with-lash=PATH], [use alternate LASH install path]),
72 [ac_with_paths="$ac_with_paths $withval"])
74 # Checks for programs.
81 # Checks for languages.
85 # Prepend alternate dependencies paths.
87 for X in $ac_with_paths; do
88 if test -d $X/bin; then
89 ac_path="$X/bin:$ac_path"
91 if test -x $X/qmake; then
94 if test -d $X/lib64; then
95 ac_libs="-L$X/lib64 $ac_libs"
97 if test -d $X/lib; then
98 ac_libs="-L$X/lib $ac_libs"
105 # Check for JACK and ALSA libraries.
106 PKG_CHECK_MODULES([REQUIREDPKGS], [jack >= 0.99.0 alsa >= 1.0.0])
107 ac_cflags="$CFLAGS $REQUIREDPKGS_CFLAGS"
108 ac_libs="$ac_libs $REQUIREDPKGS_LIBS"
111 # Check for proper Qt version.
112 PKG_CHECK_MODULES(QT_UP_TO_DATE, [QtCore >= 4.2], [], [ac_build_qjackmmc="no"])
114 # A common error message:
115 ac_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt-devel). QJackMMC cannot be built."
117 # Check for Qt qmake utility.
118 AC_PATH_PROG(ac_qmake, qmake, [no], $ac_path)
119 if test "x$ac_qmake" = "xno"; then
120 AC_MSG_WARN([*** qmake $ac_errmsg])
121 ac_build_qjackmmc="no"
125 # Check for Qt moc utility.
126 AC_PATH_PROG(ac_moc, moc, [no], $ac_path)
127 if test "x$ac_moc" = "xno"; then
128 AC_MSG_WARN([*** moc $ac_errmsg])
129 ac_build_qjackmmc="no"
133 # Check for Qt uic utility.
134 AC_PATH_PROG(ac_uic, uic, [no], $ac_path)
135 if test "x$ac_uic" = "xno"; then
136 AC_MSG_WARN([*** uic $ac_errmsg])
137 ac_build_qjackmmc="no"
141 if test "x$ac_build_qjackmmc" = "xyes"; then
142 AC_DEFINE(ENABLE_QJACKMMC, 1, [Define if QJackMMC can be built.])
143 ac_libs="$ac_libs -lX11"
145 AC_DEFINE(ENABLE_QJACKMMC, 0, [Define if QJackMMC can be built.])
149 ac_default_install=""
151 if test "x$ac_build_jackctlmmc" = "xyes"; then
152 ac_default_deps="jackctlmmc"
153 ac_default_install="cli_install"
156 if test "x$ac_build_qjackmmc" = "xyes"; then
157 ac_default_deps="$ac_default_deps qjackmmc"
158 ac_default_install="$ac_default_install gui_install"
161 if test "x$ac_default_deps" = "x"; then
162 AC_MSG_ERROR([both jackctlmmc and qjackmmc have been disabled, either voluntarily or by missing dependencies, bailing out.])
165 AC_SUBST(ac_default_deps)
166 AC_SUBST(ac_default_install)
169 # Check for JACK headers.
170 AC_CHECK_HEADER(jack/jack.h, [ac_jack_h="yes"], [ac_jack_h="no"])
171 if test "x$ac_jack_h" = "xno"; then
172 AC_MSG_ERROR([JACK headers not found.])
175 # Check for ALSA headers and ultimately
176 # for ALSA/MIDI sequencer support.
177 if test "x$ac_alsa_seq" = "xyes"; then
178 AC_CHECK_HEADER(alsa/asoundlib.h, [ac_alsa_h="yes"], [ac_alsa_h="no"])
179 if test "x$ac_alsa_h" = "xyes"; then
180 AC_DEFINE(CONFIG_ALSA_SEQ, 1, [Define if ALSA/MIDI sequencer support is enabled.])
182 AC_MSG_ERROR([*** ALSA headers not found.])
186 # check if the user wants LASH support
187 AC_ARG_ENABLE(lashsupport,
188 AC_HELP_STRING([--enable-lashsupport], [enable LASH support (default=yes)]),
189 [ac_lashsupport="$enableval"],
190 [ac_lashsupport="yes"])
192 PKG_CHECK_MODULES(LASH, lash-1.0 >= 0.5.0, have_lash="yes", have_lash="no")
193 if test "x$ac_lashsupport" = "xyes"; then
194 if test "$have_lash" = "yes"; then
195 AC_DEFINE(LASH_SUPPORT, 1, [Has lash.h])
196 ac_cflags="$ac_cflags $LASH_CFLAGS"
197 ac_libs="$ac_libs $LASH_LIBS"
198 ac_pkgs="$ac_pkgs lash-1.0"
200 AC_MSG_WARN([LASH not found, session support will not be built.])
201 AC_DEFINE(LASH_SUPPORT, 0, [Has lash.h])
204 AC_MSG_WARN([LASH intentionally disabled.])
205 AC_DEFINE(LASH_SUPPORT, 0, [Has lash.h])
208 # export makefile variables
213 # Checks for library functions.
214 AC_CHECK_FUNCS(system)
216 # Checks for header files.
217 AC_CHECK_HEADERS([stdlib.h unistd.h])
219 # Checks for typedefs, structures, and compiler characteristics.
226 # Checks for library functions.
228 AC_FUNC_ERROR_AT_LINE
229 AC_CHECK_FUNCS([strtol])
231 AC_CONFIG_FILES([GNUmakefile qt/qjackmmc.desktop qt/src/src.pro])