Minor code re-ordering for clarity
[jack_mixer.git] / configure.ac
blob11c31fe8561629babc3925e305512a03451ca11e
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 # This file is part of jack_mixer
6 # Copyright (C) 2007 Nedko Arnaudov <nedko@arnaudov.name>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; version 2 of the License
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22 AC_PREREQ(2.61)
23 AC_INIT(jack_mixer, 14)
24 AC_CONFIG_AUX_DIR(config)
25 AC_CONFIG_MACRO_DIR([m4])
26 AM_INIT_AUTOMAKE([1.11 foreign no-define tar-ustar no-dist-gzip dist-xz])
27 AC_CONFIG_HEADER([config.h])
29 # not real check but hack (because version is not parameter to configure script) to detect development version
30 AM_CONDITIONAL(DEV_VERSION, test $VERSION = dev)
32 AC_SUBST(DATADIR)
34 # Checks for programs.
35 AC_PROG_CC
36 AC_DISABLE_STATIC
37 AC_PROG_LIBTOOL
38 AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")
40 # Checks for libraries.
42 PKG_CHECK_MODULES(JACKMIXER, [glib-2.0 jack])
44 # JACK MIDI
45 have_jackmidi="unknown"
46 AC_ARG_ENABLE(jackmidi, [AS_HELP_STRING(--disable-jackmidi, [Force disable JACK MIDI support [default=no]])], [ have_jackmidi="no (disabled)" ])
47 if test "$have_jackmidi" = "unknown"
48 then
49   have_jackmidi="no"
50   PKG_CHECK_MODULES(JACK_MIDI, jack >= 0.102.0, AC_DEFINE([HAVE_JACK_MIDI], [], [Defined if we have JACK MIDI support.]) have_jackmidi="yes")
51   if test "$have_jackmidi" = "yes"
52   then
53     PKG_CHECK_MODULES(OLD_JACK_MIDI, jack < 0.102.27, have_jackmidi="yes (old one)" AC_DEFINE(HAVE_OLD_JACK_MIDI, 1, [whether or not we building against old JACK MIDI (0.102.20)]), echo -n)
54   fi
57 AM_CONDITIONAL(HAVE_JACK_MIDI, test "$have_jackmidi" = "yes" -o "$have_jackmidi" = "yes (old one)")
59 if test "$have_jackmidi" = "no"
60 then
61   AC_MSG_WARN([Your JACK is missing MIDI support.])
64 if test "$have_jackmidi" = "yes" -o "$have_jackmidi" = "yes (old one)"
65 then
66   AC_JACK_MIDI_NFRAMES_CHECK()
67   if test "$jackmidi_nframes" = "yes"
68   then
69     AC_DEFINE([JACK_MIDI_NEEDS_NFRAMES], 1, [Defined if we JACK MIDI functions need nframes parameter.])
70   fi
73 # Python checking
74 AC_ARG_ENABLE(gui, [AS_HELP_STRING(--disable-gui, [Disable GUI [default=no]])])
75 AC_ARG_ENABLE(pymod-checks, [AS_HELP_STRING(--disable-pymod-checks, [Force disable checks for Python modules required at run time])], [ disable_pymod_checks="yes" ], [ disable_pymod_checks="no" ])
76 if test "$enable_gui" != "no"
77 then
78   AM_PATH_PYTHON(3.6)
79   AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(Could not find Python headers)])
80   #AS_AC_EXPAND(PYTHONDIR, $pythondir)
81   #AC_SUBST(PYTHONDIR)
82   pkgpyexecdir="$pyexecdir"
83   enable_gui="yes"
85   if test "$disable_pymod_checks" != "yes"
86   then
87     AM_CHECK_PYMOD(gi,,,[AC_MSG_ERROR(Could not find Pygi)])
88     AM_CHECK_PYMOD(cairo,,,[AC_MSG_ERROR(Could not find Pycairo)])
89   else
90     AC_MSG_WARN([Checks for python modules required runtime have been force disabled])
91   fi
92 else
93   AC_MSG_WARN([GUI has been force disabled. Only jack_mix_box cli application will be built.])
96 AM_CONDITIONAL(ENABLE_GUI, [test x$enable_gui != xno])
98 AC_OUTPUT([
99 Makefile
100 data/Makefile
101 data/art/Makefile
105 AC_MSG_RESULT([])
106 AC_MSG_RESULT([**********************************************************************])
107 AC_MSG_RESULT([])
108 AC_MSG_RESULT([Prefix:            $prefix])
109 AC_MSG_RESULT([Python dir:        $pythondir])
110 AC_MSG_RESULT([])
111 AC_MSG_RESULT([GUI  support:      $enable_gui])
112 AC_MSG_RESULT([MIDI support:      $have_jackmidi])
113 AC_MSG_RESULT([])
114 AC_MSG_RESULT([**********************************************************************])
115 AC_MSG_RESULT([])