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_DEFINE(CONFIG_DEBUG, 1, [Define if debugging is enabled.]))
26 # check if the user wants only jackctlmmc built
27 AC_ARG_ENABLE(cli_only,
28 AC_HELP_STRING([--enable-cli_only], [only build command line program jackctlmmc (default=no)]),
29 [AC_MSG_WARN([qjackmmc intentionally disabled.])
30 ac_build_qjackmmc="no"])
32 # check if the user wants only qjackmmc built
33 AC_ARG_ENABLE(gui_only,
34 AC_HELP_STRING([--enable-gui_only], [only build graphical program qjackmmc (default=no)]),
35 [AC_MSG_WARN([jackctlmmc intentionally disabled.])
36 ac_build_jackctlmmc="no"])
38 AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
40 # Standard installation base dirs.
41 ac_with_paths="/usr /usr/local"
43 # Some a-la-debian alternatives...
44 for X in /usr/lib /usr/lib64 /usr/share; do
46 if test -d $X/$Y/bin; then
47 ac_with_paths="$ac_with_paths $X/$Y"
52 # Set for alternate Qt installation dir.
54 AC_HELP_STRING([--with-qt=PATH], [use alternate Qt install path]),
55 [ac_with_paths="$ac_with_paths $withval"])
57 # Set for alternate JACK installation dir.
59 AC_HELP_STRING([--with-jack=PATH], [use alternate JACK install path]),
60 [ac_with_paths="$ac_with_paths $withval"])
62 # Set for alternate ALSA installation dir.
64 AC_HELP_STRING([--with-alsa=PATH], [use alternate ALSA install path]),
65 [ac_with_paths="$ac_with_paths $withval"])
67 # Set for alternate LASH installation dir.
69 AC_HELP_STRING([--with-lash=PATH], [use alternate LASH install path]),
70 [ac_with_paths="$ac_with_paths $withval"])
72 # Checks for programs.
79 # Checks for languages.
83 # Prepend alternate dependencies paths.
85 for X in $ac_with_paths; do
86 if test -d $X/bin; then
87 ac_path="$X/bin:$ac_path"
89 if test -x $X/qmake; then
92 if test -d $X/lib64; then
93 ac_libs="-L$X/lib64 $ac_libs"
95 if test -d $X/lib; then
96 ac_libs="-L$X/lib $ac_libs"
103 # Check for JACK and ALSA libraries.
104 PKG_CHECK_MODULES([REQUIREDPKGS], [jack >= 0.99.0 alsa >= 1.0.0])
105 ac_cflags="$CFLAGS $REQUIREDPKGS_CFLAGS"
106 ac_libs="$ac_libs $REQUIREDPKGS_LIBS"
109 # Check for proper Qt version.
110 PKG_CHECK_MODULES(QT_UP_TO_DATE, [QtCore >= 4.2], [], [ac_build_qjackmmc="no"])
112 # A common error message:
113 ac_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt-devel). QJackMMC cannot be built."
115 # Check for Qt qmake utility.
116 AC_PATH_PROG(ac_qmake, qmake, [no], $ac_path)
117 if test "x$ac_qmake" = "xno"; then
118 AC_MSG_WARN([*** qmake $ac_errmsg])
119 ac_build_qjackmmc="no"
123 # Check for Qt moc utility.
124 AC_PATH_PROG(ac_moc, moc, [no], $ac_path)
125 if test "x$ac_moc" = "xno"; then
126 AC_MSG_WARN([*** moc $ac_errmsg])
127 ac_build_qjackmmc="no"
131 # Check for Qt uic utility.
132 AC_PATH_PROG(ac_uic, uic, [no], $ac_path)
133 if test "x$ac_uic" = "xno"; then
134 AC_MSG_WARN([*** uic $ac_errmsg])
135 ac_build_qjackmmc="no"
139 if test "x$ac_build_qjackmmc" = "xyes"; then
140 AC_DEFINE(ENABLE_QJACKMMC, 1, [Define if QJackMMC can be built.])
141 ac_libs="$ac_libs -lX11"
143 AC_DEFINE(ENABLE_QJACKMMC, 0, [Define if QJackMMC can be built.])
147 ac_default_install=""
149 if test "x$ac_build_jackctlmmc" = "xyes"; then
150 ac_default_deps="jackctlmmc"
151 ac_default_install="cli_install"
154 if test "x$ac_build_qjackmmc" = "xyes"; then
155 ac_default_deps="$ac_default_deps qjackmmc"
156 ac_default_install="$ac_default_install gui_install"
159 if test "x$ac_default_deps" = "x"; then
160 AC_MSG_ERROR([both jackctlmmc and qjackmmc have been disabled, either voluntarily or by missing dependencies, bailing out.])
163 AC_SUBST(ac_default_deps)
164 AC_SUBST(ac_default_install)
167 # Check for JACK headers.
168 AC_CHECK_HEADER(jack/jack.h, [ac_jack_h="yes"], [ac_jack_h="no"])
169 if test "x$ac_jack_h" = "xno"; then
170 AC_MSG_ERROR([JACK headers not found.])
173 # Check for ALSA headers and ultimately
174 # for ALSA/MIDI sequencer support.
175 if test "x$ac_alsa_seq" = "xyes"; then
176 AC_CHECK_HEADER(alsa/asoundlib.h, [ac_alsa_h="yes"], [ac_alsa_h="no"])
177 if test "x$ac_alsa_h" = "xyes"; then
178 AC_DEFINE(CONFIG_ALSA_SEQ, 1, [Define if ALSA/MIDI sequencer support is enabled.])
180 AC_MSG_ERROR([*** ALSA headers not found.])
184 # check if the user wants LASH support
185 AC_ARG_ENABLE(lashsupport,
186 AC_HELP_STRING([--enable-lashsupport], [enable LASH support (default=yes)]),
187 [ac_lashsupport="$enableval"],
188 [ac_lashsupport="yes"])
190 PKG_CHECK_MODULES(LASH, lash-1.0 >= 0.5.0, have_lash="yes", have_lash="no")
191 if test "x$ac_lashsupport" = "xyes"; then
192 if test "$have_lash" = "yes"; then
193 AC_DEFINE(LASH_SUPPORT, 1, [Has lash.h])
194 ac_cflags="$ac_cflags $LASH_CFLAGS"
195 ac_libs="$ac_libs $LASH_LIBS"
196 ac_pkgs="$ac_pkgs lash-1.0"
198 AC_MSG_WARN([LASH not found, session support will not be built.])
199 AC_DEFINE(LASH_SUPPORT, 0, [Has lash.h])
202 AC_MSG_WARN([LASH intentionally disabled.])
203 AC_DEFINE(LASH_SUPPORT, 0, [Has lash.h])
206 # export makefile variables
211 # Checks for library functions.
212 AC_CHECK_FUNCS(system)
214 # Checks for header files.
215 AC_CHECK_HEADERS([stdlib.h unistd.h])
217 # Checks for typedefs, structures, and compiler characteristics.
224 # Checks for library functions.
226 AC_FUNC_ERROR_AT_LINE
227 AC_CHECK_FUNCS([strtol])
229 AC_CONFIG_FILES([GNUmakefile qt/qjackmmc.desktop qt/src/src.pro])