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

Contents of /linuxsampler/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 829 - (show annotations) (download)
Sat Jan 14 14:07:47 2006 UTC (18 years, 2 months ago) by schoenebeck
Original Path: linuxsampler/trunk/configure.in
File size: 36521 byte(s)
* implemented portamento mode and solo mode (a.k.a 'mono mode'):
  all modes can be altered via standard GM messages, that is CC5 for
  altering portamento time, CC65 for enabling / disabling portamento
  mode, CC126 for enabling solo mode and CC127 for disabling solo mode
* fixed EG3 (pitch envelope) synthesis which was neutral all the time
* configure.in: do not automatically pick optimized gcc flags if the user
  already provided some on his own (as CXXFLAGS)

1 AC_INIT(configure.in)
2
3 #------------------------------------------------------------------------------------
4 # LinuxSampler's / liblinuxsampler's "official" release version:
5
6 LINUXSAMPLER_RELEASE_MAJOR=0
7 LINUXSAMPLER_RELEASE_MINOR=3
8 LINUXSAMPLER_RELEASE_BUILD=3cvs
9
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 LIBLINUXSAMPLER_LT_CURRENT=0
28 LIBLINUXSAMPLER_LT_REVISION=0
29 LIBLINUXSAMPLER_LT_AGE=0
30 SHARED_VERSION_INFO="$LIBLINUXSAMPLER_LT_CURRENT:$LIBLINUXSAMPLER_LT_REVISION:$LIBLINUXSAMPLER_LT_AGE"
31
32 AM_PROG_LIBTOOL
33
34 AC_SUBST(SHLIB_VERSION_ARG)
35 AC_SUBST(SHARED_VERSION_INFO)
36
37 AC_C_BIGENDIAN
38 AC_CANONICAL_SYSTEM
39
40 AC_SUBST(target)
41 AC_SUBST(target_alias)
42 AC_SUBST(target_cpu)
43 AC_SUBST(target_os)
44 AC_SUBST(target_vendor)
45
46
47 ###########################################################################
48 # General Checks
49
50 AC_MSG_CHECKING([whether x86 architecture])
51 def_arch_x86=0
52 case $target_cpu in
53 "i386" | "i486" | "i586" | "i686" | "i786")
54 echo "yes"
55 def_arch_x86=1;;
56 *)
57 echo "no";;
58 esac
59 AC_DEFINE_UNQUOTED(ARCH_X86,$def_arch_x86,[Define to 1 if you build for x86 architecture.])
60
61 # determine the right gcc switch for CPU specific optimizations
62 # (only if the user did not provide one)
63 CXX_CPU_SWITCH=
64 echo "X $CXXFLAGS "
65 if ! echo "X $CXXFLAGS " | grep -q -- " \(-march=\|-mcpu=\|-mtune=\|-arch=\)" ; then
66 if test "$def_arch_x86" = 1; then
67 CXX_CPU_SWITCH="-march=$target_cpu"
68 elif test "$target_cpu" = "powerpc"; then
69 CXX_CPU_SWITCH="-arch=$target_cpu"
70 fi
71 fi
72 AC_SUBST([CXX_CPU_SWITCH])
73
74 AC_MSG_CHECKING([whether UNIX98 compatible])
75 AC_LANG_SAVE
76 AC_LANG_C
77 AC_TRY_RUN([
78 #ifndef _GNU_SOURCE
79 #define _GNU_SOURCE 1
80 #endif
81 #include <features.h>
82 void main(void) {
83 #if _XOPEN_SOURCE >= 500
84 exit(0); /* UNIX98 compatible */
85 #else
86 exit(-1); /* not UNIX98 compatible */
87 #endif
88 }
89 ],
90 have_unix98="yes",
91 have_unix98="no",
92 have_unix98="no"
93 )
94 AC_LANG_RESTORE
95 AC_MSG_RESULT([$have_unix98])
96 if test "$have_unix98" = "no"; then
97 if test "x$HAVE_UNIX98" = "x"; then
98 echo "LinuxSampler only runs on UNIX98 compatible systems, which is mandatory for"
99 echo "pthread_mutexattr_settype() call in Mutex.cpp. You may want to run
100 echo "./configure with environment variable HAVE_UNIX98=1 in case you think you
101 echo "have a UNIX98 compatible system."
102 exit -1;
103 fi
104 fi
105
106 # check for <features.h>
107 AC_CHECK_HEADERS(features.h)
108
109 # Checks for available audio and MIDI systems / drivers
110 # (we throw an error if there's not at least one system for audio output and MIDI input available)
111 have_midi_input_driver="false"
112 have_audio_output_driver="false"
113
114 AC_CHECK_HEADER(alsa/asoundlib.h,
115 AC_CHECK_LIB(asound, main,
116 have_alsa=1
117 ,
118 have_alsa=0
119 )
120 ,
121 have_alsa=0
122 )
123 if test "$have_alsa" = "1"; then
124 have_midi_input_driver="true"
125 have_audio_output_driver="true";
126 fi
127 AM_CONDITIONAL(HAVE_ALSA, test $have_alsa = "1")
128 AC_DEFINE_UNQUOTED(HAVE_ALSA,$have_alsa,[Define to 1 if you have ALSA installed.])
129
130 echo -n "checking Alsa version... "
131 AC_LANG_SAVE
132 AC_LANG_C
133 AC_TRY_RUN([
134 #include <alsa/asoundlib.h>
135 void main(void) {
136 /* ensure backward compatibility */
137 #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
138 #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
139 #endif
140 exit(SND_LIB_MAJOR);
141 }
142 ],
143 alsa_major=0,
144 alsa_major=$?,
145 alsa_major=0
146 )
147 AC_TRY_RUN([
148 #include <alsa/asoundlib.h>
149 void main(void) {
150 /* ensure backward compatibility */
151 #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
152 #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
153 #endif
154 exit(SND_LIB_MINOR);
155 }
156 ],
157 alsa_minor=0,
158 alsa_minor=$?,
159 alsa_minor=0
160 )
161 AC_TRY_RUN([
162 #include <alsa/asoundlib.h>
163 void main(void) {
164 /* ensure backward compatibility */
165 #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
166 #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
167 #endif
168 exit(SND_LIB_SUBMINOR);
169 }
170 ],
171 alsa_subminor=0,
172 alsa_subminor=$?,
173 alsa_subminor=0
174 )
175 AC_LANG_RESTORE
176 echo "$alsa_major.$alsa_minor.$alsa_subminor";
177 AC_DEFINE_UNQUOTED(ALSA_MAJOR,$alsa_major,[Define to the major version number of your Alsa installation.])
178 AC_DEFINE_UNQUOTED(ALSA_MINOR,$alsa_minor,[Define to the minor version number of your Alsa installation.])
179 AC_DEFINE_UNQUOTED(ALSA_SUBMINOR,$alsa_subminor,[Define to the subminor version number of your Alsa installation.])
180
181 # JACK
182 PKG_CHECK_MODULES(JACK, jack, HAVE_JACK=true, HAVE_JACK=false)
183 AC_SUBST(JACK_LIBS)
184 AC_SUBST(JACK_CFLAGS)
185 if test $HAVE_JACK = false; then
186 HAVE_JACK=0;
187 else
188 HAVE_JACK=1
189 have_audio_output_driver="true";
190 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)
191 fi
192 AM_CONDITIONAL(HAVE_JACK, test $HAVE_JACK = 1)
193 AC_DEFINE_UNQUOTED(HAVE_JACK,$HAVE_JACK,[Define to 1 if you have JACK installed.])
194
195 # MidiShare (Linux, OS X, Windows)
196 AC_CHECK_HEADER(MidiShare.h,
197 AC_CHECK_LIB(MidiShare, MidiCountEvs,
198 have_midishare=1,
199 have_midishare=0
200 )
201 ,
202 have_midishare=0
203 )
204 if test "$have_midishare" = "1"; then
205 have_midi_input_driver="true"
206 fi
207 AM_CONDITIONAL(HAVE_MIDISHARE, test $have_midishare = "1")
208 AC_DEFINE_UNQUOTED(HAVE_MIDISHARE,$have_midishare,[Define to 1 if you have MidiShare installed.])
209
210 # CoreMIDI (OS X)
211 AC_CHECK_HEADER(CoreMIDI/CoreMIDI.h,
212 have_coremidi=1,
213 have_coremidi=0
214 )
215 if test "$have_coremidi" = "1"; then
216 have_midi_input_driver="true"
217 fi
218 AM_CONDITIONAL(HAVE_COREMIDI, test $have_coremidi = "1")
219 AC_DEFINE_UNQUOTED(HAVE_COREMIDI,$have_coremidi,[Define to 1 if you have CoreMIDI installed.])
220
221 # Check presence of libgig
222 libgig_version="2.0.2"
223 PKG_CHECK_MODULES(GIG, gig >= $libgig_version, HAVE_GIG=true, HAVE_GIG=false)
224 if test "$HAVE_GIG" = "false"; then
225 echo "Required libgig version not found!"
226 echo "You need to have libgig version ${libgig_version} installed!"
227 exit -1;
228 else
229 echo "yes, found libgig $libgig_version"
230 fi
231 AC_SUBST(GIG_CFLAGS)
232 AC_SUBST(GIG_LIBS)
233
234 # SQLITE3
235 PKG_CHECK_MODULES(SQLITE3, sqlite3, HAVE_SQLITE3=true, HAVE_SQLITE3=false)
236 AC_SUBST(SQLITE3_LIBS)
237 AC_SUBST(SQLITE3_CFLAGS)
238 if test $HAVE_SQLITE3 = false; then
239 HAVE_SQLITE3=0;
240 echo "no, support for instrument DB will be disabled!"
241 else
242 HAVE_SQLITE3=1
243 echo "yes"
244 fi
245 AM_CONDITIONAL(HAVE_SQLITE3, test $HAVE_SQLITE3 = 1)
246 AC_DEFINE_UNQUOTED(HAVE_SQLITE3,$HAVE_SQLITE3,[Define to 1 if you have SQLITE3 installed.])
247
248 if test "$have_midi_input_driver" = "false"; then
249 echo "No supported MIDI input system found!"
250 echo "Sorry, LinuxSampler only supports the following MIDI drivers at the moment:"
251 echo "ALSA, MIDIShare, CoreMIDI."
252 echo "If you think you have one of those available on your system, make sure you"
253 echo "also have the respective development (header) files installed."
254 exit -1;
255 fi
256 if test "$have_audio_output_driver" = "false"; then
257 echo "No supported audio output system found!"
258 echo "Sorry, LinuxSampler only supports ALSA and JACK as audio output driver at the moment!"
259 exit -1;
260 fi
261
262
263 ###########################################################################
264 # Handle Configuration Options
265
266 # TODO: should we use AC_ARG_VAR(variable, description) instead?
267
268 AC_ARG_ENABLE(asm,
269 [ --enable-asm
270 Enable hand-crafted assembly optimizations
271 (default=off). LinuxSampler provides CPU specific
272 assembly optimizations for the most important
273 synthesis algorithms. This is currently disabled
274 by default since current asm code is broken.],
275 [config_asm="yes"],
276 [config_asm="no"]
277 )
278 if test "$config_asm" = "yes"; then
279 AC_DEFINE_UNQUOTED(CONFIG_ASM, 1, [Define to 1 if you want to enable hand-crafted asm optimizations.])
280 fi
281
282 AC_ARG_ENABLE(dev-mode,
283 [ --disable-dev-mode
284 Disable development mode (default=on). In that mode
285 we do some extra sanity checks here and there.
286 This helps to spot possible problems, but reduces
287 efficiency a bit],
288 [config_dev_mode="no"],
289 [config_dev_mode="yes"]
290 )
291 if test "$config_dev_mode" = "yes"; then
292 AC_DEFINE_UNQUOTED(CONFIG_DEVMODE, 1, [Define to 1 if you want to enable development mode.])
293 fi
294
295 AC_ARG_ENABLE(debug-level,
296 [ --enable-debug-level
297 Specify verbosity of console messages (default=1).
298 The higher the value, the higher will be verbosity.
299 A value of 0 means no console output at all.
300 There's not really an upper limit but the usual
301 level of all messages is currently somewhere less
302 than 10.],
303 [config_debug_level="${enableval}"],
304 [config_debug_level="1"]
305 )
306 AC_DEFINE_UNQUOTED(CONFIG_DEBUG_LEVEL, $config_debug_level, [Define console verbosity.])
307
308 AC_ARG_ENABLE(rt-exceptions,
309 [ --enable-rt-exceptions
310 Enable exceptions in the realtime thread
311 (default=no). If this is enabled, exceptions will
312 be thrown on critical errors in the realtime
313 context as well. Otherwise if disabled
314 segmentation faults will be forced by the
315 application on critical errors.],
316 [config_rt_exceptions="yes"],
317 [config_rt_exceptions="no"]
318 )
319 if test "$config_rt_exceptions" = "yes"; then
320 AC_DEFINE_UNQUOTED(CONFIG_RT_EXCEPTIONS, 1, [Define to 1 to allow exceptions in the realtime context.])
321 fi
322
323 AC_ARG_ENABLE(preload-samples,
324 [ --enable-preload-samples
325 Due to seeking and latency issues with hard drives
326 we have to cache a small part of samples' head in
327 RAM (default=32768). The higher this value the
328 more memory will be occupied for each sample, but
329 the safer this will be in regards of possible
330 droputs. A 'good' value depends on the running
331 system and usage dependant factors.],
332 [config_preload_samples="${enableval}"],
333 [config_preload_samples="32768"]
334 )
335 AC_DEFINE_UNQUOTED(CONFIG_PRELOAD_SAMPLES, $config_preload_samples, [Define amount of sample points to be cached in RAM.])
336
337 AC_ARG_ENABLE(max-pitch,
338 [ --enable-max-pitch
339 Specify the maximum allowed pitch value in octaves
340 (default=4). To lower memory usage you might want
341 set a smaller value.],
342 [config_max_pitch="${enableval}"],
343 [config_max_pitch="4"]
344 )
345 AC_DEFINE_UNQUOTED(CONFIG_MAX_PITCH, $config_max_pitch, [Define max. allowed pitch.])
346
347 AC_ARG_ENABLE(max-events,
348 [ --enable-max-events
349 Specify the maximum allowed amount of events to be
350 processed per fragment (default=1024).],
351 [config_max_events="${enableval}"],
352 [config_max_events="1024"]
353 )
354 AC_DEFINE_UNQUOTED(CONFIG_MAX_EVENTS_PER_FRAGMENT, $config_max_events, [Define max. allowed events per fragment.])
355
356 AC_ARG_ENABLE(eg-bottom,
357 [ --enable-eg-bottom
358 Bottom limit of envelope generators
359 (default=0.001). Certain kinds of curve types like
360 exponential curves converge against 0 but never
361 reach 0. So we have to define a certain low value
362 after which we should consider all smaller values
363 to be 'almost zero'. The smaller this value, the
364 longer will voices survive in EG's release stage
365 and thus waste voices. If this value is too high
366 will cause click sounds though.],
367 [config_eg_bottom="${enableval}"],
368 [config_eg_bottom="0.001"]
369 )
370 AC_DEFINE_UNQUOTED(CONFIG_EG_BOTTOM, $config_eg_bottom, [Define bottom limit of envelopes.])
371
372 AC_ARG_ENABLE(eg-min-release-time,
373 [ --enable-eg-min-release-time
374 Specify the lowest allowed release time in seconds
375 (default=0.0025). This value will also be used to
376 ramp down voices on voice stealing. This value
377 should always be less than the period time of the
378 used audio driver, as in case of voice stealing
379 the killed voice needs to be completely ramped
380 down in the same fragment.],
381 [config_eg_min_release_time="${enableval}"],
382 [config_eg_min_release_time="0.0025"]
383 )
384 AC_DEFINE_UNQUOTED(CONFIG_EG_MIN_RELEASE_TIME, $config_eg_min_release_time, [Define min. release time.])
385
386 AC_ARG_ENABLE(refill-streams,
387 [ --enable-refill-streams
388 Number of streams that should be refilled in each
389 disk thread cycle (default=4).],
390 [config_refill_streams="${enableval}"],
391 [config_refill_streams="4"]
392 )
393 AC_DEFINE_UNQUOTED(CONFIG_REFILL_STREAMS_PER_RUN, $config_refill_streams, [Define amount of streams to be refilled per cycle.])
394
395 AC_ARG_ENABLE(stream-min-refill,
396 [ --enable-stream-min-refill
397 Minimum refill size for disk streams (default=1024).
398 The disk thread will go to sleep for a while if no
399 stream had to be refilled more than this value in
400 a disk thread cycle.],
401 [config_stream_min_refill="${enableval}"],
402 [config_stream_min_refill="1024"]
403 )
404 AC_DEFINE_UNQUOTED(CONFIG_STREAM_MIN_REFILL_SIZE, $config_stream_min_refill, [Define min. stream refill size.])
405
406 AC_ARG_ENABLE(stream-max-refill,
407 [ --enable-stream-max-refill
408 Maximum refill size for disk streams
409 (default=65536). The disk thread will refill
410 each stream only by a size of this value per
411 disk thread cycle.],
412 [config_stream_max_refill="${enableval}"],
413 [config_stream_max_refill="65536"]
414 )
415 AC_DEFINE_UNQUOTED(CONFIG_STREAM_MAX_REFILL_SIZE, $config_stream_max_refill, [Define max. stream refill size.])
416
417 AC_ARG_ENABLE(stream-size,
418 [ --enable-stream-size
419 Size of each stream's ring buffer in sample points
420 (default=262144).],
421 [config_stream_size="${enableval}"],
422 [config_stream_size="262144"]
423 )
424 AC_DEFINE_UNQUOTED(CONFIG_STREAM_BUFFER_SIZE, $config_stream_size, [Define each stream's ring buffer size.])
425
426 AC_ARG_ENABLE(max-streams,
427 [ --enable-max-streams
428 Maximum amount of disk streams (default=90). This
429 value should always be higher than the maximum
430 amount of voices.],
431 [config_max_streams="${enableval}"],
432 [config_max_streams="90"]
433 )
434 AC_DEFINE_UNQUOTED(CONFIG_MAX_STREAMS, $config_max_streams, [Define max. streams.])
435
436 AC_ARG_ENABLE(max-voices,
437 [ --enable-max-voices
438 Maximum amount of voices (default=64). This value
439 should always be lower than the maximum amount of
440 disk streams.],
441 [config_max_voices="${enableval}"],
442 [config_max_voices="64"]
443 )
444 AC_DEFINE_UNQUOTED(CONFIG_MAX_VOICES, $config_max_voices, [Define max. voices.])
445
446 AC_ARG_ENABLE(subfragment-size,
447 [ --enable-subfragment-size
448 Every audio fragment will be splitted into
449 subfragments. Where each subfragment renders
450 audio with constant synthesis parameters. This is
451 done for efficiency reasons. This parameter
452 defines the default size of a subfragment in
453 sample points. A large value means less CPU time
454 whereas a low value means better audio quality
455 (default=32).],
456 [config_subfragment_size="${enableval}"],
457 [config_subfragment_size="32"]
458 )
459 AC_DEFINE_UNQUOTED(CONFIG_DEFAULT_SUBFRAGMENT_SIZE, $config_subfragment_size, [Define default subfragment size (in sample points).])
460
461 AC_ARG_ENABLE(global-attenuation,
462 [ --enable-global-attenuation
463 To prevent clipping all samples will be lowered
464 in amplitude by this given factor.
465 (default=0.35)],
466 [config_global_attenuation="${enableval}"],
467 [config_global_attenuation="0.35"]
468 )
469 AC_DEFINE_UNQUOTED(CONFIG_GLOBAL_ATTENUATION, $config_global_attenuation, [Define global volume attenuation (as floating point factor).])
470
471 AC_ARG_ENABLE(voice-steal-algo,
472 [ --enable-voice-steal-algo
473 Voice stealing algorithm to be used. Currently
474 available options:
475 none:
476 Disable voice stealing completely.
477 oldestvoiceonkey (default):
478 Try to kill a voice on the same key first,
479 if no success, proceed with the oldest key.
480 oldestkey:
481 Try to kill a voice from the oldest active
482 key.],
483 [ if test ! "(" "${enableval}" = "none" \
484 -o "${enableval}" = "oldestvoiceonkey" \
485 -o "${enableval}" = "oldestkey" ")" ; then
486 AC_MSG_ERROR([Unknown voice stealing algorithm for parameter --enable-voice-steal-algo])
487 else
488 config_voice_steal_algo="${enableval}"
489 fi
490 ],
491 [config_voice_steal_algo="oldestvoiceonkey"]
492 )
493 AC_DEFINE_UNQUOTED(CONFIG_VOICE_STEAL_ALGO, voice_steal_algo_${config_voice_steal_algo}, [Define voice stealing algorithm to be used.])
494
495 AC_ARG_ENABLE(sysex-buffer-size,
496 [ --enable-sysex-buffer-size
497 System Exclusive Message buffer size in kB
498 (default=2048).],
499 [config_sysex_buffer_size="${enableval}"],
500 [config_sysex_buffer_size="2048"]
501 )
502 AC_DEFINE_UNQUOTED(CONFIG_SYSEX_BUFFER_SIZE, $config_sysex_buffer_size, [Define SysEx buffer size.])
503
504 AC_ARG_ENABLE(force-filter,
505 [ --enable-force-filter
506 If enabled will force filter to be used even if
507 no usage was define in instrument patch files.
508 (default=no).],
509 [config_force_filter="yes"],
510 [config_force_filter="no"]
511 )
512 if test "$config_force_filter" = "yes"; then
513 AC_DEFINE_UNQUOTED(CONFIG_FORCE_FILTER, 1, [Define to 1 to force filter usage.])
514 fi
515
516 AC_ARG_ENABLE(filter-cutoff-min,
517 [ --enable-filter-cutoff-min
518 Minimum filter cutoff frequency in Hz
519 (default=100.0).],
520 [config_filter_cutoff_min="${enableval}"],
521 [config_filter_cutoff_min="100.0"]
522 )
523 AC_DEFINE_UNQUOTED(CONFIG_FILTER_CUTOFF_MIN, ${config_filter_cutoff_min}f, [Define min. filter cutoff frequency.])
524
525 AC_ARG_ENABLE(filter-cutoff-max,
526 [ --enable-filter-cutoff-max
527 Maximum filter cutoff frequency in Hz
528 (default=10000.0).],
529 [config_filter_cutoff_max="${enableval}"],
530 [config_filter_cutoff_max="10000.0"]
531 )
532 AC_DEFINE_UNQUOTED(CONFIG_FILTER_CUTOFF_MAX, ${config_filter_cutoff_max}f, [Define max. filter cutoff frequency.])
533
534 AC_ARG_ENABLE(override-cutoff-ctrl,
535 [ --enable-override-cutoff-ctrl
536 Override filter cutoff MIDI controller (default=no).
537 Note: you have to define the MIDI controller number
538 here, it's not a boolean parameter type! If this
539 option is used, controller number given by
540 instrument patch will be ignored and instead this
541 supplied value will be used.],
542 [config_override_cutoff_ctrl="${enableval}"],
543 [config_override_cutoff_ctrl="no"]
544 )
545 if test ! "$config_override_cutoff_ctrl" = "no"; then
546 AC_DEFINE_UNQUOTED(CONFIG_OVERRIDE_CUTOFF_CTRL, $config_override_cutoff_ctrl, [Define to a MIDI controller number to override cutoff control.])
547 fi
548
549 AC_ARG_ENABLE(override-resonance-ctrl,
550 [ --enable-override-resonance-ctrl
551 Override filter resonance MIDI controller
552 (default=no). Note: you have to define the MIDI
553 controller number here, it's not a boolean
554 parameter type! If this option is used, controller
555 number given by instrument patch will be ignored
556 and instead this supplied value will be used.],
557 [config_override_resonance_ctrl="${enableval}"],
558 [config_override_resonance_ctrl="no"]
559 )
560 if test ! "$config_override_resonance_ctrl" = "no"; then
561 AC_DEFINE_UNQUOTED(CONFIG_OVERRIDE_RESONANCE_CTRL, $config_override_resonance_ctrl, [Define to a MIDI controller number to override resonance control.])
562 fi
563
564 AC_ARG_ENABLE(override-filter-type,
565 [ --enable-override-filter-type
566 Override filter type (default=no). Options:
567 hp: for highpass
568 bp: for bandpass
569 br: for bandreject
570 lp: for lowpass
571 lpt: for lowpass turbo],
572 [ if test "${enableval}" = "hp" ; then
573 config_override_filter_type="::gig::vcf_type_highpass"
574 elif test "${enableval}" = "bp" ; then
575 config_override_filter_type="::gig::vcf_type_bandpass"
576 elif test "${enableval}" = "br" ; then
577 config_override_filter_type="::gig::vcf_type_bandreject"
578 elif test "${enableval}" = "lp" ; then
579 config_override_filter_type="::gig::vcf_type_lowpass"
580 elif test "${enableval}" = "lpt" ; then
581 config_override_filter_type="::gig::vcf_type_lowpassturbo"
582 elif test ! "${enableval}" = "no"; then
583 AC_MSG_ERROR([Unknown filter type for parameter --enable-override-filter-type])
584 fi
585 ],
586 [config_override_filter_type="no"]
587 )
588 if test ! "$config_override_filter_type" = "no"; then
589 AC_DEFINE_UNQUOTED(CONFIG_OVERRIDE_FILTER_TYPE, $config_override_filter_type, [Define to a filter type to always force that filter type.])
590 fi
591
592 AC_ARG_ENABLE(gs-checksum,
593 [ --enable-gs-checksum
594 Enable Roland General Synth SysEx checksum check
595 (default=no). If this is enabled, all GS SysEx
596 messages which do not provide a correct checksum
597 will be ignored. This is disabled by default as
598 not all devices honor GS checksums.],
599 [config_assert_gs_sysex_checksum="yes"],
600 [config_assert_gs_sysex_checksum="no"]
601 )
602 if test "config_assert_gs_sysex_checksum" = "yes"; then
603 AC_DEFINE_UNQUOTED(CONFIG_ASSERT_GS_SYSEX_CHECKSUM, 1, [Define to 1 if you want to enable GS SysEx check.])
604 fi
605
606 AC_ARG_ENABLE(portamento-time-min,
607 [ --enable-portamento-time-min
608 Minimum Portamento time in seconds
609 (default=0.1).],
610 [config_portamento_time_min="${enableval}"],
611 [config_portamento_time_min="0.1"]
612 )
613 AC_DEFINE_UNQUOTED(CONFIG_PORTAMENTO_TIME_MIN, $config_portamento_time_min, [Define min. portamento time.])
614
615 AC_ARG_ENABLE(portamento-time-max,
616 [ --enable-portamento-time-max
617 Maximum Portamento time in seconds
618 (default=32).],
619 [config_portamento_time_max="${enableval}"],
620 [config_portamento_time_max="32"]
621 )
622 AC_DEFINE_UNQUOTED(CONFIG_PORTAMENTO_TIME_MAX, $config_portamento_time_max, [Define max. portamento time.])
623
624 AC_ARG_ENABLE(portamento-time-default,
625 [ --enable-portamento-time-default
626 Default Portamento time in seconds
627 (default=1).],
628 [config_portamento_time_default="${enableval}"],
629 [config_portamento_time_default="1"]
630 )
631 AC_DEFINE_UNQUOTED(CONFIG_PORTAMENTO_TIME_DEFAULT, $config_portamento_time_default, [Define default portamento time.])
632
633 AC_ARG_ENABLE(signed-triang-algo,
634 [ --enable-signed-triang-algo
635 Signed triangular wave algorithm to be used (e.g. for LFOs).
636 Currently available options:
637 intmath:
638 Uses integer math without any branch will then be
639 converted to floating point value for each sample point.
640 This int->float conversion might hurt on some systems.
641 intmathabs:
642 Similar to intmath but uses abs() function.
643 Depending on compiler and platrofm this could
644 perform better than integer math as it avoids
645 an extra integer multiply instruction.
646
647 diharmonic:
648 The triangular wave will be approximated by adding two
649 sinusoidials. This solution might especially hurt on
650 systems with weak floating point unit.
651 benchmark (default):
652 This is not an algorithm. Use this option if the
653 appropriate algorithm should be automatically
654 chosen by the configure script by performing a
655 benchmark between the algorithms mentioned above.
656 This will NOT work for cross compilation!],
657 [ if test ! "(" "${enableval}" = "intmath" \
658 -o "${enableval}" = "intmathabs" \
659 -o "${enableval}" = "diharmonic" ")" ; then
660 AC_MSG_ERROR([Unknown triangular wave algorithm for parameter --enable-signed-triang-algo])
661 else
662 config_signed_triang_algo="${enableval}"
663 fi
664 ],
665 [config_signed_triang_algo="benchmark"]
666 )
667
668 AC_ARG_ENABLE(unsigned-triang-algo,
669 [ --enable-unsigned-triang-algo
670 Unsigned triangular wave algorithm to be used (e.g. for LFOs).
671 Currently available options:
672 intmath:
673 Uses integer math without any branch will then be
674 converted to floating point value for each sample point.
675 This int->float conversion might hurt on some systems.
676 intmathabs:
677 Similar to intmath but uses abs() function.
678 Depending on compiler and platrofm this could
679 perform better than integer math as it avoids
680 an extra integer multiply instruction.
681
682 diharmonic:
683 The triangular wave will be approximated by adding two
684 sinusoidials. This solution might especially hurt on
685 systems with weak floating point unit.
686 benchmark (default):
687 This is not an algorithm. Use this option if the
688 appropriate algorithm should be automatically
689 chosen by the configure script by performing a
690 benchmark between the algorithms mentioned above.
691 This will NOT work for cross compilation!],
692 [ if test ! "(" "${enableval}" = "intmath" \
693 -o "${enableval}" = "intmathabs" \
694 -o "${enableval}" = "diharmonic" ")" ; then
695 AC_MSG_ERROR([Unknown triangular wave algorithm for parameter --enable-unsigned-triang-algo])
696 else
697 config_unsigned_triang_algo="${enableval}"
698 fi
699 ],
700 [config_unsigned_triang_algo="benchmark"]
701 )
702
703 AC_ARG_ENABLE(process-muted-channels,
704 [ --enable-process-muted-channels
705 Enable processing of muted channels (default=no).
706 In that mode all MIDI events in the muted channels
707 will be processed. This will provide information
708 about the active voices in the muted channels and
709 will not discard notes, triggered in mute mode,
710 when the channel is unmuted. But also will reduce
711 the efficiency.],
712 [config_process_muted_channels="yes"],
713 [config_process_muted_channels="no"]
714 )
715 if test "$config_process_muted_channels" = "yes"; then
716 AC_DEFINE_UNQUOTED(CONFIG_PROCESS_MUTED_CHANNELS, 1, [Define to 1 if you want to enable processing of muted channels.])
717 fi
718
719
720 ###########################################################################
721 # Automatic Benchmarks (to detect the best algorithms for the system)
722
723 AC_LANG_SAVE
724
725 if test "$config_signed_triang_algo" = "benchmark"; then
726 echo -n "benchmarking for the best (signed) triangular oscillator algorithm... "
727 AC_LANG_CPLUSPLUS
728 AC_TRY_RUN([
729 #define SIGNED 1
730 #define SILENT 1
731 #include "${srcdir}/benchmarks/triang.cpp"
732 ],
733 triang_signed=0,
734 triang_signed=$?,
735 triang_signed=0
736 )
737 if test "$triang_signed" = "2"; then
738 config_signed_triang_algo="intmath"
739 echo "integer math"
740 elif test "$triang_signed" = "3"; then
741 config_signed_triang_algo="diharmonic"
742 echo "di harmonics"
743 elif test "$triang_signed" = "5"; then
744 config_signed_triang_algo="intmathabs"
745 echo "integer math using abs()"
746 else
747 echo "Benchmark of signed triangular wave algorithms failed!"
748 echo "Maybe you are doing cross compilation? In that case you have to select"
749 echo "an algorithm manually with './configure --enable-signed-triang-algo=...'"
750 echo "Call './configure --help' for further information or read configure.in."
751 exit -1;
752 fi
753 fi
754 AC_DEFINE_UNQUOTED(CONFIG_SIGNED_TRIANG_ALGO, ${triang_signed}, [Define signed triangular wave algorithm to be used.])
755
756 if test "$config_unsigned_triang_algo" = "benchmark"; then
757 echo -n "benchmarking for the best (unsigned) triangular oscillator algorithm... "
758 AC_LANG_CPLUSPLUS
759 AC_TRY_RUN([
760 #define SIGNED 0
761 #define SILENT 1
762 #include "${srcdir}/benchmarks/triang.cpp"
763 ],
764 triang_unsigned=0,
765 triang_unsigned=$?,
766 triang_unsigned=0
767 )
768 if test "$triang_unsigned" = "2"; then
769 config_unsigned_triang_algo="intmath"
770 echo "integer math"
771 elif test "$triang_unsigned" = "3"; then
772 config_unsigned_triang_algo="diharmonic"
773 echo "di harmonics"
774 elif test "$triang_unsigned" = "5"; then
775 config_unsigned_triang_algo="intmathabs"
776 echo "integer math using abs()"
777 else
778 echo "Benchmark of unsigned triangular wave algorithms failed!"
779 echo "Maybe you are doing cross compilation? In that case you have to select"
780 echo "an algorithm manually with './configure --enable-unsigned-triang-algo=...'"
781 echo "Call './configure --help' for further information or read configure.in."
782 exit -1;
783 fi
784 fi
785 AC_DEFINE_UNQUOTED(CONFIG_UNSIGNED_TRIANG_ALGO, ${triang_unsigned}, [Define unsigned triangular wave algorithm to be used.])
786
787 AC_LANG_RESTORE
788
789
790 ###########################################################################
791 # Create Build Files
792
793 AM_CONFIG_HEADER(config.h)
794 AM_INIT_AUTOMAKE(linuxsampler, "$LINUXSAMPLER_RELEASE_MAJOR.$LINUXSAMPLER_RELEASE_MINOR.$LINUXSAMPLER_RELEASE_BUILD")
795
796 AC_LANG_CPLUSPLUS
797 AC_PROG_CXX
798
799 # some gcc 4.0 versions need -msse for SSE register allocations
800 if test "$config_asm" = "yes"; then
801 if test "$def_arch_x86" = 1; then
802 CXXFLAGS="$CXXFLAGS -msse"
803 fi
804 fi
805
806 # autoconf 2.59/libtool 1.5.12 bug? work-around. Without a check like
807 # this, the dlfcn.h check in am_prog_libtool may fail.
808 AC_CHECK_HEADER(stdlib.h)
809
810 AC_OUTPUT( \
811 Makefile \
812 man/Makefile \
813 man/linuxsampler.1 \
814 src/Makefile \
815 src/network/Makefile \
816 src/engines/Makefile \
817 src/engines/gig/Makefile \
818 src/engines/common/Makefile \
819 src/common/Makefile src/lib/Makefile \
820 src/lib/fileloader/Makefile \
821 src/lib/fileloader/libgig/Makefile \
822 src/testcases/Makefile \
823 src/drivers/Makefile \
824 src/drivers/audio/Makefile \
825 src/drivers/midi/Makefile \
826 linuxsampler.spec \
827 debian/Makefile \
828 Artwork/Makefile \
829 scripts/Makefile \
830 osx/Makefile \
831 osx/LinuxSampler.xcode/Makefile \
832 Documentation/Makefile \
833 Documentation/Engines/Makefile \
834 Documentation/Engines/gig/Makefile \
835 linuxsampler.pc \
836 Doxyfile \
837 )
838
839
840 ###########################################################################
841 # Output All Configuration Options
842
843 echo ""
844 echo "#####################################################################"
845 echo "# LinuxSampler Configuration #"
846 echo "#-------------------------------------------------------------------#"
847 echo "# Assembly Optimizations: ${config_asm}"
848 echo "# Development Mode: ${config_dev_mode}"
849 echo "# Debug Level: ${config_debug_level}"
850 echo "# Use Exceptions in RT Context: ${config_rt_exceptions}"
851 echo "# Preload Samples: ${config_preload_samples}"
852 echo "# Maximum Pitch: ${config_max_pitch} (octaves)"
853 echo "# Maximum Events: ${config_max_events}"
854 echo "# Envelope Bottom Level: ${config_eg_bottom} (linear)"
855 echo "# Envelope Minimum Release Time: ${config_eg_min_release_time} s"
856 echo "# Streams to be refilled per Disk Thread Cycle: ${config_refill_streams}"
857 echo "# Minimum Stream Refill Size: ${config_stream_min_refill}"
858 echo "# Maximum Stream Refill Size: ${config_stream_max_refill}"
859 echo "# Stream Size: ${config_stream_size}"
860 echo "# Maximum Disk Streams: ${config_max_streams}"
861 echo "# Maximum Voices: ${config_max_voices}"
862 echo "# Default Subfragment Size: ${config_subfragment_size}"
863 echo "# Global Volume Attenuation: ${config_global_attenuation}"
864 echo "# Voice Stealing Algorithm: ${config_voice_steal_algo}"
865 echo "# Signed Triangular Oscillator Algorithm: ${config_signed_triang_algo}"
866 echo "# Unsigned Triangular Oscillator Algorithm: ${config_unsigned_triang_algo}"
867 echo "# SysEx Buffer Size: ${config_sysex_buffer_size} Byte"
868 echo "# Min. Portamento Time: ${config_portamento_time_min} s"
869 echo "# Max. Portamento Time: ${config_portamento_time_max} s"
870 echo "# Default Portamento Time: ${config_portamento_time_default} s"
871 echo "# Force Filter Usage: ${config_force_filter}"
872 echo "# Filter Cutoff Minimum: ${config_filter_cutoff_min} Hz"
873 echo "# Filter Cutoff Maximum: ${config_filter_cutoff_max} Hz"
874 echo "# Override Filter Cutoff Controller: ${config_override_cutoff_ctrl}"
875 echo "# Override Filter Resonance Controller: ${config_override_resonance_ctrl}"
876 echo "# Override Filter Type: ${config_override_filter_type}"
877 echo "# Assert GS SysEx Checksum: ${config_assert_gs_sysex_checksum}"
878 echo "# Process Muted Channels: ${config_process_muted_channels}"
879 echo "#-------------------------------------------------------------------#"
880 echo "# Read './configure --help' or file 'configure.in' for details. #"
881 echo "#####################################################################"
882 echo ""
883 echo "Good. Now type 'make' to compile, followed by 'make install' as root."
884 echo ""

  ViewVC Help
Powered by ViewVC