+ GUI: remove unused (and misleading) fields - the widget pointer is always stored...
[calf.git] / configure.ac
blob0769ccd44a5d23b1fcfc2fe42b70832d7329e123
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.61)
5 AC_INIT([calf],[0.0.19],[wdev@foltman.com])
6 AC_CONFIG_SRCDIR([config.h.in])
7 AC_CONFIG_HEADER([config.h])
9 AM_INIT_AUTOMAKE(1.8)
11 if test "x$prefix" = "xNONE"; then 
12   prefix=$ac_default_prefix
15 # Checks for programs.
16 AC_PROG_CXX
17 AC_PROG_CC
18 AC_PROG_CPP
19 AC_PROG_INSTALL
20 AC_PROG_LIBTOOL
22 # Checks for libraries.
23 PKG_PROG_PKG_CONFIG
25 # Checks for header files.
26 AC_HEADER_STDC
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"),
44     JACK_FOUND="no")
45 else
46   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.6.0,
64   AC_CHECK_LIB([lash], [lash_client_is_being_restored], LASH_0_6_ENABLED="yes", LASH_0_6_ENABLED="no"),
65   LASH_0_6_ENABLED="no")
66 if test "$LASH_0_6_ENABLED" = "yes"; then
67   LASH_ENABLED="yes"
68 else
69   PKG_CHECK_MODULES(LASH_DEPS, lash-1.0 >= 0.5.2, LASH_ENABLED="yes", LASH_ENABLED="no")
71 PKG_CHECK_MODULES(SLV2_HACK, slv2 <= 0.6.1, SLV2_UNSUPPORTED="yes", SLV2_UNSUPPORTED="no")
73 if test "$LADSPA_FOUND" = "yes"; then
74   AC_MSG_CHECKING([whether to allow LADSPA])
75   AC_ARG_WITH(ladspa,
76     AC_HELP_STRING([--without-ladspa],[disable LADSPA and DSSI interfaces]),
77       [if test "$withval" = "no"; then LADSPA_FOUND="no"; DSSI_FOUND="no"; fi],[])
78   AC_MSG_RESULT($LADSPA_FOUND)
81 if test "$DSSI_FOUND" = "yes"; then
82   AC_MSG_CHECKING([whether to allow DSSI])
83   AC_ARG_WITH(dssi,
84     AC_HELP_STRING([--without-dssi],[disable DSSI interface]),
85       [if test "$withval" = "no"; then DSSI_FOUND="no"; fi],[])
86   AC_MSG_RESULT($DSSI_FOUND)
89 if test "$LV2_ENABLED" = "yes"; then
90   AC_MSG_CHECKING([whether to allow LV2])
91   AC_ARG_WITH(lv2,
92     AC_HELP_STRING([--without-lv2],[disable LV2 interface]),
93       [if test "$withval" = "no"; then LV2_ENABLED="no"; fi],[])
94   AC_MSG_RESULT($LV2_ENABLED)
97 if test "$JACK_FOUND" = "yes" -o "$DSSI_FOUND" = "yes" -o "$LV2_ENABLED" = "yes"; then
98   PKG_CHECK_MODULES(GUI_DEPS, gtk+-2.0 >= 2.8.0 libglade-2.0 >= 2.4.0 cairo >= 1.2.0,
99     GUI_ENABLED="yes",
100     GUI_ENABLED="no (GTK+ 2.8, cairo 1.2 and libglade 2.4.0 or newer required)"
101   )
102 else
103   GUI_ENABLED="no"
106 if test "$GUI_ENABLED" = "yes" -a "$JACK_FOUND" = "yes"; then
107   JACK_ENABLED="yes"
108 else
109   JACK_ENABLED="no"
112 if test "$GUI_ENABLED" = "yes" -a "$DSSI_FOUND" = "yes"; then
113   DSSI_GUI_ENABLED="yes"
114 else
115   DSSI_GUI_ENABLED="no"
118 if test "$GUI_ENABLED" = "yes" -a "$LV2_ENABLED" = "yes"; then
119   LV2_GUI_ENABLED="yes"
120 else
121   LV2_GUI_ENABLED="no"
124 AC_MSG_CHECKING([whether to enable experimental/unfinished features])
125 AC_ARG_ENABLE(experimental,
126   AC_HELP_STRING([--enable-experimental],[enable unfinished features - not recommended!]),
127   [set_enable_experimental="$enableval"],
128   [set_enable_experimental="no"])
129 AC_MSG_RESULT($set_enable_experimental)
131 AC_MSG_CHECKING([whether to enable debugging mode])
132 AC_ARG_ENABLE(debug,
133   AC_HELP_STRING([--enable-debug],[enable debug mode - slow!]),
134   [set_enable_debug="$enableval"],
135   [set_enable_debug="no"])
136 AC_MSG_RESULT($set_enable_debug)
138 if test "$set_enable_debug" = "yes"; then
139   CXXFLAGS="$CXXFLAGS -O0 -g -Wall"
140 else
141   CXXFLAGS="$CXXFLAGS -O3 -finline-functions -finline-functions-called-once -Wall"
144 AM_CONDITIONAL(USE_DSSI, test "$DSSI_FOUND" = "yes")
145 AM_CONDITIONAL(USE_LADSPA, test "$LADSPA_FOUND" = "yes")
146 AM_CONDITIONAL(USE_JACK, test "$JACK_ENABLED" = "yes")
147 AM_CONDITIONAL(USE_LV2, test "$LV2_ENABLED" = "yes")
148 AM_CONDITIONAL(USE_GUI, test "$GUI_ENABLED" = "yes")
149 AM_CONDITIONAL(USE_DSSI_GUI, test "$DSSI_GUI_ENABLED" = "yes")
150 AM_CONDITIONAL(USE_LV2_GUI, test "$LV2_GUI_ENABLED" = "yes")
151 AM_CONDITIONAL(USE_LASH, test "$LASH_ENABLED" = "yes")
152 AM_CONDITIONAL(USE_LASH_0_6, test "$LASH_0_6_ENABLED" = "yes")
153 AM_CONDITIONAL(USE_DEBUG, test "$set_enable_debug" = "yes")
154 if test "$LADSPA_FOUND" = "yes"; then
155   AC_DEFINE([USE_LADSPA], [1], [LADSPA wrapper will be built])
157 if test "$DSSI_FOUND" = "yes"; then
158   AC_DEFINE(USE_DSSI, 1, [DSSI wrapper will be built])
160 if test "$DSSI_GUI_ENABLED" = "yes"; then
161   AC_DEFINE(USE_DSSI_GUI, 1, [GTK+ GUI for DSSI  will be built])
163 if test "$LV2_ENABLED" = "yes"; then
164   AC_DEFINE(USE_LV2, 1, [LV2 wrapper will be built])
166 if test "$LV2_GUI_ENABLED" = "yes"; then
167   AC_DEFINE(USE_LV2_GUI, 1, [GTK+ GUI for LV2 plugins will be built])
169 if test "$JACK_ENABLED" = "yes"; then
170   AC_DEFINE(USE_JACK, 1, [JACK I/O will be used])
172 if test "$OLD_JACK" = "yes"; then
173   AC_DEFINE(OLD_JACK, 1, [Old JACK version (with extra nframes argument) is to be used])
175 if test "$LASH_ENABLED" = "yes"; then
176   AC_DEFINE(USE_LASH, 1, "LASH Audio Session Handler client functionality is enabled")
177   if test "$LASH_0_6_ENABLED" = "yes"; then
178     AC_DEFINE(USE_LASH_0_6, 1, "Unstable LASH API is enabled")
179   fi
181 if test "$set_enable_experimental" = "yes"; then
182   AC_DEFINE([ENABLE_EXPERIMENTAL], [1], "Experimental features are enabled")
185 # Checks for typedefs, structures, and compiler characteristics.
186 AC_HEADER_STDBOOL
187 AC_C_CONST
188 AC_C_INLINE
189 AC_TYPE_INT16_T
190 AC_TYPE_INT32_T
191 AC_TYPE_INT64_T
192 AC_TYPE_INT8_T
193 AC_TYPE_UINT16_T
194 AC_TYPE_UINT32_T
195 AC_TYPE_UINT64_T
196 AC_TYPE_UINT8_T
198 AC_MSG_CHECKING(where to install LADSPA plugins)
199 AC_ARG_WITH(ladspa_dir,
200   AC_HELP_STRING([--with-ladspa-dir],[install LADSPA plugins to DIR (default=$prefix/lib/ladspa/)]),
201   ,
202   [with_ladspa_dir="$prefix/lib/ladspa/"])
203 AC_MSG_RESULT($with_ladspa_dir)
204 AC_SUBST(with_ladspa_dir)
206 AC_MSG_CHECKING(where to install LADSPA RDF file)
207 AC_ARG_WITH(ladspa_rdf_dir,
208   AC_HELP_STRING([--with-ladspa-rdf-dir],[install RDF file to DIR (default=$prefix/share/ladspa/rdf/)]),
209   ,
210   [with_ladspa_rdf_dir="$prefix/share/ladspa/rdf/"])
211 AC_MSG_RESULT($with_ladspa_rdf_dir)
212 AC_SUBST(with_ladspa_rdf_dir)
214 AC_MSG_CHECKING(where to install DSSI plugins)
215 AC_ARG_WITH(dssi_dir,
216   AC_HELP_STRING([--with-dssi-dir],[install DSSI plugins to DIR (default=$prefix/lib/dssi/)]),
217   ,
218   [with_dssi_dir="$prefix/lib/dssi/"])
219 AC_MSG_RESULT($with_dssi_dir)
220 AC_SUBST(with_dssi_dir)
222 if test "$LV2_ENABLED" == "yes"; then
223   AC_MSG_CHECKING(where to install LV2 plugins)
224   AC_ARG_WITH(lv2_dir,
225     AC_HELP_STRING([--with-lv2-dir],[install LV2 calf.lv2 bundle to DIR (default=$prefix/lib/lv2/)]),
226     ,
227     [with_lv2_dir="$prefix/lib/lv2/"])
228   AC_MSG_RESULT($with_lv2_dir)
229   AC_SUBST(with_lv2_dir)
232 AC_DEFINE_UNQUOTED(PKGLIBDIR,"$prefix/share/calf/",[Calf shared data directory (bitmaps, GUI XML etc.)])
234 # Checks for library functions.
235 AC_CHECK_FUNCS([floor memset pow])
237 AC_CONFIG_FILES([Makefile
238                  calf.desktop
239                  gui/Makefile
240                  icons/Makefile
241                  src/Makefile
242                  src/calf/Makefile])
243 AC_MSG_RESULT([
244     Calf configured
246     Debug mode:             $set_enable_debug
247     Experimental plugins:   $set_enable_experimental
248     LADSPA enabled:         $LADSPA_FOUND
249     DSSI enabled:           $DSSI_FOUND
250     DSSI GUI enabled:       $DSSI_GUI_ENABLED
251     LV2 enabled:            $LV2_ENABLED
252     LV2 GUI enabled:        $LV2_GUI_ENABLED
253     JACK host enabled:      $JACK_ENABLED
254     LASH enabled:           $LASH_ENABLED])
255 if test "$LASH_ENABLED" = "yes"; then
256   AC_MSG_RESULT([    Unstable LASH API:      $LASH_0_6_ENABLED])
258 AC_MSG_RESULT([    Old-style JACK MIDI:    $OLD_JACK
259     
260     Installation prefix:    $prefix
263 if test "$SLV2_UNSUPPORTED" == "yes" -a "$LV2_ENABLED" == "yes"; then 
264     AC_MSG_RESULT([
265 WARNING:
266 An incompatible version of slv2 library has been found on this system.
268 Some features of Calf LV2 plugins (and other LV2 plugins) may not work
269 as expected in hosts that use currently installed version of libslv2.
271 Please upgrade to slv2 0.6.2 or newer version.
275 AC_OUTPUT