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

Contents of /linuxsampler/trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1360 - (show annotations) (download)
Sun Sep 30 20:04:11 2007 UTC (12 years, 1 month ago) by schoenebeck
File size: 43081 byte(s)
* fixed buggy boolean --enable-foo / --disable-foo configure script
  parameters

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

  ViewVC Help
Powered by ViewVC