/[svn]/linuxsampler/trunk/configure.ac
ViewVC logotype

Annotation of /linuxsampler/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1742 - (hide annotations) (download)
Wed May 28 04:00:48 2008 UTC (15 years, 9 months ago) by schoenebeck
Original Path: linuxsampler/trunk/configure.in
File size: 50201 byte(s)
* added configure check for uuid library

1 schoenebeck 9 AC_INIT(configure.in)
2 schoenebeck 697
3     #------------------------------------------------------------------------------------
4     # LinuxSampler's / liblinuxsampler's "official" release version:
5    
6     LINUXSAMPLER_RELEASE_MAJOR=0
7 schoenebeck 1424 LINUXSAMPLER_RELEASE_MINOR=5
8 schoenebeck 1722 LINUXSAMPLER_RELEASE_BUILD=1.5cvs
9 schoenebeck 697
10     #------------------------------------------------------------------------------------
11     # The following is the libtool / shared library version. This doesn't have to
12     # do anything with the release version. It MUST conform to the following rules:
13     #
14     # 1. Start with version information of `0:0:0' for each libtool library.
15     # 2. Update the version information only immediately before a public release of
16     # your software. More frequent updates are unnecessary, and only guarantee
17     # that the current interface number gets larger faster.
18     # 3. If the library source code has changed at all since the last update, then
19     # increment revision (`c:r:a' becomes `c:r+1:a').
20     # 4. If any interfaces have been added, removed, or changed since the last update,
21     # increment current, and set revision to 0.
22     # 5. If any interfaces have been added since the last public release, then increment
23     # age.
24     # 6. If any interfaces have been removed since the last public release, then set age
25     # to 0.
26    
27 schoenebeck 1560 LIBLINUXSAMPLER_LT_CURRENT=2
28 schoenebeck 697 LIBLINUXSAMPLER_LT_REVISION=0
29 schoenebeck 1560 LIBLINUXSAMPLER_LT_AGE=1
30 schoenebeck 697 SHARED_VERSION_INFO="$LIBLINUXSAMPLER_LT_CURRENT:$LIBLINUXSAMPLER_LT_REVISION:$LIBLINUXSAMPLER_LT_AGE"
31    
32 schoenebeck 947 #------------------------------------------------------------------------------------
33     # the LSCP specification version this LinuSampler release complies with:
34    
35     LSCP_RELEASE_MAJOR=1
36 schoenebeck 1686 LSCP_RELEASE_MINOR=4
37 schoenebeck 947
38     AC_DEFINE_UNQUOTED(LSCP_RELEASE_MAJOR, ${LSCP_RELEASE_MAJOR}, [LSCP spec major version this release complies with.])
39     AC_DEFINE_UNQUOTED(LSCP_RELEASE_MINOR, ${LSCP_RELEASE_MINOR}, [LSCP spec minor version this release complies with.])
40    
41 schoenebeck 1741 AC_PROG_CXX
42 schoenebeck 697 AM_PROG_LIBTOOL
43    
44     AC_SUBST(SHLIB_VERSION_ARG)
45     AC_SUBST(SHARED_VERSION_INFO)
46    
47 schoenebeck 12 AC_C_BIGENDIAN
48 schoenebeck 9 AC_CANONICAL_SYSTEM
49    
50 schoenebeck 80 AC_SUBST(target)
51     AC_SUBST(target_alias)
52     AC_SUBST(target_cpu)
53     AC_SUBST(target_os)
54     AC_SUBST(target_vendor)
55 schoenebeck 18
56 schoenebeck 1639 PKG_PROG_PKG_CONFIG
57 schoenebeck 275
58 schoenebeck 554 ###########################################################################
59     # General Checks
60 schoenebeck 275
61 schoenebeck 510 AC_MSG_CHECKING([whether x86 architecture])
62 schoenebeck 9 def_arch_x86=0
63     case $target_cpu in
64     "i386" | "i486" | "i586" | "i686" | "i786")
65     echo "yes"
66     def_arch_x86=1;;
67     *)
68     echo "no";;
69     esac
70     AC_DEFINE_UNQUOTED(ARCH_X86,$def_arch_x86,[Define to 1 if you build for x86 architecture.])
71    
72 schoenebeck 510 # determine the right gcc switch for CPU specific optimizations
73 schoenebeck 829 # (only if the user did not provide one)
74 schoenebeck 510 CXX_CPU_SWITCH=
75 schoenebeck 829 if ! echo "X $CXXFLAGS " | grep -q -- " \(-march=\|-mcpu=\|-mtune=\|-arch=\)" ; then
76     if test "$def_arch_x86" = 1; then
77     CXX_CPU_SWITCH="-march=$target_cpu"
78 schoenebeck 909 elif test "$target_cpu" = "ppc"; then
79 schoenebeck 829 CXX_CPU_SWITCH="-arch=$target_cpu"
80     fi
81 schoenebeck 510 fi
82     AC_SUBST([CXX_CPU_SWITCH])
83    
84 senoner 1502 # check if we're on MS Windows
85     AC_CHECK_HEADERS(
86     mmsystem.h,
87     have_windows=1,
88     have_windows=0
89     )
90     AM_CONDITIONAL(HAVE_WINDOWS, test $have_windows = "1")
91    
92 schoenebeck 288 AC_MSG_CHECKING([whether UNIX98 compatible])
93     AC_LANG_SAVE
94     AC_LANG_C
95     AC_TRY_RUN([
96     #ifndef _GNU_SOURCE
97     #define _GNU_SOURCE 1
98     #endif
99     #include <features.h>
100     void main(void) {
101     #if _XOPEN_SOURCE >= 500
102     exit(0); /* UNIX98 compatible */
103     #else
104     exit(-1); /* not UNIX98 compatible */
105     #endif
106     }
107     ],
108     have_unix98="yes",
109     have_unix98="no",
110     have_unix98="no"
111     )
112     AC_LANG_RESTORE
113     AC_MSG_RESULT([$have_unix98])
114 senoner 1502 if test "$have_unix98" = "no" -a "have_windows" = "0"; then
115 schoenebeck 288 if test "x$HAVE_UNIX98" = "x"; then
116     echo "LinuxSampler only runs on UNIX98 compatible systems, which is mandatory for"
117     echo "pthread_mutexattr_settype() call in Mutex.cpp. You may want to run
118     echo "./configure with environment variable HAVE_UNIX98=1 in case you think you
119     echo "have a UNIX98 compatible system."
120     exit -1;
121     fi
122     fi
123    
124 wylder 822 # check for <features.h>
125     AC_CHECK_HEADERS(features.h)
126 wylder 821
127 schoenebeck 1454 # test for POSIX thread library
128     m4_ifdef([m4_include(m4/pthread.m4)],,
129     [sinclude([m4/pthread.m4])])
130     ACX_PTHREAD
131     LIBS="$PTHREAD_LIBS $LIBS"
132     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
133     CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
134     CC="$PTHREAD_CC"
135 schoenebeck 852
136 schoenebeck 1454 # check for a bug in NPTL-enabled glibc
137     # (see Gentoo bug report #194076)
138     AC_ARG_ENABLE(nptl-bug-check,
139     [ --disable-nptl-bug-check
140     Disable check for a bug in certain NPTL-enabled
141     glibc versions that caused crashs.],
142     [config_check_nptl_bug="$enableval"],
143     [config_check_nptl_bug="yes"]
144     )
145     if test "$config_check_nptl_bug" = "yes"; then
146     m4_ifdef([m4_include(m4/nptl_bug.m4)],,
147     [sinclude([m4/nptl_bug.m4])])
148     ACX_NPTL_GLIBC_BUG([
149     echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
150     echo "You seem to have a buggy PTHREAD library! LinuxSampler would"
151     echo "probably crash due to this. Please report us the system you are"
152     echo "using and/or file a bug report to the bug tracking system of"
153     echo "your distribution."
154     echo "If you have a NPTL-enabled glibc AND it was compiled for TLS as"
155     echo "well, you can try to circumvent this problem for now by setting"
156     echo "the environment variable LD_ASSUME_KERNEL=\"2.4.1\" , which"
157     echo "should cause this test to pass."
158     echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
159     AC_MSG_ERROR([possibly NPTL glibc bug detected])
160     ])
161     else
162     echo "NPTL glibc bug check disabled"
163     fi
164    
165 schoenebeck 1742 # FIXME: this is actually a dependency of libgig, not of LS directly, why
166     # isn't it hidden by libgig?
167     AC_CHECK_HEADERS(uuid/uuid.h)
168     AC_SEARCH_LIBS(uuid_generate, uuid)
169 schoenebeck 1454
170    
171 schoenebeck 1742
172 schoenebeck 852 ###########################################################################
173 schoenebeck 288 # Checks for available audio and MIDI systems / drivers
174     # (we throw an error if there's not at least one system for audio output and MIDI input available)
175 schoenebeck 852
176 schoenebeck 288 have_midi_input_driver="false"
177     have_audio_output_driver="false"
178    
179 schoenebeck 852 # ALSA
180     AC_ARG_ENABLE(alsa-driver,
181     [ --disable-alsa-driver
182     Disable support for the Advanced Linux Sound
183     Architecture (ALSA).],
184 schoenebeck 1360 [config_alsa_driver="$enableval"],
185 schoenebeck 852 [config_alsa_driver="yes"]
186 schoenebeck 18 )
187 schoenebeck 852 have_alsa=0
188     if test "$config_alsa_driver" = "yes"; then
189     AC_CHECK_HEADER(alsa/asoundlib.h,
190     AC_CHECK_LIB(asound, main,
191     have_alsa=1
192     ,
193     have_alsa=0
194     )
195     ,
196     have_alsa=0
197     )
198     if test "$have_alsa" = "1"; then
199     have_midi_input_driver="true"
200     have_audio_output_driver="true";
201     fi
202    
203     echo -n "checking Alsa version... "
204     AC_LANG_SAVE
205     AC_LANG_C
206     AC_TRY_RUN([
207     #include <alsa/asoundlib.h>
208     void main(void) {
209     /* ensure backward compatibility */
210     #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
211     #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
212     #endif
213     exit(SND_LIB_MAJOR);
214     }
215     ],
216     alsa_major=0,
217     alsa_major=$?,
218     alsa_major=0
219     )
220     AC_TRY_RUN([
221     #include <alsa/asoundlib.h>
222     void main(void) {
223     /* ensure backward compatibility */
224     #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
225     #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
226     #endif
227     exit(SND_LIB_MINOR);
228     }
229     ],
230     alsa_minor=0,
231     alsa_minor=$?,
232     alsa_minor=0
233     )
234     AC_TRY_RUN([
235     #include <alsa/asoundlib.h>
236     void main(void) {
237     /* ensure backward compatibility */
238     #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
239     #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
240     #endif
241     exit(SND_LIB_SUBMINOR);
242     }
243     ],
244     alsa_subminor=0,
245     alsa_subminor=$?,
246     alsa_subminor=0
247     )
248     AC_LANG_RESTORE
249     echo "$alsa_major.$alsa_minor.$alsa_subminor";
250     AC_DEFINE_UNQUOTED(ALSA_MAJOR,$alsa_major,[Define to the major version number of your Alsa installation.])
251     AC_DEFINE_UNQUOTED(ALSA_MINOR,$alsa_minor,[Define to the minor version number of your Alsa installation.])
252     AC_DEFINE_UNQUOTED(ALSA_SUBMINOR,$alsa_subminor,[Define to the subminor version number of your Alsa installation.])
253     else
254     echo "ALSA support disabled by configure script parameter"
255 schoenebeck 18 fi
256 schoenebeck 291 AM_CONDITIONAL(HAVE_ALSA, test $have_alsa = "1")
257 schoenebeck 288 AC_DEFINE_UNQUOTED(HAVE_ALSA,$have_alsa,[Define to 1 if you have ALSA installed.])
258 schoenebeck 18
259 schoenebeck 852 # JACK
260     AC_ARG_ENABLE(jack-driver,
261     [ --disable-jack-driver
262     Disable support for the Jack Audio Connection Kit
263     (JACK).],
264 schoenebeck 1360 [config_jack_driver="$enableval"],
265 schoenebeck 852 [config_jack_driver="yes"]
266 schoenebeck 18 )
267 schoenebeck 852 have_jack=0
268     if test "$config_jack_driver" = "yes"; then
269     PKG_CHECK_MODULES(JACK, jack, have_jack=1, have_jack=0)
270     if test $have_jack = "1"; then
271     AC_SUBST(JACK_LIBS)
272     AC_SUBST(JACK_CFLAGS)
273     AC_CHECK_LIB(jack, jack_client_name_size, [AC_DEFINE(HAVE_JACK_CLIENT_NAME_SIZE, 1, [Define to 1 if you have the `jack_client_name_size' function.])], , $JACK_LIBS)
274     have_audio_output_driver="true";
275     fi
276 schoenebeck 33 else
277 schoenebeck 852 echo "JACK support disabled by configure script parameter"
278 schoenebeck 33 fi
279 schoenebeck 852 AM_CONDITIONAL(HAVE_JACK, test $have_jack = "1")
280     AC_DEFINE_UNQUOTED(HAVE_JACK,$have_jack,[Define to 1 if you have JACK installed.])
281 schoenebeck 31
282 persson 1651 # JACK MIDI
283     have_jack_midi=0
284     if test $have_jack = "1"; then
285 persson 1652 linuxsampler_save_CFLAGS=$CFLAGS
286     linuxsampler_save_LIBS=$LIBS
287     CFLAGS="$JACK_CFLAGS $CFLAGS"
288     LIBS="$JACK_LIBS $LIBS"
289     AC_CHECK_HEADER(jack/midiport.h, have_jack_midi=1, have_jack_midi=0)
290     if test $have_jack_midi = "1"; then
291     AC_CHECK_FUNCS(jack_midi_get_event_count)
292     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <jack/midiport.h>]], [[
293     jack_midi_clear_buffer(0, 0);
294     ]])], [AC_DEFINE(JACK_MIDI_FUNCS_NEED_NFRAMES, 1,
295     [Define to 1 if you have the old jack midi functions that need an nframes argument.])])
296     have_midi_input_driver="true"
297     fi
298     CFLAGS=$linuxsampler_save_CFLAGS
299     LIBS=$linuxsampler_save_LIBS
300 persson 1651 fi
301     AM_CONDITIONAL(HAVE_JACK_MIDI, test $have_jack_midi = "1")
302     AC_DEFINE_UNQUOTED(HAVE_JACK_MIDI, $have_jack_midi,
303     [Define to 1 if you have JACK with MIDI support installed.])
304    
305 schoenebeck 838 # ARTS
306 schoenebeck 852 AC_ARG_ENABLE(arts-driver,
307     [ --disable-arts-driver
308     Disable support for the Analogue Realtime System
309     (aRts).],
310 schoenebeck 1360 [config_arts_driver="$enableval"],
311 schoenebeck 852 [config_arts_driver="yes"]
312     )
313     have_arts=0
314     if test "$config_arts_driver" = "yes"; then
315     m4_ifdef([m4_include(m4/arts.m4)],,
316     [sinclude([m4/arts.m4])])
317     AM_PATH_ARTS(0.9.5, have_arts=1, have_arts=0)
318     if test "$have_arts" = "1"; then
319     have_audio_output_driver="true"
320     fi
321     else
322     echo "ARTS support disabled by configure script parameter"
323 schoenebeck 838 fi
324     AM_CONDITIONAL(HAVE_ARTS, test "$have_arts" = "1")
325     AC_DEFINE_UNQUOTED(HAVE_ARTS,$have_arts,[Define to 1 if you have aRts installed.])
326    
327 senoner 1502 # ASIO AUDIO (Win32)
328     AC_ARG_ENABLE(asiosdk-dir,
329     [ --enable-asiosdk-dir
330     Directory where the ASIO SDK is located, this automatically
331     enables the compilation of the ASIO audio output driver.],
332     [config_asiosdk_dir="${enableval}"],
333     [config_asiosdk_dir="."]
334     )
335     AC_SUBST(config_asiosdk_dir)
336    
337     AC_ARG_ENABLE(asio-driver,
338     [ --disable-asio-driver
339     Disable support for the Windows ASIO driver.],
340     [config_asio_driver="$enableval"],
341     [config_asio_driver="yes"]
342     )
343     have_asio=0
344     ASIOSDK_BASEDIR=
345     if test "$config_asio_driver" = "yes"; then
346     asiosdk_headerfile=$config_asiosdk_dir/ASIOSDK2/common/asio.h
347     echo -n "checking for ASIO headerfile: $asiosdk_headerfile ...."
348     if test -e $asiosdk_headerfile ; then
349     echo yes
350     have_asio=1
351     ASIOSDK_BASEDIR="$config_asiosdk_dir"
352     else
353     echo no
354     have_asio=0
355     fi
356     if test "$have_asio" = "1"; then
357     have_audio_output_driver="true"
358     fi
359     else
360     echo "Windows ASIO support disabled by configure script parameter"
361     fi
362     AC_SUBST(ASIOSDK_BASEDIR)
363     AM_CONDITIONAL(HAVE_ASIO, test $have_asio = "1")
364     AC_DEFINE_UNQUOTED(HAVE_ASIO,$have_asio,[Define to 1 if you have ASIO installed.])
365    
366 schoenebeck 609 # MidiShare (Linux, OS X, Windows)
367 schoenebeck 852 AC_ARG_ENABLE(midishare-driver,
368     [ --disable-midishare-driver
369     Disable support for the MidiShare system.],
370 schoenebeck 1360 [config_midishare_driver="$enableval"],
371 schoenebeck 852 [config_midishare_driver="yes"]
372 schoenebeck 609 )
373 schoenebeck 852 have_midishare=0
374     if test "$config_midishare_driver" = "yes"; then
375     AC_CHECK_HEADER(MidiShare.h,
376     AC_CHECK_LIB(MidiShare, MidiCountEvs,
377     have_midishare=1,
378     have_midishare=0
379     )
380     ,
381     have_midishare=0
382     )
383     if test "$have_midishare" = "1"; then
384     have_midi_input_driver="true"
385     fi
386     else
387     echo "MidiShare support disabled by configure script parameter"
388 schoenebeck 609 fi
389     AM_CONDITIONAL(HAVE_MIDISHARE, test $have_midishare = "1")
390     AC_DEFINE_UNQUOTED(HAVE_MIDISHARE,$have_midishare,[Define to 1 if you have MidiShare installed.])
391    
392     # CoreMIDI (OS X)
393 schoenebeck 852 AC_ARG_ENABLE(coremidi-driver,
394     [ --disable-coremidi-driver
395     Disable support for the Apple CoreMIDI system.],
396 schoenebeck 1360 [config_coremidi_driver="$enableval"],
397 schoenebeck 852 [config_coremidi_driver="yes"]
398 schoenebeck 609 )
399 schoenebeck 852 have_coremidi=0
400     if test "$config_coremidi_driver" = "yes"; then
401     AC_CHECK_HEADER(CoreMIDI/CoreMIDI.h,
402     have_coremidi=1,
403     have_coremidi=0
404     )
405     if test "$have_coremidi" = "1"; then
406     have_midi_input_driver="true"
407     fi
408     else
409     echo "CoreMIDI support disabled by configure script parameter"
410 schoenebeck 609 fi
411     AM_CONDITIONAL(HAVE_COREMIDI, test $have_coremidi = "1")
412     AC_DEFINE_UNQUOTED(HAVE_COREMIDI,$have_coremidi,[Define to 1 if you have CoreMIDI installed.])
413    
414 senoner 1502 # MME MIDI (Win32)
415     AC_ARG_ENABLE(mmemidi-driver,
416     [ --disable-mmemidi-driver
417     Disable support for the Windows MME MIDI system.],
418     [config_mmemidi_driver="$enableval"],
419     [config_mmemidi_driver="yes"]
420     )
421     have_mmemidi=0
422     if test "$config_mmemidi_driver" = "yes"; then
423     AC_CHECK_HEADERS(mmsystem.h,
424     have_mmemidi=1,
425     have_mmemidi=0
426     )
427     if test "$have_mmemidi" = "1"; then
428     have_midi_input_driver="true"
429     fi
430     else
431     echo "MME MIDI support disabled by configure script parameter"
432     fi
433     AM_CONDITIONAL(HAVE_MME_MIDI, test $have_mmemidi = "1")
434     AC_DEFINE_UNQUOTED(HAVE_MME_MIDI,$have_mmemidi,[Define to 1 if you have MME MIDI installed.])
435    
436 schoenebeck 1364 # have we found at least one MIDI input and one audio output driver ?
437     if test "$have_midi_input_driver" = "false"; then
438     echo "No supported MIDI input system found!"
439     echo "Sorry, LinuxSampler only supports the following MIDI drivers at the moment:"
440 persson 1652 echo "ALSA, JACK, MIDIShare, CoreMIDI, MME."
441 schoenebeck 1364 echo "If you think you have one of those available on your system, make sure you"
442     echo "also have the respective development (header) files installed."
443     exit -1;
444     fi
445     if test "$have_audio_output_driver" = "false"; then
446     echo "No supported audio output system found!"
447 persson 1652 echo "Sorry, LinuxSampler only supports ALSA, JACK, ARTS and ASIO as audio output"
448 schoenebeck 1364 echo "driver at the moment!"
449     exit -1;
450     fi
451    
452    
453    
454     ###########################################################################
455     # Checks for various DLL libraries
456    
457 schoenebeck 504 # Check presence of libgig
458 schoenebeck 1560 libgig_version="3.2.1"
459 schoenebeck 504 PKG_CHECK_MODULES(GIG, gig >= $libgig_version, HAVE_GIG=true, HAVE_GIG=false)
460     if test "$HAVE_GIG" = "false"; then
461     echo "Required libgig version not found!"
462     echo "You need to have libgig version ${libgig_version} installed!"
463     exit -1;
464 schoenebeck 714 else
465     echo "yes, found libgig $libgig_version"
466 schoenebeck 504 fi
467     AC_SUBST(GIG_CFLAGS)
468     AC_SUBST(GIG_LIBS)
469    
470 schoenebeck 1364 # Instruments DB feature (requires SQLite 3.3)
471     AC_ARG_ENABLE(instruments-db,
472     [ --disable-instruments-db
473     Disable compilation of the sampler's instruments
474     database feature. You need to have SQLite 3.3
475     or younger installed for this feature.],
476     [config_instruments_db="$enableval"],
477     [config_instruments_db="yes"]
478     )
479     HAVE_SQLITE3=0;
480     if test "$config_instruments_db" = "yes"; then
481     # Check presence of sqlite3
482     sqlite_version="3.3"
483     PKG_CHECK_MODULES(SQLITE3, sqlite3 >= $sqlite_version, HAVE_SQLITE3=true, HAVE_SQLITE3=false)
484     AC_SUBST(SQLITE3_LIBS)
485     AC_SUBST(SQLITE3_CFLAGS)
486     if test $HAVE_SQLITE3 = false; then
487     HAVE_SQLITE3=0
488     config_instruments_db="no"
489     echo "*** Required sqlite version not found!"
490     echo "*** You need to have sqlite version ${sqlite_version} or higher"
491     echo "*** for instruments database support to be enabled."
492     echo "*** Support for instruments DB will be disabled!"
493     else
494     HAVE_SQLITE3=1
495     fi
496 senkov 397 else
497 schoenebeck 1364 echo "Instruments DB feature disabled by configure script parameter"
498 senkov 397 fi
499     AM_CONDITIONAL(HAVE_SQLITE3, test $HAVE_SQLITE3 = 1)
500 schoenebeck 1364 AC_DEFINE_UNQUOTED(HAVE_SQLITE3,$HAVE_SQLITE3,[Define to 1 if you want the instruments DB feature and have SQLITE3 installed.])
501 schoenebeck 31
502 schoenebeck 288
503    
504 schoenebeck 554 ###########################################################################
505     # Handle Configuration Options
506    
507     # TODO: should we use AC_ARG_VAR(variable, description) instead?
508    
509 schoenebeck 617 AC_ARG_ENABLE(asm,
510 schoenebeck 1259 [ --disable-asm
511 schoenebeck 738 Enable hand-crafted assembly optimizations
512 schoenebeck 1259 (default=on). LinuxSampler provides CPU specific
513     assembly optimizations. This is currently limited
514     to just enter a fast (denormal) FPU mode on x86
515     platforms. There are currently no synthesis core
516     assembly optimizations anymore since LS 0.4.0],
517 schoenebeck 1360 [config_asm="$enableval"],
518 schoenebeck 1259 [config_asm="yes"]
519 schoenebeck 617 )
520     if test "$config_asm" = "yes"; then
521 schoenebeck 1259 AC_DEFINE_UNQUOTED(CONFIG_ASM, 1, [Define to 1 if you want to enable asm optimizations.])
522 schoenebeck 617 fi
523    
524 schoenebeck 554 AC_ARG_ENABLE(dev-mode,
525 schoenebeck 1424 [ --enable-dev-mode
526     Enable development mode (default=off). In that mode
527 schoenebeck 554 we do some extra sanity checks here and there.
528     This helps to spot possible problems, but reduces
529     efficiency a bit],
530 schoenebeck 1360 [config_dev_mode="$enableval"],
531 schoenebeck 1424 [config_dev_mode="no"]
532 schoenebeck 554 )
533     if test "$config_dev_mode" = "yes"; then
534     AC_DEFINE_UNQUOTED(CONFIG_DEVMODE, 1, [Define to 1 if you want to enable development mode.])
535     fi
536    
537     AC_ARG_ENABLE(debug-level,
538     [ --enable-debug-level
539     Specify verbosity of console messages (default=1).
540     The higher the value, the higher will be verbosity.
541     A value of 0 means no console output at all.
542     There's not really an upper limit but the usual
543     level of all messages is currently somewhere less
544     than 10.],
545     [config_debug_level="${enableval}"],
546     [config_debug_level="1"]
547     )
548     AC_DEFINE_UNQUOTED(CONFIG_DEBUG_LEVEL, $config_debug_level, [Define console verbosity.])
549    
550     AC_ARG_ENABLE(rt-exceptions,
551     [ --enable-rt-exceptions
552     Enable exceptions in the realtime thread
553     (default=no). If this is enabled, exceptions will
554     be thrown on critical errors in the realtime
555     context as well. Otherwise if disabled
556     segmentation faults will be forced by the
557     application on critical errors.],
558 schoenebeck 1360 [config_rt_exceptions="$enableval"],
559 schoenebeck 554 [config_rt_exceptions="no"]
560     )
561     if test "$config_rt_exceptions" = "yes"; then
562     AC_DEFINE_UNQUOTED(CONFIG_RT_EXCEPTIONS, 1, [Define to 1 to allow exceptions in the realtime context.])
563     fi
564    
565 nagata 1649 AC_ARG_ENABLE(pthread-testcancel,
566     [ --enable-pthread-testcancel
567 schoenebeck 1742 Enable pthread_testcancel() calls and avoid asynchronous
568 nagata 1649 cancel of pthreads (default=no).],
569     [config_pthread_testcancel="$enableval"],
570     [config_pthread_testcancel="no"]
571     )
572     if test "$config_pthread_testcancel" = "yes"; then
573     AC_DEFINE_UNQUOTED(CONFIG_PTHREAD_TESTCANCEL, 1, [Define to 1 to enable pthread_testcancel() calls.])
574     fi
575    
576 schoenebeck 554 AC_ARG_ENABLE(preload-samples,
577     [ --enable-preload-samples
578     Due to seeking and latency issues with hard drives
579     we have to cache a small part of samples' head in
580     RAM (default=32768). The higher this value the
581     more memory will be occupied for each sample, but
582     the safer this will be in regards of possible
583     droputs. A 'good' value depends on the running
584     system and usage dependant factors.],
585     [config_preload_samples="${enableval}"],
586     [config_preload_samples="32768"]
587     )
588     AC_DEFINE_UNQUOTED(CONFIG_PRELOAD_SAMPLES, $config_preload_samples, [Define amount of sample points to be cached in RAM.])
589    
590     AC_ARG_ENABLE(max-pitch,
591     [ --enable-max-pitch
592     Specify the maximum allowed pitch value in octaves
593     (default=4). To lower memory usage you might want
594     set a smaller value.],
595     [config_max_pitch="${enableval}"],
596     [config_max_pitch="4"]
597     )
598     AC_DEFINE_UNQUOTED(CONFIG_MAX_PITCH, $config_max_pitch, [Define max. allowed pitch.])
599    
600     AC_ARG_ENABLE(max-events,
601     [ --enable-max-events
602     Specify the maximum allowed amount of events to be
603     processed per fragment (default=1024).],
604     [config_max_events="${enableval}"],
605     [config_max_events="1024"]
606     )
607     AC_DEFINE_UNQUOTED(CONFIG_MAX_EVENTS_PER_FRAGMENT, $config_max_events, [Define max. allowed events per fragment.])
608    
609     AC_ARG_ENABLE(eg-bottom,
610     [ --enable-eg-bottom
611     Bottom limit of envelope generators
612     (default=0.001). Certain kinds of curve types like
613     exponential curves converge against 0 but never
614     reach 0. So we have to define a certain low value
615     after which we should consider all smaller values
616     to be 'almost zero'. The smaller this value, the
617     longer will voices survive in EG's release stage
618     and thus waste voices. If this value is too high
619     will cause click sounds though.],
620     [config_eg_bottom="${enableval}"],
621     [config_eg_bottom="0.001"]
622     )
623     AC_DEFINE_UNQUOTED(CONFIG_EG_BOTTOM, $config_eg_bottom, [Define bottom limit of envelopes.])
624    
625     AC_ARG_ENABLE(eg-min-release-time,
626     [ --enable-eg-min-release-time
627     Specify the lowest allowed release time in seconds
628     (default=0.0025). This value will also be used to
629     ramp down voices on voice stealing. This value
630     should always be less than the period time of the
631     used audio driver, as in case of voice stealing
632     the killed voice needs to be completely ramped
633     down in the same fragment.],
634     [config_eg_min_release_time="${enableval}"],
635     [config_eg_min_release_time="0.0025"]
636     )
637     AC_DEFINE_UNQUOTED(CONFIG_EG_MIN_RELEASE_TIME, $config_eg_min_release_time, [Define min. release time.])
638    
639     AC_ARG_ENABLE(refill-streams,
640     [ --enable-refill-streams
641     Number of streams that should be refilled in each
642     disk thread cycle (default=4).],
643     [config_refill_streams="${enableval}"],
644     [config_refill_streams="4"]
645     )
646     AC_DEFINE_UNQUOTED(CONFIG_REFILL_STREAMS_PER_RUN, $config_refill_streams, [Define amount of streams to be refilled per cycle.])
647    
648     AC_ARG_ENABLE(stream-min-refill,
649     [ --enable-stream-min-refill
650     Minimum refill size for disk streams (default=1024).
651     The disk thread will go to sleep for a while if no
652     stream had to be refilled more than this value in
653     a disk thread cycle.],
654     [config_stream_min_refill="${enableval}"],
655     [config_stream_min_refill="1024"]
656     )
657     AC_DEFINE_UNQUOTED(CONFIG_STREAM_MIN_REFILL_SIZE, $config_stream_min_refill, [Define min. stream refill size.])
658    
659     AC_ARG_ENABLE(stream-max-refill,
660     [ --enable-stream-max-refill
661     Maximum refill size for disk streams
662     (default=65536). The disk thread will refill
663     each stream only by a size of this value per
664     disk thread cycle.],
665     [config_stream_max_refill="${enableval}"],
666     [config_stream_max_refill="65536"]
667     )
668     AC_DEFINE_UNQUOTED(CONFIG_STREAM_MAX_REFILL_SIZE, $config_stream_max_refill, [Define max. stream refill size.])
669    
670     AC_ARG_ENABLE(stream-size,
671     [ --enable-stream-size
672     Size of each stream's ring buffer in sample points
673     (default=262144).],
674     [config_stream_size="${enableval}"],
675     [config_stream_size="262144"]
676     )
677     AC_DEFINE_UNQUOTED(CONFIG_STREAM_BUFFER_SIZE, $config_stream_size, [Define each stream's ring buffer size.])
678    
679     AC_ARG_ENABLE(max-streams,
680     [ --enable-max-streams
681     Maximum amount of disk streams (default=90). This
682     value should always be higher than the maximum
683     amount of voices.],
684     [config_max_streams="${enableval}"],
685     [config_max_streams="90"]
686     )
687     AC_DEFINE_UNQUOTED(CONFIG_MAX_STREAMS, $config_max_streams, [Define max. streams.])
688    
689     AC_ARG_ENABLE(max-voices,
690     [ --enable-max-voices
691     Maximum amount of voices (default=64). This value
692     should always be lower than the maximum amount of
693     disk streams.],
694     [config_max_voices="${enableval}"],
695     [config_max_voices="64"]
696     )
697     AC_DEFINE_UNQUOTED(CONFIG_MAX_VOICES, $config_max_voices, [Define max. voices.])
698    
699 schoenebeck 738 AC_ARG_ENABLE(subfragment-size,
700     [ --enable-subfragment-size
701     Every audio fragment will be splitted into
702     subfragments. Where each subfragment renders
703     audio with constant synthesis parameters. This is
704     done for efficiency reasons. This parameter
705     defines the default size of a subfragment in
706     sample points. A large value means less CPU time
707     whereas a low value means better audio quality
708     (default=32).],
709     [config_subfragment_size="${enableval}"],
710     [config_subfragment_size="32"]
711     )
712     AC_DEFINE_UNQUOTED(CONFIG_DEFAULT_SUBFRAGMENT_SIZE, $config_subfragment_size, [Define default subfragment size (in sample points).])
713    
714 schoenebeck 1005 AC_ARG_ENABLE(global-attenuation-default,
715     [ --enable-global-attenuation-default
716 schoenebeck 781 To prevent clipping all samples will be lowered
717 schoenebeck 1005 in amplitude by this given default factor (can
718     be overridden at runtime).
719 schoenebeck 781 (default=0.35)],
720 schoenebeck 1005 [config_global_attenuation_default="${enableval}"],
721     [config_global_attenuation_default="0.35"]
722 schoenebeck 781 )
723 schoenebeck 1005 AC_DEFINE_UNQUOTED(CONFIG_GLOBAL_ATTENUATION_DEFAULT, $config_global_attenuation_default, [Define default global volume attenuation (as floating point factor).])
724 schoenebeck 781
725 schoenebeck 554 AC_ARG_ENABLE(voice-steal-algo,
726     [ --enable-voice-steal-algo
727     Voice stealing algorithm to be used. Currently
728     available options:
729     none:
730     Disable voice stealing completely.
731 schoenebeck 563 oldestvoiceonkey (default):
732 schoenebeck 554 Try to kill a voice on the same key first,
733     if no success, proceed with the oldest key.
734 schoenebeck 563 oldestkey:
735 schoenebeck 554 Try to kill a voice from the oldest active
736     key.],
737     [ if test ! "(" "${enableval}" = "none" \
738     -o "${enableval}" = "oldestvoiceonkey" \
739     -o "${enableval}" = "oldestkey" ")" ; then
740     AC_MSG_ERROR([Unknown voice stealing algorithm for parameter --enable-voice-steal-algo])
741     else
742     config_voice_steal_algo="${enableval}"
743 schoenebeck 579 fi
744 schoenebeck 554 ],
745 schoenebeck 563 [config_voice_steal_algo="oldestvoiceonkey"]
746 schoenebeck 554 )
747     AC_DEFINE_UNQUOTED(CONFIG_VOICE_STEAL_ALGO, voice_steal_algo_${config_voice_steal_algo}, [Define voice stealing algorithm to be used.])
748    
749     AC_ARG_ENABLE(sysex-buffer-size,
750     [ --enable-sysex-buffer-size
751     System Exclusive Message buffer size in kB
752     (default=2048).],
753     [config_sysex_buffer_size="${enableval}"],
754     [config_sysex_buffer_size="2048"]
755     )
756     AC_DEFINE_UNQUOTED(CONFIG_SYSEX_BUFFER_SIZE, $config_sysex_buffer_size, [Define SysEx buffer size.])
757    
758     AC_ARG_ENABLE(force-filter,
759     [ --enable-force-filter
760     If enabled will force filter to be used even if
761     no usage was define in instrument patch files.
762     (default=no).],
763 schoenebeck 1360 [config_force_filter="$enableval"],
764 schoenebeck 554 [config_force_filter="no"]
765     )
766     if test "$config_force_filter" = "yes"; then
767     AC_DEFINE_UNQUOTED(CONFIG_FORCE_FILTER, 1, [Define to 1 to force filter usage.])
768     fi
769    
770     AC_ARG_ENABLE(filter-cutoff-min,
771     [ --enable-filter-cutoff-min
772     Minimum filter cutoff frequency in Hz
773     (default=100.0).],
774     [config_filter_cutoff_min="${enableval}"],
775     [config_filter_cutoff_min="100.0"]
776     )
777     AC_DEFINE_UNQUOTED(CONFIG_FILTER_CUTOFF_MIN, ${config_filter_cutoff_min}f, [Define min. filter cutoff frequency.])
778    
779     AC_ARG_ENABLE(filter-cutoff-max,
780     [ --enable-filter-cutoff-max
781     Maximum filter cutoff frequency in Hz
782     (default=10000.0).],
783     [config_filter_cutoff_max="${enableval}"],
784     [config_filter_cutoff_max="10000.0"]
785     )
786     AC_DEFINE_UNQUOTED(CONFIG_FILTER_CUTOFF_MAX, ${config_filter_cutoff_max}f, [Define max. filter cutoff frequency.])
787    
788     AC_ARG_ENABLE(override-cutoff-ctrl,
789     [ --enable-override-cutoff-ctrl
790     Override filter cutoff MIDI controller (default=no).
791     Note: you have to define the MIDI controller number
792     here, it's not a boolean parameter type! If this
793     option is used, controller number given by
794     instrument patch will be ignored and instead this
795     supplied value will be used.],
796     [config_override_cutoff_ctrl="${enableval}"],
797     [config_override_cutoff_ctrl="no"]
798     )
799     if test ! "$config_override_cutoff_ctrl" = "no"; then
800     AC_DEFINE_UNQUOTED(CONFIG_OVERRIDE_CUTOFF_CTRL, $config_override_cutoff_ctrl, [Define to a MIDI controller number to override cutoff control.])
801     fi
802    
803     AC_ARG_ENABLE(override-resonance-ctrl,
804     [ --enable-override-resonance-ctrl
805     Override filter resonance MIDI controller
806     (default=no). Note: you have to define the MIDI
807     controller number here, it's not a boolean
808     parameter type! If this option is used, controller
809     number given by instrument patch will be ignored
810     and instead this supplied value will be used.],
811     [config_override_resonance_ctrl="${enableval}"],
812     [config_override_resonance_ctrl="no"]
813     )
814     if test ! "$config_override_resonance_ctrl" = "no"; then
815     AC_DEFINE_UNQUOTED(CONFIG_OVERRIDE_RESONANCE_CTRL, $config_override_resonance_ctrl, [Define to a MIDI controller number to override resonance control.])
816     fi
817    
818     AC_ARG_ENABLE(override-filter-type,
819     [ --enable-override-filter-type
820     Override filter type (default=no). Options:
821     hp: for highpass
822     bp: for bandpass
823     br: for bandreject
824     lp: for lowpass
825     lpt: for lowpass turbo],
826     [ if test "${enableval}" = "hp" ; then
827     config_override_filter_type="::gig::vcf_type_highpass"
828     elif test "${enableval}" = "bp" ; then
829     config_override_filter_type="::gig::vcf_type_bandpass"
830     elif test "${enableval}" = "br" ; then
831     config_override_filter_type="::gig::vcf_type_bandreject"
832     elif test "${enableval}" = "lp" ; then
833     config_override_filter_type="::gig::vcf_type_lowpass"
834     elif test "${enableval}" = "lpt" ; then
835     config_override_filter_type="::gig::vcf_type_lowpassturbo"
836     elif test ! "${enableval}" = "no"; then
837     AC_MSG_ERROR([Unknown filter type for parameter --enable-override-filter-type])
838 schoenebeck 579 fi
839 schoenebeck 554 ],
840     [config_override_filter_type="no"]
841     )
842     if test ! "$config_override_filter_type" = "no"; then
843     AC_DEFINE_UNQUOTED(CONFIG_OVERRIDE_FILTER_TYPE, $config_override_filter_type, [Define to a filter type to always force that filter type.])
844     fi
845    
846 schoenebeck 563 AC_ARG_ENABLE(gs-checksum,
847     [ --enable-gs-checksum
848     Enable Roland General Synth SysEx checksum check
849     (default=no). If this is enabled, all GS SysEx
850     messages which do not provide a correct checksum
851     will be ignored. This is disabled by default as
852     not all devices honor GS checksums.],
853 schoenebeck 1360 [config_assert_gs_sysex_checksum="$enableval"],
854 schoenebeck 563 [config_assert_gs_sysex_checksum="no"]
855     )
856     if test "config_assert_gs_sysex_checksum" = "yes"; then
857     AC_DEFINE_UNQUOTED(CONFIG_ASSERT_GS_SYSEX_CHECKSUM, 1, [Define to 1 if you want to enable GS SysEx check.])
858     fi
859    
860 schoenebeck 829 AC_ARG_ENABLE(portamento-time-min,
861     [ --enable-portamento-time-min
862     Minimum Portamento time in seconds
863     (default=0.1).],
864     [config_portamento_time_min="${enableval}"],
865     [config_portamento_time_min="0.1"]
866     )
867     AC_DEFINE_UNQUOTED(CONFIG_PORTAMENTO_TIME_MIN, $config_portamento_time_min, [Define min. portamento time.])
868    
869     AC_ARG_ENABLE(portamento-time-max,
870     [ --enable-portamento-time-max
871     Maximum Portamento time in seconds
872     (default=32).],
873     [config_portamento_time_max="${enableval}"],
874     [config_portamento_time_max="32"]
875     )
876     AC_DEFINE_UNQUOTED(CONFIG_PORTAMENTO_TIME_MAX, $config_portamento_time_max, [Define max. portamento time.])
877    
878     AC_ARG_ENABLE(portamento-time-default,
879     [ --enable-portamento-time-default
880     Default Portamento time in seconds
881     (default=1).],
882     [config_portamento_time_default="${enableval}"],
883     [config_portamento_time_default="1"]
884     )
885     AC_DEFINE_UNQUOTED(CONFIG_PORTAMENTO_TIME_DEFAULT, $config_portamento_time_default, [Define default portamento time.])
886    
887 schoenebeck 714 AC_ARG_ENABLE(signed-triang-algo,
888     [ --enable-signed-triang-algo
889     Signed triangular wave algorithm to be used (e.g. for LFOs).
890     Currently available options:
891     intmath:
892     Uses integer math without any branch will then be
893     converted to floating point value for each sample point.
894     This int->float conversion might hurt on some systems.
895 senkov 720 intmathabs:
896     Similar to intmath but uses abs() function.
897     Depending on compiler and platrofm this could
898     perform better than integer math as it avoids
899 schoenebeck 1360 an extra integer multiply instruction.
900 schoenebeck 714 diharmonic:
901     The triangular wave will be approximated by adding two
902     sinusoidials. This solution might especially hurt on
903     systems with weak floating point unit.
904     benchmark (default):
905     This is not an algorithm. Use this option if the
906     appropriate algorithm should be automatically
907     chosen by the configure script by performing a
908     benchmark between the algorithms mentioned above.
909     This will NOT work for cross compilation!],
910     [ if test ! "(" "${enableval}" = "intmath" \
911 senkov 720 -o "${enableval}" = "intmathabs" \
912 schoenebeck 714 -o "${enableval}" = "diharmonic" ")" ; then
913     AC_MSG_ERROR([Unknown triangular wave algorithm for parameter --enable-signed-triang-algo])
914     else
915     config_signed_triang_algo="${enableval}"
916     fi
917     ],
918     [config_signed_triang_algo="benchmark"]
919     )
920 schoenebeck 563
921 schoenebeck 714 AC_ARG_ENABLE(unsigned-triang-algo,
922     [ --enable-unsigned-triang-algo
923     Unsigned triangular wave algorithm to be used (e.g. for LFOs).
924     Currently available options:
925     intmath:
926     Uses integer math without any branch will then be
927     converted to floating point value for each sample point.
928     This int->float conversion might hurt on some systems.
929 senkov 720 intmathabs:
930     Similar to intmath but uses abs() function.
931     Depending on compiler and platrofm this could
932     perform better than integer math as it avoids
933 schoenebeck 1360 an extra integer multiply instruction.
934 schoenebeck 714 diharmonic:
935     The triangular wave will be approximated by adding two
936     sinusoidials. This solution might especially hurt on
937     systems with weak floating point unit.
938     benchmark (default):
939     This is not an algorithm. Use this option if the
940     appropriate algorithm should be automatically
941     chosen by the configure script by performing a
942     benchmark between the algorithms mentioned above.
943     This will NOT work for cross compilation!],
944     [ if test ! "(" "${enableval}" = "intmath" \
945 senkov 720 -o "${enableval}" = "intmathabs" \
946 schoenebeck 714 -o "${enableval}" = "diharmonic" ")" ; then
947     AC_MSG_ERROR([Unknown triangular wave algorithm for parameter --enable-unsigned-triang-algo])
948     else
949     config_unsigned_triang_algo="${enableval}"
950     fi
951     ],
952     [config_unsigned_triang_algo="benchmark"]
953     )
954    
955 iliev 716 AC_ARG_ENABLE(process-muted-channels,
956     [ --enable-process-muted-channels
957     Enable processing of muted channels (default=no).
958     In that mode all MIDI events in the muted channels
959     will be processed. This will provide information
960     about the active voices in the muted channels and
961     will not discard notes, triggered in mute mode,
962     when the channel is unmuted. But also will reduce
963     the efficiency.],
964 schoenebeck 1360 [config_process_muted_channels="$enableval"],
965 iliev 716 [config_process_muted_channels="no"]
966     )
967     if test "$config_process_muted_channels" = "yes"; then
968     AC_DEFINE_UNQUOTED(CONFIG_PROCESS_MUTED_CHANNELS, 1, [Define to 1 if you want to enable processing of muted channels.])
969     fi
970 schoenebeck 714
971 schoenebeck 849 AC_ARG_ENABLE(process-all-notes-off,
972     [ --disable-process-all-notes-off
973     Disable interpretation of All-Notes-Off MIDI
974     messages (default=on). By default LS will release
975     all voices whenever it receives an All-Notes-Off
976     MIDI message. You can disable this behavior, so
977     that LS simply ignores such messages.],
978 schoenebeck 1360 [config_process_all_notes_off="$enableval"],
979 schoenebeck 849 [config_process_all_notes_off="yes"]
980     )
981     if test "$config_process_all_notes_off" = "yes"; then
982     AC_DEFINE_UNQUOTED(CONFIG_PROCESS_ALL_NOTES_OFF, 1, [Define to 1 if you want to enable processing of All-Notes-Off MIDI messages.])
983     fi
984    
985 persson 830 AC_ARG_ENABLE(interpolate-volume,
986     [ --disable-interpolate-volume
987     Disable interpolation of volume modulation
988     (default=on). With this enabled, the volume changes
989     generated by for example the envelope generator
990     will be smoother, minimizing the risk for audio
991     clicks. Disable it to reduce CPU usage.],
992 schoenebeck 1360 [config_interpolate_volume="$enableval"],
993 persson 830 [config_interpolate_volume="yes"]
994     )
995     if test "$config_interpolate_volume" = "yes"; then
996     AC_DEFINE_UNQUOTED(CONFIG_INTERPOLATE_VOLUME, 1, [Define to 1 if you want to enable interpolation of volume modulation.])
997     fi
998 iliev 716
999 schoenebeck 1212 AC_ARG_ENABLE(plugin-dir,
1000     [ --enable-plugin-dir
1001     Directory where the sampler shall look for potential plugins,
1002     that is 3rd party shared libraries that should be loaded by
1003     the sampler on startup. By default the sampler will search
1004     for plugins in the subdirectory "plugins" below its own
1005     library directory.
1006     (i.e. /usr/local/lib/linuxsampler/plugins)],
1007     [config_plugin_dir="${enableval}"],
1008     [config_plugin_dir="${libdir}/linuxsampler/plugins"]
1009     )
1010     AC_SUBST(config_plugin_dir)
1011 persson 830
1012 schoenebeck 1364 AC_ARG_ENABLE(default-instruments-db-location,
1013     [ --enable-default-instruments-db-location
1014     Only when instruments DB feature is enabled: file name
1015     which shall be taken as default location of the
1016     instruments DB file. This location can still be
1017     overridden at runtime with a command line switch.
1018     (default: /var/lib/linuxsampler/instruments.db)],
1019     [config_default_instruments_db_file="${enableval}"],
1020     [config_default_instruments_db_file="/var/lib/linuxsampler/instruments.db"]
1021     )
1022     AC_DEFINE_UNQUOTED(
1023     CONFIG_DEFAULT_INSTRUMENTS_DB_LOCATION,
1024     "$config_default_instruments_db_file",
1025     [Only when instruments DB feature is enabled: default location of the DB file.]
1026     )
1027 schoenebeck 1432 AC_SUBST(config_default_instruments_db_file)
1028 schoenebeck 1212
1029 schoenebeck 1364
1030 schoenebeck 554 ###########################################################################
1031 schoenebeck 714 # Automatic Benchmarks (to detect the best algorithms for the system)
1032    
1033     AC_LANG_SAVE
1034    
1035     if test "$config_signed_triang_algo" = "benchmark"; then
1036     echo -n "benchmarking for the best (signed) triangular oscillator algorithm... "
1037     AC_LANG_CPLUSPLUS
1038     AC_TRY_RUN([
1039     #define SIGNED 1
1040     #define SILENT 1
1041 schoenebeck 738 #include "${srcdir}/benchmarks/triang.cpp"
1042 schoenebeck 714 ],
1043     triang_signed=0,
1044     triang_signed=$?,
1045     triang_signed=0
1046     )
1047     if test "$triang_signed" = "2"; then
1048     config_signed_triang_algo="intmath"
1049     echo "integer math"
1050     elif test "$triang_signed" = "3"; then
1051     config_signed_triang_algo="diharmonic"
1052     echo "di harmonics"
1053 senkov 720 elif test "$triang_signed" = "5"; then
1054     config_signed_triang_algo="intmathabs"
1055     echo "integer math using abs()"
1056 schoenebeck 714 else
1057     echo "Benchmark of signed triangular wave algorithms failed!"
1058     echo "Maybe you are doing cross compilation? In that case you have to select"
1059     echo "an algorithm manually with './configure --enable-signed-triang-algo=...'"
1060     echo "Call './configure --help' for further information or read configure.in."
1061     exit -1;
1062     fi
1063 schoenebeck 1165 else
1064     case "$config_signed_triang_algo" in
1065     intmath)
1066     triang_signed=2 ;;
1067     diharmonic)
1068     triang_signed=3 ;;
1069     intmathabs)
1070     triang_signed=5 ;;
1071     esac
1072 schoenebeck 714 fi
1073 schoenebeck 738 AC_DEFINE_UNQUOTED(CONFIG_SIGNED_TRIANG_ALGO, ${triang_signed}, [Define signed triangular wave algorithm to be used.])
1074 schoenebeck 714
1075     if test "$config_unsigned_triang_algo" = "benchmark"; then
1076     echo -n "benchmarking for the best (unsigned) triangular oscillator algorithm... "
1077     AC_LANG_CPLUSPLUS
1078     AC_TRY_RUN([
1079     #define SIGNED 0
1080     #define SILENT 1
1081 schoenebeck 738 #include "${srcdir}/benchmarks/triang.cpp"
1082 schoenebeck 714 ],
1083     triang_unsigned=0,
1084     triang_unsigned=$?,
1085     triang_unsigned=0
1086     )
1087     if test "$triang_unsigned" = "2"; then
1088     config_unsigned_triang_algo="intmath"
1089     echo "integer math"
1090     elif test "$triang_unsigned" = "3"; then
1091     config_unsigned_triang_algo="diharmonic"
1092     echo "di harmonics"
1093 senkov 720 elif test "$triang_unsigned" = "5"; then
1094 schoenebeck 726 config_unsigned_triang_algo="intmathabs"
1095 senkov 720 echo "integer math using abs()"
1096 schoenebeck 714 else
1097     echo "Benchmark of unsigned triangular wave algorithms failed!"
1098     echo "Maybe you are doing cross compilation? In that case you have to select"
1099     echo "an algorithm manually with './configure --enable-unsigned-triang-algo=...'"
1100     echo "Call './configure --help' for further information or read configure.in."
1101     exit -1;
1102     fi
1103 schoenebeck 1165 else
1104     case "$config_unsigned_triang_algo" in
1105     intmath)
1106     triang_unsigned=2 ;;
1107     diharmonic)
1108     triang_unsigned=3 ;;
1109     intmathabs)
1110     triang_unsigned=5 ;;
1111     esac
1112 schoenebeck 714 fi
1113 schoenebeck 738 AC_DEFINE_UNQUOTED(CONFIG_UNSIGNED_TRIANG_ALGO, ${triang_unsigned}, [Define unsigned triangular wave algorithm to be used.])
1114 schoenebeck 714
1115     AC_LANG_RESTORE
1116    
1117    
1118     ###########################################################################
1119 schoenebeck 554 # Create Build Files
1120    
1121 schoenebeck 9 AM_CONFIG_HEADER(config.h)
1122 schoenebeck 697 AM_INIT_AUTOMAKE(linuxsampler, "$LINUXSAMPLER_RELEASE_MAJOR.$LINUXSAMPLER_RELEASE_MINOR.$LINUXSAMPLER_RELEASE_BUILD")
1123 schoenebeck 9
1124     AC_LANG_CPLUSPLUS
1125 persson 497
1126 persson 685 # some gcc 4.0 versions need -msse for SSE register allocations
1127     if test "$config_asm" = "yes"; then
1128     if test "$def_arch_x86" = 1; then
1129     CXXFLAGS="$CXXFLAGS -msse"
1130     fi
1131     fi
1132    
1133 persson 497 # autoconf 2.59/libtool 1.5.12 bug? work-around. Without a check like
1134     # this, the dlfcn.h check in am_prog_libtool may fail.
1135     AC_CHECK_HEADER(stdlib.h)
1136    
1137 schoenebeck 654 AC_OUTPUT( \
1138     Makefile \
1139     man/Makefile \
1140     man/linuxsampler.1 \
1141     src/Makefile \
1142 iliev 1161 src/db/Makefile \
1143 schoenebeck 654 src/network/Makefile \
1144     src/engines/Makefile \
1145     src/engines/gig/Makefile \
1146     src/engines/common/Makefile \
1147 schoenebeck 1722 src/effects/Makefile \
1148 schoenebeck 1321 src/common/Makefile \
1149 schoenebeck 654 src/testcases/Makefile \
1150     src/drivers/Makefile \
1151     src/drivers/audio/Makefile \
1152     src/drivers/midi/Makefile \
1153 schoenebeck 1375 src/plugins/Makefile \
1154 schoenebeck 654 linuxsampler.spec \
1155     debian/Makefile \
1156     Artwork/Makefile \
1157     scripts/Makefile \
1158     osx/Makefile \
1159 schoenebeck 1175 osx/linuxsampler.xcodeproj/Makefile \
1160 schoenebeck 654 Documentation/Makefile \
1161     Documentation/Engines/Makefile \
1162     Documentation/Engines/gig/Makefile \
1163 schoenebeck 697 linuxsampler.pc \
1164     Doxyfile \
1165 schoenebeck 654 )
1166 schoenebeck 554
1167 schoenebeck 1212 # resolve all nested variables in '${config_plugin_dir}'
1168     # (merely for providing a human readable summary below)
1169     while test $config_plugin_dir != `eval echo ${config_plugin_dir}` ; do
1170     config_plugin_dir=`eval echo ${config_plugin_dir}`
1171     done
1172 schoenebeck 554
1173 schoenebeck 1212
1174 schoenebeck 554 ###########################################################################
1175     # Output All Configuration Options
1176    
1177     echo ""
1178     echo "#####################################################################"
1179     echo "# LinuxSampler Configuration #"
1180     echo "#-------------------------------------------------------------------#"
1181 schoenebeck 617 echo "# Assembly Optimizations: ${config_asm}"
1182 schoenebeck 554 echo "# Development Mode: ${config_dev_mode}"
1183     echo "# Debug Level: ${config_debug_level}"
1184     echo "# Use Exceptions in RT Context: ${config_rt_exceptions}"
1185     echo "# Preload Samples: ${config_preload_samples}"
1186     echo "# Maximum Pitch: ${config_max_pitch} (octaves)"
1187     echo "# Maximum Events: ${config_max_events}"
1188     echo "# Envelope Bottom Level: ${config_eg_bottom} (linear)"
1189     echo "# Envelope Minimum Release Time: ${config_eg_min_release_time} s"
1190     echo "# Streams to be refilled per Disk Thread Cycle: ${config_refill_streams}"
1191     echo "# Minimum Stream Refill Size: ${config_stream_min_refill}"
1192     echo "# Maximum Stream Refill Size: ${config_stream_max_refill}"
1193     echo "# Stream Size: ${config_stream_size}"
1194     echo "# Maximum Disk Streams: ${config_max_streams}"
1195     echo "# Maximum Voices: ${config_max_voices}"
1196 schoenebeck 738 echo "# Default Subfragment Size: ${config_subfragment_size}"
1197 schoenebeck 1005 echo "# Default Global Volume Attenuation: ${config_global_attenuation_default}"
1198 schoenebeck 563 echo "# Voice Stealing Algorithm: ${config_voice_steal_algo}"
1199 schoenebeck 714 echo "# Signed Triangular Oscillator Algorithm: ${config_signed_triang_algo}"
1200     echo "# Unsigned Triangular Oscillator Algorithm: ${config_unsigned_triang_algo}"
1201 schoenebeck 554 echo "# SysEx Buffer Size: ${config_sysex_buffer_size} Byte"
1202 schoenebeck 829 echo "# Min. Portamento Time: ${config_portamento_time_min} s"
1203     echo "# Max. Portamento Time: ${config_portamento_time_max} s"
1204     echo "# Default Portamento Time: ${config_portamento_time_default} s"
1205 schoenebeck 554 echo "# Force Filter Usage: ${config_force_filter}"
1206     echo "# Filter Cutoff Minimum: ${config_filter_cutoff_min} Hz"
1207     echo "# Filter Cutoff Maximum: ${config_filter_cutoff_max} Hz"
1208     echo "# Override Filter Cutoff Controller: ${config_override_cutoff_ctrl}"
1209     echo "# Override Filter Resonance Controller: ${config_override_resonance_ctrl}"
1210     echo "# Override Filter Type: ${config_override_filter_type}"
1211 schoenebeck 563 echo "# Assert GS SysEx Checksum: ${config_assert_gs_sysex_checksum}"
1212 iliev 716 echo "# Process Muted Channels: ${config_process_muted_channels}"
1213 schoenebeck 849 echo "# Process All-Notes-Off MIDI message: ${config_process_all_notes_off}"
1214 persson 830 echo "# Interpolate Volume: ${config_interpolate_volume}"
1215 schoenebeck 1364 echo "# Instruments database support: ${config_instruments_db}"
1216     if test "$config_instruments_db" = "yes"; then
1217     echo "# Instruments DB default location: ${config_default_instruments_db_file}"
1218     fi
1219 schoenebeck 1212 echo "# Plugin Path: ${config_plugin_dir}"
1220 schoenebeck 554 echo "#-------------------------------------------------------------------#"
1221     echo "# Read './configure --help' or file 'configure.in' for details. #"
1222     echo "#####################################################################"
1223     echo ""
1224     echo "Good. Now type 'make' to compile, followed by 'make install' as root."
1225     echo ""

  ViewVC Help
Powered by ViewVC