File: configure.ac

package info (click to toggle)
calf 0.0.19+git20140915+5de5da28-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,748 kB
  • ctags: 8,054
  • sloc: cpp: 32,680; xml: 10,722; ansic: 3,431; python: 1,537; makefile: 188; lex: 51; sh: 20
file content (270 lines) | stat: -rw-r--r-- 9,644 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.63)
AC_INIT([calf],[0.0.19],[wdev@foltman.com])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADER([config.h])
LT_INIT([dlopen])
LT_LANG([C++])

AM_INIT_AUTOMAKE(1.8)

if test "x$prefix" = "xNONE"; then 
  prefix=$ac_default_prefix
fi

# Checks for programs.
AC_PROG_INSTALL

############################################################################################
# Set initial values of shell variables
LV2_GUI_ENABLED="no"
JACK_FOUND="no"
JACK_ENABLED="no"
OLD_JACK="no"
GUI_ENABLED="no"
LASH_ENABLED="no"

############################################################################################
# Create configure substitutions for dependencies

AC_SUBST(GLIB_DEPS_CFLAGS)
AC_SUBST(GLIB_DEPS_LIBS)
AC_SUBST(GUI_DEPS_CFLAGS)
AC_SUBST(GUI_DEPS_LIBS)
AC_SUBST(JACK_DEPS_CFLAGS)
AC_SUBST(JACK_DEPS_LIBS)
AC_SUBST(FLUIDSYNTH_DEPS_CFLAGS)
AC_SUBST(FLUIDSYNTH_DEPS_LIBS)
AC_SUBST(LV2_DEPS_CFLAGS)
AC_SUBST(LV2_DEPS_LIBS)
AC_SUBST(FFTW3_DEPS_CFLAGS)
AC_SUBST(FFTW3_DEPS_LIBS)

############################################################################################
# Detect dependencies

# Checks for libraries.
PKG_PROG_PKG_CONFIG

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([memory.h stdint.h stdlib.h string.h time.h math.h])

AC_CHECK_HEADER(expat.h, true, AC_MSG_ERROR([Expat XML library not found]))
AC_CHECK_LIB(expat, XML_Parse, true, AC_MSG_ERROR([Expat XML library not found]))
AC_CHECK_HEADER(fftw3.h, true, AC_MSG_ERROR([FFTW3 header (fftw3.h) not found]))
AC_CHECK_LIB(fftw3, true, AC_MSG_ERROR([FFTW3 library (libfftw3) not found]))
AC_CHECK_LIB(fftw3f, true, AC_MSG_ERROR([Single-precision FFTW3 library (libfftw3f) not found]))
PKG_CHECK_MODULES(FFTW3_DEPS, fftw3, true, AC_MSG_ERROR([FFTW3 library (libfftw3) not found]))

# JACK
AC_CHECK_HEADERS([jack/jack.h], have_jack_header=yes, have_jack_header=no)

# GLib
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]))

# Fluidsynth
PKG_CHECK_MODULES(FLUIDSYNTH_DEPS, fluidsynth >= 1.0.7, true, AC_MSG_ERROR([fluidsynth library not found]))

# Sordi
AC_CHECK_PROG(SORDI_ENABLED, sordi, yes, no)

if test "$have_jack_header" = "yes"; then
  PKG_CHECK_MODULES(JACK_DEPS, jack >= 0.103.0,
    AC_CHECK_LIB([jack], [jack_port_register], JACK_FOUND="yes", ),)
fi

if test "$JACK_FOUND" = "yes"; then
  PKG_CHECK_MODULES(JACK_MIDI_DEPS, jack >= 0.105.0, OLD_JACK="no", OLD_JACK="yes")
fi

PKG_CHECK_MODULES(LV2_DEPS, lv2 >= 1.0, LV2_FOUND="yes", LV2_FOUND="no")

PKG_CHECK_MODULES(LASH_DEPS, lash-1.0 >= 0.6.0,
  AC_CHECK_LIB([lash], [lash_client_is_being_restored], LASH_0_6_FOUND="yes", LASH_0_6_FOUND="no"),
  LASH_0_6_FOUND="no")
if test "$LASH_0_6_FOUND" = "yes"; then
  LASH_FOUND="yes"
