Fix curves in LV2 hosts.
[calf.git] / configure.ac
blob5e62ba416fb97379bae706cce9485decf1046d58
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.63)
5 AC_INIT([calf],[0.0.19],[wdev@foltman.com])
6 AC_CONFIG_SRCDIR([config.h.in])
7 AC_CONFIG_HEADER([config.h])
8 LT_INIT([dlopen])
9 LT_LANG([C++])
11 AM_INIT_AUTOMAKE(1.8)
13 if test "x$prefix" = "xNONE"; then 
14   prefix=$ac_default_prefix
17 # Checks for programs.
18 AC_PROG_INSTALL
20 ############################################################################################
21 # Set initial values of shell variables
22 LV2_GUI_ENABLED="no"
23 JACK_FOUND="no"
24 JACK_ENABLED="no"
25 OLD_JACK="no"
26 GUI_ENABLED="no"
27 LASH_ENABLED="no"
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)
41 ############################################################################################
42 # Detect dependencies
44 # Checks for libraries.
45 PKG_PROG_PKG_CONFIG
47 # Checks for header files.
48 AC_HEADER_STDC
49 AC_CHECK_HEADERS([memory.h stdint.h stdlib.h string.h time.h math.h])
51 AC_CHECK_HEADER(expat.h, true, AC_MSG_ERROR([Expat XML library not found]))
52 AC_CHECK_LIB(expat, XML_Parse, true, AC_MSG_ERROR([Expat XML library not found]))
54 # JACK
55 AC_CHECK_HEADERS([jack/jack.h], have_jack_header=yes, have_jack_header=no)
57 # GLib
58 PKG_CHECK_MODULES(GLIB_DEPS, glib-2.0 >= 2.0.0, true, AC_MSG_ERROR([glib-2.0 library not found]))
60 # Fluidsynth
61 PKG_CHECK_MODULES(FLUIDSYNTH_DEPS, fluidsynth >= 1.0.7, true, AC_MSG_ERROR([fluidsynth library not found]))
63 if test "$have_jack_header" = "yes"; then
64   PKG_CHECK_MODULES(JACK_DEPS, jack >= 0.103.0,
65     AC_CHECK_LIB([jack], [jack_port_register], JACK_FOUND="yes", ),)
68 if test "$JACK_FOUND" = "yes"; then
69   PKG_CHECK_MODULES(JACK_MIDI_DEPS, jack >= 0.105.0, OLD_JACK="no", OLD_JACK="yes")
72 PKG_CHECK_MODULES(LV2_DEPS, lv2core >= 1, LV2_FOUND="yes", LV2_FOUND="no")
74 PKG_CHECK_MODULES(LASH_DEPS, lash-1.0 >= 0.6.0,
75   AC_CHECK_LIB([lash], [lash_client_is_being_restored], LASH_0_6_FOUND="yes", LASH_0_6_FOUND="no"),
76   LASH_0_6_FOUND="no")
77 if test "$LASH_0_6_FOUND" = "yes"; then
78   LASH_FOUND="yes"
79 else
80   PKG_CHECK_MODULES(LASH_DEPS, lash-1.0 >= 0.5.2, LASH_FOUND="yes", LASH_FOUND="no")
82 PKG_CHECK_MODULES(SLV2_HACK, slv2 <= 0.6.1, SLV2_UNSUPPORTED="yes", SLV2_UNSUPPORTED="no")
84 ############################################################################################
85 # Assign initial values to feature control variables
87 LV2_ENABLED=$LV2_FOUND
88 LASH_ENABLED=$LASH_FOUND
90 if test "$JACK_FOUND" = "yes" -o "$LV2_FOUND" = "yes"; then
91   PKG_CHECK_MODULES(GUI_DEPS, gtk+-2.0 >= 2.12.0 cairo >= 1.2.0,
92     GUI_ENABLED="yes",
93     GUI_ENABLED="no (GTK+ 2.12 and cairo 1.2 or newer required)"
94   )
97 ############################################################################################
98 # Look for settings and installed libraries to determine what to compile/install/use
99 if test "$LV2_FOUND" = "yes"; then
100   AC_MSG_CHECKING([whether to allow LV2])
101   AC_ARG_WITH(lv2,
102     AC_HELP_STRING([--without-lv2],[disable LV2 interface]),
103       [if test "$withval" = "no"; then LV2_ENABLED="no"; fi],[])
104   AC_MSG_RESULT($LV2_ENABLED)
107 if test "$LASH_FOUND" = "yes"; then
108   AC_MSG_CHECKING([whether to allow LASH])
109   AC_ARG_WITH(lash,
110     AC_HELP_STRING([--without-lash],[disable LASH compatibility (GPL)]),
111       [if test "$withval" = "no"; then LASH_ENABLED="no"; fi],[])
112   AC_MSG_RESULT($LASH_ENABLED)
115 AC_MSG_CHECKING([whether to enable experimental/unfinished features])
116 AC_ARG_ENABLE(experimental,
117   AC_HELP_STRING([--enable-experimental],[enable unfinished features - not recommended!]),
118   [set_enable_experimental="$enableval"],
119   [set_enable_experimental="no"])
120 AC_MSG_RESULT($set_enable_experimental)
122 AC_MSG_CHECKING([whether to enable debugging mode])
123 AC_ARG_ENABLE(debug,
124   AC_HELP_STRING([--enable-debug],[enable debug mode - slow!]),
125   [set_enable_debug="$enableval"],
126   [set_enable_debug="no"])
127 AC_MSG_RESULT($set_enable_debug)
129 ############################################################################################
130 # Compute status shell variables
132 if test "$GUI_ENABLED" = "yes" -a "$JACK_FOUND" = "yes"; then
133   JACK_ENABLED="yes"
136 if test "$GUI_ENABLED" = "yes" -a "$LV2_ENABLED" = "yes"; then
137   LV2_GUI_ENABLED="yes"
140 if test "$set_enable_debug" = "yes"; then
141   CXXFLAGS="$CXXFLAGS -O0 -g -Wall"
142 else
143   CXXFLAGS="$CXXFLAGS -O3 -finline-functions -finline-functions-called-once -Wall"
146 ############################################################################################
147 # Create automake conditional symbols
148 AM_CONDITIONAL(USE_JACK, test "$JACK_ENABLED" = "yes")
149 AM_CONDITIONAL(USE_LV2, test "$LV2_ENABLED" = "yes")
150 AM_CONDITIONAL(USE_GUI, test "$GUI_ENABLED" = "yes")
151 AM_CONDITIONAL(USE_LV2_GUI, test "$LV2_GUI_ENABLED" = "yes")
152 AM_CONDITIONAL(USE_LASH, test "$LASH_ENABLED" = "yes")
153 AM_CONDITIONAL(USE_LASH_0_6, test "$LASH_0_6_ENABLED" = "yes")
154 AM_CONDITIONAL(USE_DEBUG, test "$set_enable_debug" = "yes")
156 ############################################################################################
157 # Create autoconf symbols for config.h
158 if test "$LV2_ENABLED" = "yes"; then
159   AC_DEFINE(USE_LV2, 1, [LV2 wrapper will be built])
161 if test "$JACK_ENABLED" = "yes"; then
162   AC_DEFINE(USE_JACK, 1, [JACK I/O will be used])
164 if test "$OLD_JACK" = "yes"; then
165   AC_DEFINE(OLD_JACK, 1, [Old JACK version (with extra nframes argument) is to be used])
167 if test "$LASH_ENABLED" = "yes"; then
168   AC_DEFINE(USE_LASH, 1, "LASH Audio Session Handler client functionality is enabled")
169   if test "$LASH_0_6_FOUND" = "yes"; then
170     AC_DEFINE(USE_LASH_0_6, 1, "Unstable LASH API is enabled")
171   fi
173 if test "$LV2_GUI_ENABLED" = "yes"; then
174   AC_DEFINE(USE_LV2_GUI, 1, [GTK+ GUI executable will be used for LV2])
176 if test "$set_enable_experimental" = "yes"; then
177   AC_DEFINE([ENABLE_EXPERIMENTAL], [1], "Experimental features are enabled")
180 ############################################################################################
181 # Output directories
182 if test "$LV2_ENABLED" == "yes"; then
183   AC_MSG_CHECKING(where to install LV2 plugins)
184   AC_ARG_WITH(lv2_dir,
185     AC_HELP_STRING([--with-lv2-dir],[install LV2 calf.lv2 bundle to DIR (default=$prefix/lib/lv2/)]),
186     ,
187     [with_lv2_dir="$prefix/lib/lv2/"])
188   AC_MSG_RESULT($with_lv2_dir)
189   AC_SUBST(with_lv2_dir)
192 ############################################################################################
193 # Other defines
194 AC_DEFINE_UNQUOTED(PKGLIBDIR,"$prefix/share/calf/",[Calf shared data directory (bitmaps, GUI XML etc.)])
196 ############################################################################################
197 # Output files for configure step
198 AC_CONFIG_FILES([Makefile
199                  calf.desktop
200                  gui/Makefile
201                  gui/calf.rc
202                  icons/Makefile
203                  src/Makefile
204                  src/calf/Makefile])
206 ############################################################################################
207 # Configuration message
208 AC_MSG_RESULT([
209     Calf configured
211     Debug mode:                  $set_enable_debug
212     Experimental plugins:        $set_enable_experimental
213     Common GUI code:             $GUI_ENABLED
214     LV2 enabled:                 $LV2_ENABLED
215     LV2 GTK+ GUI enabled:        $LV2_GUI_ENABLED
216     JACK host enabled:           $JACK_ENABLED
217     LASH enabled:                $LASH_ENABLED])
218 if test "$LASH_ENABLED" = "yes"; then
219   AC_MSG_RESULT([    Unstable LASH API:           $LASH_0_6_FOUND])
221 AC_MSG_RESULT([    Old-style JACK MIDI:         $OLD_JACK
222     
223     Installation prefix:         $prefix
226 if test "$SLV2_UNSUPPORTED" == "yes" -a "$LV2_ENABLED" == "yes"; then 
227     AC_MSG_RESULT([
228 WARNING:
229 An incompatible version of slv2 library has been found on this system.
231 Some features of Calf LV2 plugins (and other LV2 plugins) may not work
232 as expected in hosts that use currently installed version of libslv2.
234 Please upgrade to slv2 0.6.2 or newer version.
238 AC_OUTPUT