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_icon_dir="$ac_prefix/share/pixmaps"
18 AC_DEFINE_UNQUOTED(ICON_DIR, ["$ac_icon_dir"], [Default icon directory.])
20 ac_cflags="$ac_cflags -Wall"
21 ac_build_jackctlmmc="yes"
22 ac_build_qjackmmc="yes"
24 # Enable debugging argument option.
26 AC_HELP_STRING([--enable-debug], [enable debugging (default=no)]),
27 [ac_debug="$enableval"])
29 if test "x$ac_debug" = "xyes"; then
37 # check if the user wants QJackMMC built
39 AC_HELP_STRING([--enable-gui], [build the gui program qjackmmc (default=yes)]),
40 [ac_build_qjackmmc="$enableval"],
41 [ac_build_qjackmmc="yes"])
43 # check if the user wants jackctlmmc built
45 AC_HELP_STRING([--enable-cli], [build the command line program jackctlmmc (default=yes)]),
46 [ac_build_jackctlmmc="$enableval"],
47 [ac_build_jackctlmmc="yes"])
49 AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
51 # Standard installation base dirs.
52 ac_with_paths="/usr /usr/local"
54 # Some a-la-debian alternatives...
55 for X in /usr/lib /usr/lib64 /usr/share; do
57 if test -d $X/$Y/bin; then
58 ac_with_paths="$ac_with_paths $X/$Y"
63 # Set for alternate Qt installation dir.
65 AC_HELP_STRING([--with-qt=PATH], [use alternate Qt install path]),
66 [ac_with_paths="$ac_with_paths $withval"])
68 # Set for alternate JACK installation dir.
70 AC_HELP_STRING([--with-jack=PATH], [use alternate JACK install path]),
71 [ac_with_paths="$ac_with_paths $withval"])
73 # Set for alternate ALSA installation dir.
75 AC_HELP_STRING([--with-alsa=PATH], [use alternate ALSA install path]),
76 [ac_with_paths="$ac_with_paths $withval"])
78 # Set for alternate LASH installation dir.
80 AC_HELP_STRING([--with-lash=PATH], [use alternate LASH install path]),
81 [ac_with_paths="$ac_with_paths $withval"])
83 # Checks for programs.
90 # Checks for languages.
94 # Prepend alternate dependencies paths.
96 for X in $ac_with_paths; do
97 if test -d $X/bin; then
98 ac_path="$X/bin:$ac_path"
100 if test -x $X/qmake; then
101 ac_path="$X:$ac_path"
103 if test -d $X/lib64; then
104 ac_libs="-L$X/lib64 $ac_libs"
106 if test -d $X/lib; then
107 ac_libs="-L$X/lib $ac_libs"
114 # Check for JACK and ALSA libraries.
115 PKG_CHECK_MODULES([REQUIREDPKGS], [jack >= 0.99.0 alsa >= 1.0.0])
116 ac_cflags="$CFLAGS $REQUIREDPKGS_CFLAGS"
117 ac_libs="$ac_libs $REQUIREDPKGS_LIBS"
120 # Check for proper Qt version.
121 if test "x$ac_build_qjackmmc" = "xyes"; then
122 PKG_CHECK_MODULES(QT_UP_TO_DATE, [QtCore >= 4.4], [], [ac_build_qjackmmc="no"])
124 # A common error message:
125 ac_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt-devel). QJackMMC cannot be built."
127 # Check for Qt qmake utility.
128 AC_PATH_PROG(ac_qmake, qmake, [no], $ac_path)
129 if test "x$ac_qmake" = "xno"; then
130 AC_MSG_WARN([*** qmake $ac_errmsg])
131 ac_build_qjackmmc="no"
135 # Check for Qt moc utility.
136 AC_PATH_PROG(ac_moc, moc, [no], $ac_path)
137 if test "x$ac_moc" = "xno"; then
138 AC_MSG_WARN([*** moc $ac_errmsg])
139 ac_build_qjackmmc="no"
143 # Check for Qt uic utility.
144 AC_PATH_PROG(ac_uic, uic, [no], $ac_path)
145 if test "x$ac_uic" = "xno"; then
146 AC_MSG_WARN([*** uic $ac_errmsg])
147 ac_build_qjackmmc="no"
150 fi # ac_build_qjackmmc
152 if test "x$ac_build_qjackmmc" = "xyes"; then
153 AC_DEFINE(ENABLE_QJACKMMC, 1, [Define if QJackMMC can be built.])
154 ac_libs="$ac_libs -lX11"
156 AC_DEFINE(ENABLE_QJACKMMC, 0, [Define if QJackMMC can be built.])
160 ac_default_install=""
161 ac_default_uninstall=""
163 if test "x$ac_build_jackctlmmc" = "xyes"; then
164 ac_default_deps="jackctlmmc"
165 ac_default_install="cli_install"
166 ac_default_uninstall="cli_uninstall"
169 if test "x$ac_build_qjackmmc" = "xyes"; then
170 ac_default_deps="$ac_default_deps qjackmmc"
171 ac_default_install="$ac_default_install gui_install"
172 ac_default_uninstall="$ac_default_uninstall gui_uninstall"
175 if test "x$ac_default_deps" = "x"; then
176 AC_MSG_ERROR([both jackctlmmc and qjackmmc have been disabled, either voluntarily or by missing dependencies, bailing out.])
179 AC_SUBST(ac_default_deps)
180 AC_SUBST(ac_default_install)
181 AC_SUBST(ac_default_uninstall)
184 # Check for JACK headers.
185 AC_CHECK_HEADER(jack/jack.h, [ac_jack_h="yes"], [ac_jack_h="no"])
186 if test "x$ac_jack_h" = "xno"; then
187 AC_MSG_ERROR([JACK headers not found.])
190 # Check for ALSA headers and ultimately
191 # for ALSA/MIDI sequencer support.
192 if test "x$ac_alsa_seq" = "xyes"; then
193 AC_CHECK_HEADER(alsa/asoundlib.h, [ac_alsa_h="yes"], [ac_alsa_h="no"])
194 if test "x$ac_alsa_h" = "xyes"; then
195 AC_DEFINE(CONFIG_ALSA_SEQ, 1, [Define if ALSA/MIDI sequencer support is enabled.])
197 AC_MSG_ERROR([*** ALSA headers not found.])
201 # check if the user wants LASH support
203 AC_HELP_STRING([--enable-lash], [enable LASH support (default=yes)]),
204 [ac_lashsupport="$enableval"],
205 [ac_lashsupport="yes"])
207 # check if the user wants JACK midi support
208 AC_ARG_ENABLE(jackmidi,
209 AC_HELP_STRING([--enable-jackmidi], [enable JACK MIDI support (default=yes)]),
210 [ac_jack_midi="$enableval"],
211 [ac_jack_midi="yes"])
213 # Check for JACK MIDI headers availability.
214 if test "x$ac_jack_midi" = "xyes"; then
215 AC_CHECK_HEADER(jack/midiport.h, [ac_jack_midi="yes"], [ac_jack_midi="no"])
216 if test "x$ac_jack_midi" = "xyes"; then
217 AC_DEFINE(JACK_MIDI_SUPPORT, 1, [Define if JACK MIDI support is available.])
219 AC_DEFINE(JACK_MIDI_SUPPORT, 0, [Define if JACK MIDI support is available.])
220 AC_MSG_WARN([*** jack/midiport.h file not found.])
221 AC_MSG_WARN([*** JACK 0.103.0 or later may be required.])
222 AC_MSG_WARN([*** JACK MIDI support will be disabled.])
225 AC_DEFINE(JACK_MIDI_SUPPORT, 0, [Define if JACK MIDI support is available.])
228 PKG_CHECK_MODULES(LASH, lash-1.0 >= 0.5.0, have_lash="yes", have_lash="no")
229 if test "x$ac_lashsupport" = "xyes"; then
230 if test "$have_lash" = "yes"; then
231 AC_DEFINE(LASH_SUPPORT, 1, [Has lash.h])
232 ac_cflags="$ac_cflags $LASH_CFLAGS"
233 ac_libs="$ac_libs $LASH_LIBS"
234 ac_pkgs="$ac_pkgs lash-1.0"
236 AC_MSG_WARN([LASH not found, session support will not be built.])
237 AC_DEFINE(LASH_SUPPORT, 0, [Has lash.h])
240 AC_MSG_WARN([LASH intentionally disabled.])
241 AC_DEFINE(LASH_SUPPORT, 0, [Has lash.h])
244 # export makefile variables
249 # Checks for library functions.
250 AC_CHECK_FUNCS(system)
252 # Checks for header files.
253 AC_CHECK_HEADERS([stdlib.h unistd.h])
255 # Checks for typedefs, structures, and compiler characteristics.
262 # Checks for library functions.
264 AC_FUNC_ERROR_AT_LINE
265 AC_CHECK_FUNCS([strtol])
267 AC_CONFIG_FILES([GNUmakefile qt/qjackmmc.desktop qt/src/src.pro])