else
  PKG_CHECK_MODULES(LASH_DEPS, lash-1.0 >= 0.5.2, LASH_FOUND="yes", LASH_FOUND="no")
fi
PKG_CHECK_MODULES(SLV2_HACK, slv2 <= 0.6.1, SLV2_UNSUPPORTED="yes", SLV2_UNSUPPORTED="no")

############################################################################################
# Assign initial values to feature control variables

LV2_ENABLED=$LV2_FOUND
LASH_ENABLED=$LASH_FOUND

if test "$JACK_FOUND" = "yes" -o "$LV2_FOUND" = "yes"; then
  PKG_CHECK_MODULES(GUI_DEPS, gtk+-2.0 >= 2.12.0 cairo >= 1.2.0,
    GUI_ENABLED="yes",
    GUI_ENABLED="no (GTK+ 2.12 and cairo 1.2 or newer required)"
  )
fi

############################################################################################
# Look for settings and installed libraries to determine what to compile/install/use
if test "$LV2_FOUND" = "yes"; then
  AC_MSG_CHECKING([whether to allow LV2])
  AC_ARG_WITH(lv2,
    AC_HELP_STRING([--without-lv2],[disable LV2 interface]),
      [if test "$withval" = "no"; then LV2_ENABLED="no"; fi],[])
  AC_MSG_RESULT($LV2_ENABLED)
fi

if test "$LASH_FOUND" = "yes"; then
  AC_MSG_CHECKING([whether to allow LASH])
  AC_ARG_WITH(lash,
    AC_HELP_STRING([--without-lash],[disable LASH compatibility (GPL)]),
      [if test "$withval" = "no"; then LASH_ENABLED="no"; fi],[])
  AC_MSG_RESULT($LASH_ENABLED)
fi

AC_MSG_CHECKING([whether to enable experimental/unfinished features])
AC_ARG_ENABLE(experimental,
  AC_HELP_STRING([--enable-experimental],[enable unfinished features - not recommended!]),
  [set_enable_experimental="$enableval"],
  [set_enable_experimental="no"])
AC_MSG_RESULT($set_enable_experimental)

AC_MSG_CHECKING([whether to enable debugging mode])
AC_ARG_ENABLE(debug,
  AC_HELP_STRING([--enable-debug],[enable debug mode - slow!]),
  [set_enable_debug="$enableval"],
  [set_enable_debug="no"])
AC_MSG_RESULT($set_enable_debug)

AC_MSG_CHECKING([whether to compile with SSE])
AC_ARG_ENABLE(sse,
  AC_HELP_STRING([--enable-sse],[compile with SSE extensions]),
  [set_enable_sse="$enableval"],
  [set_enable_sse="no"])
AC_MSG_RESULT($set_enable_sse)

############################################################################################
# Compute status shell variables

if test "$GUI_ENABLED" = "yes" -a "$JACK_FOUND" = "yes"; then
  JACK_ENABLED="yes"
fi

if test "$GUI_ENABLED" = "yes" -a "$LV2_ENABLED" = "yes"; then
  LV2_GUI_ENABLED="yes"
fi

if test "$set_enable_debug" = "yes"; then
  CXXFLAGS="$CXXFLAGS -O0 -g -Wall"
else
  # TODO: remove -finline options if clang is used
  CXXFLAGS="$CXXFLAGS -O3 -finline-functions -finline-functions-called-once -Wall"
fi

if test "$set_enable_sse" = "yes"; then
  CXXFLAGS="$CXXFLAGS -msse -mfpmath=sse"
fi

############################################################################################
# Create automake conditional symbols
AM_CONDITIONAL(USE_JACK, test "$JACK_ENABLED" = "yes")
AM_CONDITIONAL(USE_LV2, test "$LV2_ENABLED" = "yes")
AM_CONDITIONAL(USE_GUI, test "$GUI_ENABLED" = "yes")
AM_CONDITIONAL(USE_LV2_GUI, test "$LV2_GUI_ENABLED" = "yes")
AM_CONDITIONAL(USE_LASH, test "$LASH_ENABLED" = "yes")
AM_CONDITIONAL(USE_LASH_0_6, test "$LASH_0_6_ENABLED" = "yes")
AM_CONDITIONAL(USE_DEBUG, test "$set_enable_debug" = "yes")
AM_CONDITIONAL(USE_SORDI, test "$SORDI_ENABLED" = "yes")

