forked from essej/sooperlooper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
382 lines (305 loc) · 15.8 KB
/
configure.ac
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/engine.cpp)
AC_CONFIG_AUX_DIR(.)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_VALIDATE_CACHED_SYSTEM_TUPLE()
SOOP_MAJOR_VERSION=1
SOOP_MINOR_VERSION=7
SOOP_MICRO_VERSION=0
BETA=
AC_SUBST(SOOP_MAJOR_VERSION)
AC_SUBST(SOOP_MINOR_VERSION)
AC_SUBST(SOOP_MICRO_VERSION)
SOOP_SO_VERSION=${SOOP_MAJOR_VERSION}:${SOOP_MINOR_VERSION}:${SOOP_MICRO_VERSION}${BETA}
SOOP_VERSION=$SOOP_MAJOR_VERSION.$SOOP_MINOR_VERSION.${SOOP_MICRO_VERSION}${BETA}
SOOP_RELEASE=$SOOP_MAJOR_VERSION-$SOOP_MINOR_VERSION-${SOOP_MICRO_VERSION}${BETA}
AC_SUBST(SOOP_SO_VERSION)
AC_SUBST(SOOP_VERSION)
AC_SUBST(SOOP_RELEASE)
AM_INIT_AUTOMAKE(sooperlooper,$SOOP_VERSION)
AC_CONFIG_HEADERS(config.h)
dnl ====================================================================
dnl you do have C++, right ?
dnl ====================================================================
AC_PROG_CC
AC_PROG_CXX
if test "$ac_cv_prog_cxx" = "no" ; then
AC_MSG_ERROR([*** SooperLooper is written in C++. You don't appear to have a C++ compiler])
fi
AC_C_BIGENDIAN
#if test x"$GXX" = xyes ; then
# CXXFLAGS="$CXXFLAGS -Wall"
#fi
#OPT_CXXFLAGS="-D_REENTRANT -O6 -fomit-frame-pointer -ffast-math -fstrength-reduce -funroll-loops -fmove-all-movables"
ORIG_CXXFLAGS=$CXXFLAGS
AM_OPT_FLAGS
CXXFLAGS=$ORIG_CXXFLAGS
AC_ARG_ENABLE(optimize,
[ --disable-optimize avoid optimizations to allow for gdb debugging.],
[ if test "x$enable_optimize" = "xno" ; then OPT_CXXFLAGS="" ; fi ],
[ OPT_CXXFLAGS="$OPT_CXXFLAGS" ])
AC_MSG_RESULT([OPT_CXXFLAGS is set based on $OPT_CXXFLAGS])
AC_PROG_RANLIB
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING([for --with-macosx-sdk])
AC_ARG_WITH(macosx-sdk, [ --with-macosx-sdk=PATH use an OS X SDK at PATH], [
wxUSE_MACOSX_SDK=$withval
wx_cv_use_macosx_sdk="wxUSE_MACOSX_SDK=$withval"
#echo "wxUSE_MACOSX_SDK=$wxUSE_MACOSX_SDK" >> ${wx_arg_cache_file}.tmp
], [
# NOTE: Empty string on purpose so that --without-macosx-sdk (thus no)
# will override --enable-universal_binary's automatic SDK usage.
wxUSE_MACOSX_SDK=
#LINE=`grep "^wxUSE_MACOSX_SDK=" ${wx_arg_cache_file}`
#if test "x$LINE" != x ; then
# eval "$LINE"
# echo "$LINE" >> ${wx_arg_cache_file}.tmp
#fi
])
AC_MSG_RESULT([$wxUSE_MACOSX_SDK])
AC_MSG_CHECKING([for --with-macosx-version-min])
AC_ARG_WITH(macosx-version-min, [ --with-macosx-version-min=VER build binaries which require at least this OS X version], [
wxUSE_MACOSX_VERSION_MIN=$withval
wx_cv_use_macosx_version_min="wxUSE_MACOSX_VERSION_MIN=$withval"
#echo "wxUSE_MACOSX_VERSION_MIN=$wxUSE_MACOSX_VERSION_MIN" >> ${wx_arg_cache_file}.tmp
], [
# default "yes" because when not using an SDK it means the same as no
# but when using an SDK it means to use the SDK version
wxUSE_MACOSX_VERSION_MIN=yes
# See if there is a value in the cache
#LINE=`grep "^wxUSE_MACOSX_VERSION_MIN=" ${wx_arg_cache_file}`
#if test "x$LINE" != x ; then
# eval "$LINE"
# echo "$LINE" >> ${wx_arg_cache_file}.tmp
#fi
])
AC_MSG_RESULT([$wxUSE_MACOSX_VERSION_MIN])
dnl Set up the Mac OS X SDK. We do this early so configure tests will occur
dnl with the SDK in place.
dnl NOTE: We clobber wxUSE_MACOSX_SDK with the SDK path
if test "x$wxUSE_MACOSX_SDK" = "xno"; then
wxUSE_MACOSX_SDK=
elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then
# TODO: Search for most recent SDK and use it.
wxUSE_MACOSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk"
fi
if test "x$wxUSE_MACOSX_SDK" != "x"; then
AC_MSG_CHECKING([for SDK directory $wxUSE_MACOSX_SDK])
if ! test -d "$wxUSE_MACOSX_SDK"; then
AC_MSG_FAILURE([not found])
else
AC_MSG_RESULT([exists])
fi
MACOSX_SDK_OPTS="-isysroot $wxUSE_MACOSX_SDK"
eval "CC=\"$CC $MACOSX_SDK_OPTS\""
eval "CXX=\"$CXX $MACOSX_SDK_OPTS\""
eval "LD=\"$LD $MACOSX_SDK_OPTS\""
retest_macosx_linking=yes
dnl NOTE: When libtool is used in lieu of AR/RANLIB (i.e. in static mode)
dnl the syslibroot makes no difference. We aren't using libtool now but
dnl if we ever did, be aware that you don't need to worry about it.
fi
dnl Set up the deployment target
dnl No : Don't specify a min version even if using an SDK
dnl Yes : Use the version from the SDK if used, otherwise same as no
dnl Param: Use the specified version
if test "x$wxUSE_MACOSX_VERSION_MIN" = "xno"; then
wxUSE_MACOSX_VERSION_MIN=
elif test "x$wxUSE_MACOSX_VERSION_MIN" = "xyes"; then
if test "x$wxUSE_MACOSX_SDK" != "x"; then
AC_MSG_CHECKING([SDK deployment version])
dnl We need to quote the next line where we don't need macros and do need [] in the regex
[
MACOSX_SDK_PLIST_VERSION_MIN=`defaults read "$wxUSE_MACOSX_SDK/SDKSettings" buildSettings | grep '^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}[^"]*"\{0,1\}; *$' | sed 's/^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}\([^"]*\)"\{0,1\} *; *$/\1/'`
]
# If that failed, try again with the new key
if test "x$MACOSX_SDK_PLIST_VERSION_MIN" == "x"; then
[
MACOSX_SDK_PLIST_VERSION_MIN=`defaults read "$wxUSE_MACOSX_SDK/SDKSettings" DefaultProperties | grep '^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}[^"]*"\{0,1\}; *$' | sed 's/^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}\([^"]*\)"\{0,1\} *; *$/\1/'`
]
fi
if test "x$MACOSX_SDK_PLIST_VERSION_MIN" != "x"; then
wxUSE_MACOSX_VERSION_MIN=$MACOSX_SDK_PLIST_VERSION_MIN
AC_MSG_RESULT([$wxUSE_MACOSX_VERSION_MIN])
else
AC_MSG_WARN([Could not determine deployment target from SDKSettings.plist])
wxUSE_MACOSX_VERSION_MIN=
fi
else
wxUSE_MACOSX_VERSION_MIN=
fi
fi
if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then
MACOSX_VERSION_MIN_OPTS="-mmacosx-version-min=$wxUSE_MACOSX_VERSION_MIN"
eval "CC=\"$CC $MACOSX_VERSION_MIN_OPTS\""
eval "CXX=\"$CXX $MACOSX_VERSION_MIN_OPTS\""
eval "LD=\"$LD $MACOSX_VERSION_MIN_OPTS\""
retest_macosx_linking=yes
fi
dnl If either an SDK or a version option was added, make sure that we can
dnl still compile and link both C and C++. If we didn't do this, then most
dnl of the remaining tests would fail.
if test "x$retest_macosx_linking" = "xyes"; then
AC_LANG_PUSH(C)
AC_MSG_CHECKING([if C compiler works with SDK/version options])
AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no. Try a different SDK]); exit 1])
AC_LANG_POP()
AC_LANG_PUSH(C++)
AC_MSG_CHECKING([if C++ compiler works with SDK/version options])
AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no. Try a different SDK]); exit 1])
AC_LANG_POP()
fi
#[ --enable-optimize enable optimizations.],
# [ if test "x$enable_optimize" != "xno" ; then OPT_CXXFLAGS="$OPT_CXXFLAGS" ; fi ],
# [ OPT_CXXFLAGS="" ]
#)
#AM_PATH_GTK(1.0.0, , [
# AC_MSG_ERROR([*** soop requires GTK+, but it doesn't appear to be installed])
#])
PKG_CHECK_MODULES(JACK, jack >= 0.80.0, have_jack=yes, have_jack=no)
if test "x$have_jack" != "xno"
then
echo JACKLIBS is ${JACK_LIBS}
AC_CHECK_LIB(jack, jack_client_open,
[ AC_DEFINE([HAVE_JACK_CLIENT_OPEN], 1, [Have newer JACK connect call])],
[],
[${JACK_LIBS}])
fi
AC_SUBST(JACK_LIBS)
AC_SUBST(JACK_CFLAGS)
PKG_CHECK_MODULES(LOSC, liblo >= 0.10)
AC_SUBST(LOSC_LIBS)
AC_SUBST(LOSC_CFLAGS)
dnl curses
AC_CHECK_LIB(ncurses,initscr,have_ncurses=yes,[AC_MSG_WARN([******** you don't have the ncurses library correctly installed])])
NCURSES_LIBS=-lncurses
AC_SUBST(NCURSES_LIBS)
dnl sigc++
PKG_CHECK_MODULES(SIGCPP, sigc++-2.0 >= 2.2.10)
AC_SUBST(SIGCPP_LIBS)
AC_SUBST(SIGCPP_CFLAGS)
dnl LIBXML
PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.5)
AC_SUBST(XML_CFLAGS)
AC_SUBST(XML_LIBS)
dnl libsndfile
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2, ac_cv_sndfile=1, ac_cv_sndfile=0)
AC_DEFINE_UNQUOTED([HAVE_SNDFILE],${ac_cv_sndfile},[Set to 1 if you have libsndfile.])
AC_SUBST(SNDFILE_CFLAGS)
AC_SUBST(SNDFILE_LIBS)
dnl libsamplerate
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.13, ac_cv_samplerate=1, ac_cv_samplerate=0)
AC_DEFINE_UNQUOTED([HAVE_SAMPLERATE],${ac_cv_samplerate},[Set to 1 if you have libsamplerate.])
AC_SUBST(SAMPLERATE_CFLAGS)
AC_SUBST(SAMPLERATE_LIBS)
dnl librubberband
PKG_CHECK_MODULES(RUBBERBAND, rubberband >= 0.0.13, ac_cv_rubberband=1, ac_cv_rubberband=0)
AC_DEFINE_UNQUOTED([HAVE_RUBBERBAND],${ac_cv_rubberband},[Set to 1 if you have librubberband.])
AC_SUBST(RUBBERBAND_CFLAGS)
AC_SUBST(RUBBERBAND_LIBS)
dnl fftw (needed by librubberband)
PKG_CHECK_MODULES(FFTW, fftw3 >= 3.0, have_fftw=yes , have_fftw=no )
AC_SUBST(FFTW_CFLAGS)
AC_SUBST(FFTW_LIBS)
dnl wxwindows
AC_ARG_WITH([gui],
[AS_HELP_STRING([--without-gui],
[disable building the GUI])],
[],
[with_gui=yes])
AC_ARG_WITH(wxconfig-path,
[ --with-wxconfig-path=PATH full path to wx-config to use])
if test "x$with_gui" != xno ; then
if test "x$with_wxconfig_path" != "x" ; then
WX_CONFIG=$with_wxconfig_path
else
WX_CONFIG=""
fi
echo WXCONFIG IS \"$WX_CONFIG\"
if [[ "$WX_CONFIG" = "" ]] ; then
AC_PATH_PROG(WX_CONFIG0, wx-config-2.6, no, $PATH:/usr/local/bin )
if [[ "$WX_CONFIG0" = "no" ]] ; then
AC_PATH_PROG(WX_CONFIG1, wxgtk2-2.5-config, no, $PATH:/usr/local/bin )
if [[ "$WX_CONFIG1" = "no" ]] ; then
AC_PATH_PROG(WX_CONFIG2, wxgtk2-2.4-config, no, $PATH:/usr/local/bin )
if [[ "$WX_CONFIG2" = "no" ]] ; then
AC_PATH_PROG(WX_CONFIG3, wxgtk-2.4-config, no, $PATH:/usr/local/bin )
if [[ "$WX_CONFIG3" = "no" ]] ; then
AC_PATH_PROG(WX_CONFIG4, wx-config, no, $PATH:/usr/local/bin )
if [[ "$WX_CONFIG4" = "no" ]] ; then
AC_MSG_ERROR("Could not find any wx-config scripts: is wxWindows installed?")
else
WX_CONFIG=$WX_CONFIG4
fi
else
WX_CONFIG=$WX_CONFIG3
fi
else
WX_CONFIG=$WX_CONFIG2
fi
else
WX_CONFIG=$WX_CONFIG1
fi
else
WX_CONFIG=$WX_CONFIG0
fi
fi
WX_LIBS="`$WX_CONFIG --libs`"
if $WX_CONFIG --cxxflags > /dev/null 2>&1 ; then
WX_CFLAGS="`$WX_CONFIG --cxxflags`"
else
WX_CFLAGS="`$WX_CONFIG --cflags`"
fi
AC_SUBST(WX_CFLAGS)
AC_SUBST(WX_LIBS)
AC_SUBST(WX_CONFIG)
SL_DIRS=". gui"
else
SL_DIRS="."
fi
AC_SUBST(SL_DIRS)
AUDIO_LIBS=
AC_CHECK_HEADER(alsa/asoundlib.h,
[use_alsa_midi=yes
AUDIO_LIBS=-lasound
AC_DEFINE([WITH_ALSA], 1, [Have ALSA Headers])],
use_alsa_midi=no)
AM_CONDITIONAL(WITH_ALSA, test x$use_alsa_midi = xyes)
AC_CHECK_FILE(/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h,
[use_coremidi=yes
AUDIO_LIBS="-framework CoreMIDI -framework CoreFoundation -framework CoreServices -framework ApplicationServices"
AC_DEFINE([WITH_COREMIDI], 1, [Have CoreMIDI Headers])],
use_coremidi=no)
AM_CONDITIONAL(WITH_COREMIDI, test x$use_coremidi = xyes)
AC_SUBST(AUDIO_LIBS)
EXTRA_LIBS="$JACK_LIBS $XML_LIBS $GTKMM_LIBS $LOSC_LIBS $SIGCPP_LIBS $AUDIO_LIBS"
AC_LANG_CPLUSPLUS
AC_ARG_ENABLE(debug,
[ --enable-debug not optimized and includes debug symbols],
[ if test "x$enable_debug" != "xno" ; then
CXXFLAGS="-g -Wall -D_REENTRANT -DDEBUG"
CFLAGS="$CXXFLAGS"
fi
],
[
CXXFLAGS="$CXXFLAGS $OPT_CXXFLAGS"
CFLAGS="$CFLAGS $OPT_CXXFLAGS"
]
)
AM_BUILD_ENVIRONMENT
AC_SUBST(BASE_LIBS)
AC_SUBST(BASE_INCLUDES)
#CFLAGS="$CFLAGS -DSAMPLE_MEMORY=200 $JACK_CFLAGS $LOSC_CFLAGS $SIGCPP_CFLAGS"
#CXXFLAGS=$CFLAGS
#LIBS="$LIBS $EXTRA_LIBS"
#CFLAGS="$CFLAGS -DSAMPLE_MEMORY=200 -I../ardour/libs/sigc++/sigc++/config -I../ardour/libs/sigc++ -I../ardour/libs/gtkmm -I../ardour/libs/gtkmm/gdk-- -I../ardour/libs/gtkmm/src $GTK_CFLAGS $JACK_CFLAGS $XML_CFLAGS"
#CXXFLAGS="$CXXFLAGS -DSAMPLE_MEMORY=200 -I../ardour/libs/sigc++/sigc++/config -I../ardour/libs/sigc++ -I../ardour/libs/gtkmm -I../ardour/libs/gtkmm/gdk-- -I../ardour/libs/gtkmm/src $GTK_CFLAGS $JACK_CFLAGS $XML_CFLAGS"
#LIBS="$LIBS -L../ardour/libs/gtkmm/gdk--/gdk-- -L../ardour/libs/sigc++/sigc++ -L../ardour/libs/gtkmm/src/gtk-- -lgtkmm -lgdkmm -lsigc $GTK_LIBS $JACK_LIBS $XML_LIBS $EXTRA_LIBS"
AC_CONFIG_SUBDIRS(libs)
AC_OUTPUT([
Makefile
src/Makefile
src/gui/Makefile
version.h
])