2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([calf],[0.0.16.3],[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]))
40 if test "$have_jack_header" = "yes"; then
41 PKG_CHECK_MODULES(JACK_DEPS, jack >= 0.103.0,
42 AC_CHECK_LIB([jack], [jack_port_register], JACK_FOUND="yes", JACK_FOUND="no"),
48 if test "$JACK_FOUND" = "yes"; then
49 PKG_CHECK_MODULES(JACK_MIDI_DEPS, jack >= 0.105.0, OLD_JACK="no", OLD_JACK="yes")
52 AC_SUBST(GLIB_DEPS_CFLAGS)
53 AC_SUBST(GLIB_DEPS_LIBS)
54 AC_SUBST(GUI_DEPS_CFLAGS)
55 AC_SUBST(GUI_DEPS_LIBS)
56 AC_SUBST(JACK_DEPS_CFLAGS)
57 AC_SUBST(JACK_DEPS_LIBS)
59 PKG_CHECK_MODULES(LV2_DEPS, lv2core >= 1, LV2_ENABLED="yes", LV2_ENABLED="no")
60 PKG_CHECK_MODULES(LASH_DEPS, lash-1.0 >= 0.5.2, LASH_ENABLED="yes", LASH_ENABLED="no")
62 if test "$JACK_FOUND" = "yes" -o "$DSSI_FOUND" = "yes" -o "$LV2_ENABLED" = "yes"; then
63 PKG_CHECK_MODULES(GUI_DEPS, gtk+-2.0 >= 2.8.0 libglade-2.0 >= 2.4.0 cairo >= 1.2.0,
65 GUI_ENABLED="no (GTK+ 2.8, cairo 1.2 and libglade 2.4.0 or newer required)"
71 if test "$GUI_ENABLED" = "yes" -a "$JACK_FOUND" = "yes"; then
77 if test "$GUI_ENABLED" = "yes" -a "$DSSI_FOUND" = "yes"; then
78 DSSI_GUI_ENABLED="yes"
83 if test "$GUI_ENABLED" = "yes" -a "$LV2_ENABLED" = "yes"; then
89 AC_MSG_CHECKING([whether to enable experimental/unfinished features])
90 AC_ARG_ENABLE(experimental,
91 AC_HELP_STRING([--enable-experimental],[enable unfinished features - not recommended!]),
92 [set_enable_experimental="$enableval"],
93 [set_enable_experimental="no"])
94 AC_MSG_RESULT($set_enable_experimental)
96 AC_MSG_CHECKING([whether to enable debugging mode])
98 AC_HELP_STRING([--enable-debug],[enable debug mode - slow!]),
99 [set_enable_debug="$enableval"],
100 [set_enable_debug="no"])
101 AC_MSG_RESULT($set_enable_debug)
103 if test "$set_enable_debug" = "yes"; then
104 CXXFLAGS="$CXXFLAGS -O0 -g -Wall"
106 CXXFLAGS="$CXXFLAGS -O3 -finline-functions -finline-functions-called-once -Wall"
109 AM_CONDITIONAL(USE_DSSI, test "$DSSI_FOUND" = "yes")
110 AM_CONDITIONAL(USE_LADSPA, test "$LADSPA_FOUND" = "yes")
111 AM_CONDITIONAL(USE_JACK, test "$JACK_ENABLED" = "yes")
112 AM_CONDITIONAL(USE_LV2, test "$LV2_ENABLED" = "yes")
113 AM_CONDITIONAL(USE_GUI, test "$GUI_ENABLED" = "yes")
114 AM_CONDITIONAL(USE_DSSI_GUI, test "$DSSI_GUI_ENABLED" = "yes")
115 AM_CONDITIONAL(USE_LV2_GUI, test "$LV2_GUI_ENABLED" = "yes")
116 AM_CONDITIONAL(USE_LASH, test "$LASH_ENABLED" = "yes")
117 AM_CONDITIONAL(USE_DEBUG, test "$set_enable_debug" = "yes")
118 if test "$LADSPA_FOUND" = "yes"; then
119 AC_DEFINE([USE_LADSPA], [1], [LADSPA wrapper will be built])
121 if test "$DSSI_FOUND" = "yes"; then
122 AC_DEFINE(USE_DSSI, 1, [DSSI wrapper will be built])
124 if test "$DSSI_GUI_ENABLED" = "yes"; then
125 AC_DEFINE(USE_DSSI_GUI, 1, [GTK+ GUI for DSSI will be built])
127 if test "$LV2_ENABLED" = "yes"; then
128 AC_DEFINE(USE_LV2, 1, [LV2 wrapper will be built])
130 if test "$LV2_GUI_ENABLED" = "yes"; then
131 AC_DEFINE(USE_LV2_GUI, 1, [GTK+ GUI for LV2 plugins will be built])
133 if test "$JACK_ENABLED" = "yes"; then
134 AC_DEFINE(USE_JACK, 1, [JACK I/O will be used])
136 if test "$OLD_JACK" = "yes"; then
137 AC_DEFINE(OLD_JACK, 1, [Old JACK version (with extra nframes argument) is to be used])
139 if test "$LASH_ENABLED" = "yes"; then
140 AC_DEFINE(USE_LASH, 1, "LASH Audio Session Handler client functionality is enabled")
142 if test "$set_enable_experimental" = "yes"; then
143 AC_DEFINE([ENABLE_EXPERIMENTAL], [1], "Experimental features are enabled")
146 # Checks for typedefs, structures, and compiler characteristics.
159 AC_MSG_CHECKING(where to install LADSPA plugins)
160 AC_ARG_WITH(ladspa_dir,
161 AC_HELP_STRING([--with-ladspa-dir],[install LADSPA plugins to DIR (default=$prefix/lib/ladspa/)]),
163 [with_ladspa_dir="$prefix/lib/ladspa/"])
164 AC_MSG_RESULT($with_ladspa_dir)
165 AC_SUBST(with_ladspa_dir)
167 AC_MSG_CHECKING(where to install LADSPA RDF file)
168 AC_ARG_WITH(ladspa_rdf_dir,
169 AC_HELP_STRING([--with-ladspa-rdf-dir],[install RDF file to DIR (default=$prefix/share/ladspa/rdf/)]),
171 [with_ladspa_rdf_dir="$prefix/share/ladspa/rdf/"])
172 AC_MSG_RESULT($with_ladspa_rdf_dir)
173 AC_SUBST(with_ladspa_rdf_dir)
175 AC_MSG_CHECKING(where to install DSSI plugins)
176 AC_ARG_WITH(dssi_dir,
177 AC_HELP_STRING([--with-dssi-dir],[install DSSI plugins to DIR (default=$prefix/lib/dssi/)]),
179 [with_dssi_dir="$prefix/lib/dssi/"])
180 AC_MSG_RESULT($with_dssi_dir)
181 AC_SUBST(with_dssi_dir)
183 if test "$LV2_ENABLED" == "yes"; then
184 AC_MSG_CHECKING(where to install LV2 plugins)
186 AC_HELP_STRING([--with-lv2-dir],[install LV2 calf.lv2 bundle to DIR (default=$prefix/lib/lv2/)]),
188 [with_lv2_dir="$prefix/lib/lv2/"])
189 AC_MSG_RESULT($with_lv2_dir)
190 AC_SUBST(with_lv2_dir)
193 # Checks for library functions.
194 AC_CHECK_FUNCS([floor memset pow])
196 AC_CONFIG_FILES([Makefile
203 Debug mode: $set_enable_debug
204 LADSPA enabled: $LADSPA_FOUND
205 DSSI enabled: $DSSI_FOUND
206 DSSI GUI enabled: $DSSI_GUI_ENABLED
207 LV2 enabled: $LV2_ENABLED
208 LV2 GUI enabled: $LV2_GUI_ENABLED
209 JACK host enabled: $JACK_ENABLED
210 LASH enabled: $LASH_ENABLED
211 Old-style JACK MIDI: $OLD_JACK
213 Installation prefix: $prefix