############################################################################################
# Create autoconf symbols for config.h
if test "$LV2_ENABLED" = "yes"; then
  AC_DEFINE(USE_LV2, 1, [LV2 wrapper will be built])
fi
if test "$JACK_ENABLED" = "yes"; then
  AC_DEFINE(USE_JACK, 1, [JACK I/O will be used])
fi
if test "$OLD_JACK" = "yes"; then
  AC_DEFINE(OLD_JACK, 1, [Old JACK version (with extra nframes argument) is to be used])
fi
if test "$LASH_ENABLED" = "yes"; then
  AC_DEFINE(USE_LASH, 1, "LASH Audio Session Handler client functionality is enabled")
  if test "$LASH_0_6_FOUND" = "yes"; then
    AC_DEFINE(USE_LASH_0_6, 1, "Unstable LASH API is enabled")
  fi
fi
if test "$LV2_GUI_ENABLED" = "yes"; then
  AC_DEFINE(USE_LV2_GUI, 1, [GTK+ GUI executable will be used for LV2])
fi
if test "$set_enable_experimental" = "yes"; then
  AC_DEFINE([ENABLE_EXPERIMENTAL], [1], "Experimental features are enabled")
fi
if test "$SORDI_ENABLED" = "yes"; then
  AC_DEFINE(USE_SORDI, 1, "Sordi sanity checks are enabled")
fi
############################################################################################
# Output directories
if test "$LV2_ENABLED" == "yes"; then
  AC_MSG_CHECKING(where to install LV2 plugins)
  AC_ARG_WITH(lv2_dir,
    AC_HELP_STRING([--with-lv2-dir],[install LV2 calf.lv2 bundle to DIR (default=$prefix/lib/lv2/)]),
    ,
    [with_lv2_dir="$prefix/lib/lv2/"])
  AC_MSG_RESULT($with_lv2_dir)
  AC_SUBST(with_lv2_dir)
fi

############################################################################################
# Other defines
AC_DEFINE_UNQUOTED(PKGLIBDIR,"$prefix/share/calf/",[Calf shared data directory (bitmaps, GUI XML etc.)])
AC_DEFINE_UNQUOTED(PKGDOCDIR,"$prefix/share/doc/calf/",[Calf documentation directory])

############################################################################################
# Output files for configure step
AC_CONFIG_FILES([Makefile
                 calf.desktop
                 gui/Makefile
                 icons/Makefile
                 src/Makefile
                 src/calf/Makefile])

############################################################################################
# Configuration message
AC_MSG_RESULT([
    Calf configured

    Debug mode:                  $set_enable_debug
    With SSE:                    $set_enable_sse
    Experimental plugins:        $set_enable_experimental
    Common GUI code:             $GUI_ENABLED
    LV2 enabled:                 $LV2_ENABLED
    LV2 GTK+ GUI enabled:        $LV2_GUI_ENABLED
    JACK host enabled:           $JACK_ENABLED
    LASH enabled:                $LASH_ENABLED])
if test "$LASH_ENABLED" = "yes"; then
  AC_MSG_RESULT([    Unstable LASH API:           $LASH_0_6_FOUND])
fi
AC_MSG_RESULT([    Old-style JACK MIDI:         $OLD_JACK
    
    Installation prefix:         $prefix
    
    Note: due to usage of GPL-licensed libraries (FFTW) in this version,
    the linked binary will be covered by GPL, even though the source is
    LGPL-licensed. The only way to get an LGPL binary is by removing
    or reimplementing parts that depend on FFTW.
])

if test "$SLV2_UNSUPPORTED" == "yes" -a "$LV2_ENABLED" == "yes"; then 
    AC_MSG_RESULT([
WARNING:
An incompatible version of slv2 library has been found on this system.

Some features of Calf LV2 plugins (and other LV2 plugins) may not work
as expected in hosts that use currently installed version of libslv2.

Please upgrade to slv2 0.6.2 or newer version.
])
fi

AC_OUTPUT