2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([calf],[0.0.18.2],[wdev@foltman.com])
6 AC_CONFIG_SRCDIR([config.h.in])
7 AC_CONFIG_HEADER([config.h])
11 if test "x$prefix" = "xNONE"; then
12 prefix=$ac_default_prefix
15 # Checks for programs.
22 # Checks for libraries.
25 # Checks for header files.
27 AC_CHECK_HEADERS([memory.h stdint.h stdlib.h time.h math.h])
29 AC_CHECK_HEADER(ladspa.h, LADSPA_FOUND="yes", LADSPA_FOUND="no")
31 AC_CHECK_HEADER(dssi.h, DSSI_FOUND="yes", DSSI_FOUND="no")
33 AC_CHECK_HEADER(expat.h, true, AC_MSG_ERROR([Expat XML library not found]))
34 AC_CHECK_LIB(expat, XML_Parse, true, AC_MSG_ERROR([Expat XML library not found]))
36 AC_CHECK_HEADERS([jack/jack.h], have_jack_header=yes, have_jack_header=no)
38 PKG_CHECK_MODULES(GLIB_DEPS, glib-2.0 >= 2.0.0, true, AC_MSG_ERROR([glib-2.0 library not found]))
39 PKG_CHECK_MODULES(FLUIDSYNTH_DEPS, fluidsynth >= 1.0.7, true, AC_MSG_ERROR([fluidsynth library not found]))
41 if test "$have_jack_header" = "yes"; then
42 PKG_CHECK_MODULES(JACK_DEPS, jack >= 0.103.0,
43 AC_CHECK_LIB([jack], [jack_port_register], JACK_FOUND="yes", JACK_FOUND="no"),
49 if test "$JACK_FOUND" = "yes"; then
50 PKG_CHECK_MODULES(JACK_MIDI_DEPS, jack >= 0.105.0, OLD_JACK="no", OLD_JACK="yes")
53 AC_SUBST(GLIB_DEPS_CFLAGS)
54 AC_SUBST(GLIB_DEPS_LIBS)
55 AC_SUBST(GUI_DEPS_CFLAGS)
56 AC_SUBST(GUI_DEPS_LIBS)
57 AC_SUBST(JACK_DEPS_CFLAGS)
58 AC_SUBST(JACK_DEPS_LIBS)
59 AC_SUBST(FLUIDSYNTH_DEPS_CFLAGS)
60 AC_SUBST(FLUIDSYNTH_DEPS_LIBS)
62 PKG_CHECK_MODULES(LV2_DEPS, lv2core >= 1, LV2_ENABLED="yes", LV2_ENABLED="no")
63 PKG_CHECK_MODULES(LASH_DEPS, lash-1.0 >= 0.5.2, LASH_ENABLED="yes", LASH_ENABLED="no")
64 PKG_CHECK_MODULES(SLV2_HACK, slv2 <= 0.6.1, SLV2_UNSUPPORTED="yes", SLV2_UNSUPPORTED="no")
66 if test "$JACK_FOUND" = "yes" -o "$DSSI_FOUND" = "yes" -o "$LV2_ENABLED" = "yes"; then
67 PKG_CHECK_MODULES(GUI_DEPS, gtk+-2.0 >= 2.8.0 libglade-2.0 >= 2.4.0 cairo >= 1.2.0,
69 GUI_ENABLED="no (GTK+ 2.8, cairo 1.2 and libglade 2.4.0 or newer required)"
75 if test "$LADSPA_FOUND" = "yes"; then
76 AC_MSG_CHECKING([whether to allow LADSPA])
78 AC_HELP_STRING([--without-ladspa],[disable LADSPA and DSSI interfaces]),
79 [if test "$withval" = "no"; then LADSPA_FOUND="no"; DSSI_FOUND="no"; fi],[])
80 AC_MSG_RESULT($LADSPA_FOUND)
83 if test "$LV2_ENABLED" = "yes"; then
84 AC_MSG_CHECKING([whether to allow LV2])
86 AC_HELP_STRING([--without-lv2],[disable LV2 interface]),
87 [if test "$withval" = "no"; then LV2_ENABLED="no"; fi],[])
88 AC_MSG_RESULT($LV2_ENABLED)
91 if test "$GUI_ENABLED" = "yes" -a "$JACK_FOUND" = "yes"; then
97 if test "$GUI_ENABLED" = "yes" -a "$DSSI_FOUND" = "yes"; then
98 DSSI_GUI_ENABLED="yes"
100 DSSI_GUI_ENABLED="no"
103 if test "$GUI_ENABLED" = "yes" -a "$LV2_ENABLED" = "yes"; then
104 LV2_GUI_ENABLED="yes"
109 AC_MSG_CHECKING([whether to enable experimental/unfinished features])
110 AC_ARG_ENABLE(experimental,
111 AC_HELP_STRING([--enable-experimental],[enable unfinished features - not recommended!]),
112 [set_enable_experimental="$enableval"],
113 [set_enable_experimental="no"])
114 AC_MSG_RESULT($set_enable_experimental)
116 AC_MSG_CHECKING([whether to enable debugging mode])
118 AC_HELP_STRING([--enable-debug],[enable debug mode - slow!]),
119 [set_enable_debug="$enableval"],
120 [set_enable_debug="no"])
121 AC_MSG_RESULT($set_enable_debug)
123 if test "$set_enable_debug" = "yes"; then
124 CXXFLAGS="$CXXFLAGS -O0 -g -Wall"
126 CXXFLAGS="$CXXFLAGS -O3 -finline-functions -finline-functions-called-once -Wall"
129 AM_CONDITIONAL(USE_DSSI, test "$DSSI_FOUND" = "yes")
130 AM_CONDITIONAL(USE_LADSPA, test "$LADSPA_FOUND" = "yes")
131 AM_CONDITIONAL(USE_JACK, test "$JACK_ENABLED" = "yes")
132 AM_CONDITIONAL(USE_LV2, test "$LV2_ENABLED" = "yes")
133 AM_CONDITIONAL(USE_GUI, test "$GUI_ENABLED" = "yes")
134 AM_CONDITIONAL(USE_DSSI_GUI, test "$DSSI_GUI_ENABLED" = "yes")
135 AM_CONDITIONAL(USE_LV2_GUI, test "$LV2_GUI_ENABLED" = "yes")
136 AM_CONDITIONAL(USE_LASH, test "$LASH_ENABLED" = "yes")
137 AM_CONDITIONAL(USE_DEBUG, test "$set_enable_debug" = "yes")
138 if test "$LADSPA_FOUND" = "yes"; then
139 AC_DEFINE([USE_LADSPA], [1], [LADSPA wrapper will be built])
141 if test "$DSSI_FOUND" = "yes"; then
142 AC_DEFINE(USE_DSSI, 1, [DSSI wrapper will be built])
144 if test "$DSSI_GUI_ENABLED" = "yes"; then
145 AC_DEFINE(USE_DSSI_GUI, 1, [GTK+ GUI for DSSI will be built])
147 if test "$LV2_ENABLED" = "yes"; then
148 AC_DEFINE(USE_LV2, 1, [LV2 wrapper will be built])
150 if test "$LV2_GUI_ENABLED" = "yes"; then
151 AC_DEFINE(USE_LV2_GUI, 1, [GTK+ GUI for LV2 plugins will be built])
153 if test "$JACK_ENABLED" = "yes"; then
154 AC_DEFINE(USE_JACK, 1, [JACK I/O will be used])
156 if test "$OLD_JACK" = "yes"; then
157 AC_DEFINE(OLD_JACK, 1, [Old JACK version (with extra nframes argument) is to be used])
159 if test "$LASH_ENABLED" = "yes"; then
160 AC_DEFINE(USE_LASH, 1, "LASH Audio Session Handler client functionality is enabled")
162 if test "$set_enable_experimental" = "yes"; then
163 AC_DEFINE([ENABLE_EXPERIMENTAL], [1], "Experimental features are enabled")
166 # Checks for typedefs, structures, and compiler characteristics.
179 AC_MSG_CHECKING(where to install LADSPA plugins)
180 AC_ARG_WITH(ladspa_dir,
181 AC_HELP_STRING([--with-ladspa-dir],[install LADSPA plugins to DIR (default=$prefix/lib/ladspa/)]),
183 [with_ladspa_dir="$prefix/lib/ladspa/"])
184 AC_MSG_RESULT($with_ladspa_dir)
185 AC_SUBST(with_ladspa_dir)
187 AC_MSG_CHECKING(where to install LADSPA RDF file)
188 AC_ARG_WITH(ladspa_rdf_dir,
189 AC_HELP_STRING([--with-ladspa-rdf-dir],[install RDF file to DIR (default=$prefix/share/ladspa/rdf/)]),
191 [with_ladspa_rdf_dir="$prefix/share/ladspa/rdf/"])
192 AC_MSG_RESULT($with_ladspa_rdf_dir)
193 AC_SUBST(with_ladspa_rdf_dir)
195 AC_MSG_CHECKING(where to install DSSI plugins)
196 AC_ARG_WITH(dssi_dir,
197 AC_HELP_STRING([--with-dssi-dir],[install DSSI plugins to DIR (default=$prefix/lib/dssi/)]),
199 [with_dssi_dir="$prefix/lib/dssi/"])
200 AC_MSG_RESULT($with_dssi_dir)
201 AC_SUBST(with_dssi_dir)
203 if test "$LV2_ENABLED" == "yes"; then
204 AC_MSG_CHECKING(where to install LV2 plugins)
206 AC_HELP_STRING([--with-lv2-dir],[install LV2 calf.lv2 bundle to DIR (default=$prefix/lib/lv2/)]),
208 [with_lv2_dir="$prefix/lib/lv2/"])
209 AC_MSG_RESULT($with_lv2_dir)
210 AC_SUBST(with_lv2_dir)
213 AC_DEFINE_UNQUOTED(PKGLIBDIR,"$prefix/share/calf/",[Calf shared data directory (bitmaps, GUI XML etc.)])
215 # Checks for library functions.
216 AC_CHECK_FUNCS([floor memset pow])
218 AC_CONFIG_FILES([Makefile
227 Debug mode: $set_enable_debug
228 Experimental plugins: $set_enable_experimental
229 LADSPA enabled: $LADSPA_FOUND
230 DSSI enabled: $DSSI_FOUND
231 DSSI GUI enabled: $DSSI_GUI_ENABLED
232 LV2 enabled: $LV2_ENABLED
233 LV2 GUI enabled: $LV2_GUI_ENABLED
234 JACK host enabled: $JACK_ENABLED
235 LASH enabled: $LASH_ENABLED
236 Old-style JACK MIDI: $OLD_JACK
238 Installation prefix: $prefix
241 if test "$SLV2_UNSUPPORTED" == "yes" -a "$LV2_ENABLED" == "yes"; then
244 An incompatible version of slv2 library has been found on this system.
246 Some features of Calf LV2 plugins (and other LV2 plugins) may not work
247 as expected in hosts that use currently installed version of libslv2.
249 Please upgrade to slv2 0.6.2 or newer version.