2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([calf],[0.0.19],[wdev@foltman.com])
6 AC_CONFIG_SRCDIR([config.h.in])
7 AC_CONFIG_HEADER([config.h])
13 if test "x$prefix" = "xNONE"; then
14 prefix=$ac_default_prefix
17 # Checks for programs.
20 ############################################################################################
21 # Set initial values of shell variables
29 ############################################################################################
30 # Create configure substitutions for dependencies
32 AC_SUBST(GLIB_DEPS_CFLAGS)
33 AC_SUBST(GLIB_DEPS_LIBS)
34 AC_SUBST(GUI_DEPS_CFLAGS)
35 AC_SUBST(GUI_DEPS_LIBS)
36 AC_SUBST(JACK_DEPS_CFLAGS)
37 AC_SUBST(JACK_DEPS_LIBS)
38 AC_SUBST(FLUIDSYNTH_DEPS_CFLAGS)
39 AC_SUBST(FLUIDSYNTH_DEPS_LIBS)
40 AC_SUBST(LV2_DEPS_CFLAGS)
41 AC_SUBST(LV2_DEPS_LIBS)
42 AC_SUBST(FFTW3_DEPS_CFLAGS)
43 AC_SUBST(FFTW3_DEPS_LIBS)
45 ############################################################################################
48 # Checks for libraries.
51 # Checks for header files.
53 AC_CHECK_HEADERS([memory.h stdint.h stdlib.h string.h time.h math.h])
55 AC_CHECK_HEADER(expat.h, true, AC_MSG_ERROR([Expat XML library not found]))
56 AC_CHECK_LIB(expat, XML_Parse, true, AC_MSG_ERROR([Expat XML library not found]))
57 AC_CHECK_HEADER(fftw3.h, true, AC_MSG_ERROR([FFTW3 header (fftw3.h) not found]))
58 AC_CHECK_LIB(fftw3, true, AC_MSG_ERROR([FFTW3 library (libfftw3) not found]))
59 AC_CHECK_LIB(fftw3f, true, AC_MSG_ERROR([Single-precision FFTW3 library (libfftw3f) not found]))
60 PKG_CHECK_MODULES(FFTW3_DEPS, fftw3, true, AC_MSG_ERROR([FFTW3 library (libfftw3) not found]))
63 AC_CHECK_HEADERS([jack/jack.h], have_jack_header=yes, have_jack_header=no)
66 PKG_CHECK_MODULES(GLIB_DEPS, glib-2.0 >= 2.0.0 gthread-2.0 >= 2.0.0, true, AC_MSG_ERROR([Calf requires glib2 and gthread2]))
69 PKG_CHECK_MODULES(FLUIDSYNTH_DEPS, fluidsynth >= 1.0.7, true, AC_MSG_ERROR([fluidsynth library not found]))
72 AC_CHECK_PROG(SORDI_ENABLED, sordi, yes, no)
74 if test "$have_jack_header" = "yes"; then
75 PKG_CHECK_MODULES(JACK_DEPS, jack >= 0.103.0,
76 AC_CHECK_LIB([jack], [jack_port_register], JACK_FOUND="yes", ),)
79 if test "$JACK_FOUND" = "yes"; then
80 PKG_CHECK_MODULES(JACK_MIDI_DEPS, jack >= 0.105.0, OLD_JACK="no", OLD_JACK="yes")
83 PKG_CHECK_MODULES(LV2_DEPS, lv2core >= 6, LV2_FOUND="yes", LV2_FOUND="no")
85 PKG_CHECK_MODULES(LASH_DEPS, lash-1.0 >= 0.6.0,
86 AC_CHECK_LIB([lash], [lash_client_is_being_restored], LASH_0_6_FOUND="yes", LASH_0_6_FOUND="no"),
88 if test "$LASH_0_6_FOUND" = "yes"; then
91 PKG_CHECK_MODULES(LASH_DEPS, lash-1.0 >= 0.5.2, LASH_FOUND="yes", LASH_FOUND="no")
93 PKG_CHECK_MODULES(SLV2_HACK, slv2 <= 0.6.1, SLV2_UNSUPPORTED="yes", SLV2_UNSUPPORTED="no")
95 ############################################################################################
96 # Assign initial values to feature control variables
98 LV2_ENABLED=$LV2_FOUND
99 LASH_ENABLED=$LASH_FOUND
101 if test "$JACK_FOUND" = "yes" -o "$LV2_FOUND" = "yes"; then
102 PKG_CHECK_MODULES(GUI_DEPS, gtk+-2.0 >= 2.12.0 cairo >= 1.2.0,
104 GUI_ENABLED="no (GTK+ 2.12 and cairo 1.2 or newer required)"
108 ############################################################################################
109 # Look for settings and installed libraries to determine what to compile/install/use
110 if test "$LV2_FOUND" = "yes"; then
111 AC_MSG_CHECKING([whether to allow LV2])
113 AC_HELP_STRING([--without-lv2],[disable LV2 interface]),
114 [if test "$withval" = "no"; then LV2_ENABLED="no"; fi],[])
115 AC_MSG_RESULT($LV2_ENABLED)
118 if test "$LASH_FOUND" = "yes"; then
119 AC_MSG_CHECKING([whether to allow LASH])
121 AC_HELP_STRING([--without-lash],[disable LASH compatibility (GPL)]),
122 [if test "$withval" = "no"; then LASH_ENABLED="no"; fi],[])
123 AC_MSG_RESULT($LASH_ENABLED)
126 AC_MSG_CHECKING([whether to enable experimental/unfinished features])
127 AC_ARG_ENABLE(experimental,
128 AC_HELP_STRING([--enable-experimental],[enable unfinished features - not recommended!]),
129 [set_enable_experimental="$enableval"],
130 [set_enable_experimental="no"])
131 AC_MSG_RESULT($set_enable_experimental)
133 AC_MSG_CHECKING([whether to enable debugging mode])
135 AC_HELP_STRING([--enable-debug],[enable debug mode - slow!]),
136 [set_enable_debug="$enableval"],
137 [set_enable_debug="no"])
138 AC_MSG_RESULT($set_enable_debug)
140 AC_MSG_CHECKING([whether to compile with SSE])
142 AC_HELP_STRING([--enable-sse],[compile with SSE extensions]),
143 [set_enable_sse="$enableval"],
144 [set_enable_sse="no"])
145 AC_MSG_RESULT($set_enable_sse)
147 ############################################################################################
148 # Compute status shell variables
150 if test "$GUI_ENABLED" = "yes" -a "$JACK_FOUND" = "yes"; then
154 if test "$GUI_ENABLED" = "yes" -a "$LV2_ENABLED" = "yes"; then
155 LV2_GUI_ENABLED="yes"
158 if test "$set_enable_debug" = "yes"; then
159 CXXFLAGS="$CXXFLAGS -O0 -g -Wall"
161 # TODO: remove -finline options if clang is used
162 CXXFLAGS="$CXXFLAGS -O3 -finline-functions -finline-functions-called-once -Wall"
165 if test "$set_enable_sse" = "yes"; then
166 CXXFLAGS="$CXXFLAGS -msse -mfpmath=sse"
169 ############################################################################################
170 # Create automake conditional symbols
171 AM_CONDITIONAL(USE_JACK, test "$JACK_ENABLED" = "yes")
172 AM_CONDITIONAL(USE_LV2, test "$LV2_ENABLED" = "yes")
173 AM_CONDITIONAL(USE_GUI, test "$GUI_ENABLED" = "yes")
174 AM_CONDITIONAL(USE_LV2_GUI, test "$LV2_GUI_ENABLED" = "yes")
175 AM_CONDITIONAL(USE_LASH, test "$LASH_ENABLED" = "yes")
176 AM_CONDITIONAL(USE_LASH_0_6, test "$LASH_0_6_ENABLED" = "yes")
177 AM_CONDITIONAL(USE_DEBUG, test "$set_enable_debug" = "yes")
178 AM_CONDITIONAL(USE_SORDI, test "$SORDI_ENABLED" = "yes")
180 ############################################################################################
181 # Create autoconf symbols for config.h
182 if test "$LV2_ENABLED" = "yes"; then
183 AC_DEFINE(USE_LV2, 1, [LV2 wrapper will be built])
185 if test "$JACK_ENABLED" = "yes"; then
186 AC_DEFINE(USE_JACK, 1, [JACK I/O will be used])
188 if test "$OLD_JACK" = "yes"; then
189 AC_DEFINE(OLD_JACK, 1, [Old JACK version (with extra nframes argument) is to be used])
191 if test "$LASH_ENABLED" = "yes"; then
192 AC_DEFINE(USE_LASH, 1, "LASH Audio Session Handler client functionality is enabled")
193 if test "$LASH_0_6_FOUND" = "yes"; then
194 AC_DEFINE(USE_LASH_0_6, 1, "Unstable LASH API is enabled")
197 if test "$LV2_GUI_ENABLED" = "yes"; then
198 AC_DEFINE(USE_LV2_GUI, 1, [GTK+ GUI executable will be used for LV2])
200 if test "$set_enable_experimental" = "yes"; then
201 AC_DEFINE([ENABLE_EXPERIMENTAL], [1], "Experimental features are enabled")
203 if test "$SORDI_ENABLED" = "yes"; then
204 AC_DEFINE(USE_SORDI, 1, "Sordi sanity checks are enabled")
206 ############################################################################################
208 if test "$LV2_ENABLED" == "yes"; then
209 AC_MSG_CHECKING(where to install LV2 plugins)
211 AC_HELP_STRING([--with-lv2-dir],[install LV2 calf.lv2 bundle to DIR (default=$prefix/lib/lv2/)]),
213 [with_lv2_dir="$prefix/lib/lv2/"])
214 AC_MSG_RESULT($with_lv2_dir)
215 AC_SUBST(with_lv2_dir)
218 ############################################################################################
220 AC_DEFINE_UNQUOTED(PKGLIBDIR,"$prefix/share/calf/",[Calf shared data directory (bitmaps, GUI XML etc.)])
221 AC_DEFINE_UNQUOTED(PKGDOCDIR,"$prefix/share/doc/calf/",[Calf documentation directory])
223 ############################################################################################
224 # Output files for configure step
225 AC_CONFIG_FILES([Makefile
232 ############################################################################################
233 # Configuration message
237 Debug mode: $set_enable_debug
238 With SSE: $set_enable_sse
239 Experimental plugins: $set_enable_experimental
240 Common GUI code: $GUI_ENABLED
241 LV2 enabled: $LV2_ENABLED
242 LV2 GTK+ GUI enabled: $LV2_GUI_ENABLED
243 JACK host enabled: $JACK_ENABLED
244 LASH enabled: $LASH_ENABLED])
245 if test "$LASH_ENABLED" = "yes"; then
246 AC_MSG_RESULT([ Unstable LASH API: $LASH_0_6_FOUND])
248 AC_MSG_RESULT([ Old-style JACK MIDI: $OLD_JACK
250 Installation prefix: $prefix
252 Note: due to usage of GPL-licensed libraries (FFTW) in this version,
253 the linked binary will be covered by GPL, even though the source is
254 LGPL-licensed. The only way to get an LGPL binary is by removing
255 or reimplementing parts that depend on FFTW.
258 if test "$SLV2_UNSUPPORTED" == "yes" -a "$LV2_ENABLED" == "yes"; then
261 An incompatible version of slv2 library has been found on this system.
263 Some features of Calf LV2 plugins (and other LV2 plugins) may not work
264 as expected in hosts that use currently installed version of libslv2.
266 Please upgrade to slv2 0.6.2 or newer version.