--- linuxsampler/trunk/configure.in 2005/06/08 21:00:06 617 +++ linuxsampler/trunk/configure.in 2005/09/26 10:17:00 781 @@ -1,4 +1,39 @@ AC_INIT(configure.in) + +#------------------------------------------------------------------------------------ +# LinuxSampler's / liblinuxsampler's "official" release version: + +LINUXSAMPLER_RELEASE_MAJOR=0 +LINUXSAMPLER_RELEASE_MINOR=3 +LINUXSAMPLER_RELEASE_BUILD=3 + +#------------------------------------------------------------------------------------ +# The following is the libtool / shared library version. This doesn't have to +# do anything with the release version. It MUST conform to the following rules: +# +# 1. Start with version information of `0:0:0' for each libtool library. +# 2. Update the version information only immediately before a public release of +# your software. More frequent updates are unnecessary, and only guarantee +# that the current interface number gets larger faster. +# 3. If the library source code has changed at all since the last update, then +# increment revision (`c:r:a' becomes `c:r+1:a'). +# 4. If any interfaces have been added, removed, or changed since the last update, +# increment current, and set revision to 0. +# 5. If any interfaces have been added since the last public release, then increment +# age. +# 6. If any interfaces have been removed since the last public release, then set age +# to 0. + +LIBLINUXSAMPLER_LT_CURRENT=0 +LIBLINUXSAMPLER_LT_REVISION=0 +LIBLINUXSAMPLER_LT_AGE=0 +SHARED_VERSION_INFO="$LIBLINUXSAMPLER_LT_CURRENT:$LIBLINUXSAMPLER_LT_REVISION:$LIBLINUXSAMPLER_LT_AGE" + +AM_PROG_LIBTOOL + +AC_SUBST(SHLIB_VERSION_ARG) +AC_SUBST(SHARED_VERSION_INFO) + AC_C_BIGENDIAN AC_CANONICAL_SYSTEM @@ -177,12 +212,14 @@ AC_DEFINE_UNQUOTED(HAVE_COREMIDI,$have_coremidi,[Define to 1 if you have CoreMIDI installed.]) # Check presence of libgig -libgig_version="2.0.0" +libgig_version="2.0.2" PKG_CHECK_MODULES(GIG, gig >= $libgig_version, HAVE_GIG=true, HAVE_GIG=false) if test "$HAVE_GIG" = "false"; then echo "Required libgig version not found!" echo "You need to have libgig version ${libgig_version} installed!" exit -1; +else + echo "yes, found libgig $libgig_version" fi AC_SUBST(GIG_CFLAGS) AC_SUBST(GIG_LIBS) @@ -193,8 +230,10 @@ AC_SUBST(SQLITE3_CFLAGS) if test $HAVE_SQLITE3 = false; then HAVE_SQLITE3=0; + echo "no, support for instrument DB will be disabled!" else HAVE_SQLITE3=1 + echo "yes" fi AM_CONDITIONAL(HAVE_SQLITE3, test $HAVE_SQLITE3 = 1) AC_DEFINE_UNQUOTED(HAVE_SQLITE3,$HAVE_SQLITE3,[Define to 1 if you have SQLITE3 installed.]) @@ -220,27 +259,27 @@ # TODO: should we use AC_ARG_VAR(variable, description) instead? AC_ARG_ENABLE(asm, - [ --disable-asm - Disable hand-crafted assembly optimizations - (default=on). LinuxSampler provides CPU specific + [ --enable-asm + Enable hand-crafted assembly optimizations + (default=off). LinuxSampler provides CPU specific assembly optimizations for the most important - synthesis algorithms. You usually don't want to - diable that.], - [config_asm="no"], - [config_asm="yes"] + synthesis algorithms. This is currently disabled + by default since current asm code is broken.], + [config_asm="yes"], + [config_asm="no"] ) if test "$config_asm" = "yes"; then AC_DEFINE_UNQUOTED(CONFIG_ASM, 1, [Define to 1 if you want to enable hand-crafted asm optimizations.]) fi AC_ARG_ENABLE(dev-mode, - [ --enable-dev-mode - Enable development mode (default=no). In that mode + [ --disable-dev-mode + Disable development mode (default=on). In that mode we do some extra sanity checks here and there. This helps to spot possible problems, but reduces efficiency a bit], - [config_dev_mode="yes"], - [config_dev_mode="no"] + [config_dev_mode="no"], + [config_dev_mode="yes"] ) if test "$config_dev_mode" = "yes"; then AC_DEFINE_UNQUOTED(CONFIG_DEVMODE, 1, [Define to 1 if you want to enable development mode.]) @@ -397,6 +436,31 @@ ) AC_DEFINE_UNQUOTED(CONFIG_MAX_VOICES, $config_max_voices, [Define max. voices.]) +AC_ARG_ENABLE(subfragment-size, + [ --enable-subfragment-size + Every audio fragment will be splitted into + subfragments. Where each subfragment renders + audio with constant synthesis parameters. This is + done for efficiency reasons. This parameter + defines the default size of a subfragment in + sample points. A large value means less CPU time + whereas a low value means better audio quality + (default=32).], + [config_subfragment_size="${enableval}"], + [config_subfragment_size="32"] +) +AC_DEFINE_UNQUOTED(CONFIG_DEFAULT_SUBFRAGMENT_SIZE, $config_subfragment_size, [Define default subfragment size (in sample points).]) + +AC_ARG_ENABLE(global-attenuation, + [ --enable-global-attenuation + To prevent clipping all samples will be lowered + in amplitude by this given factor. + (default=0.35)], + [config_global_attenuation="${enableval}"], + [config_global_attenuation="0.35"] +) +AC_DEFINE_UNQUOTED(CONFIG_GLOBAL_ATTENUATION, $config_global_attenuation, [Define global volume attenuation (as floating point factor).]) + AC_ARG_ENABLE(voice-steal-algo, [ --enable-voice-steal-algo Voice stealing algorithm to be used. Currently @@ -430,18 +494,6 @@ ) AC_DEFINE_UNQUOTED(CONFIG_SYSEX_BUFFER_SIZE, $config_sysex_buffer_size, [Define SysEx buffer size.]) -AC_ARG_ENABLE(filter-update-steps, - [ --enable-filter-update-steps - Amount of sample points after which filter - parameters (cutoff, resonance) are going to be - updated (default=64). Higher value means less CPU - load, but also worse parameter resolution, this - value will be aligned to a power of two.], - [config_filter_update_steps="${enableval}"], - [config_filter_update_steps="64"] -) -AC_DEFINE_UNQUOTED(CONFIG_FILTER_UPDATE_STEPS, $config_filter_update_steps, [Define amount of steps to refresh filter coefficients.]) - AC_ARG_ENABLE(force-filter, [ --enable-force-filter If enabled will force filter to be used even if @@ -544,23 +596,211 @@ AC_DEFINE_UNQUOTED(CONFIG_ASSERT_GS_SYSEX_CHECKSUM, 1, [Define to 1 if you want to enable GS SysEx check.]) fi +AC_ARG_ENABLE(signed-triang-algo, + [ --enable-signed-triang-algo + Signed triangular wave algorithm to be used (e.g. for LFOs). + Currently available options: + intmath: + Uses integer math without any branch will then be + converted to floating point value for each sample point. + This int->float conversion might hurt on some systems. + intmathabs: + Similar to intmath but uses abs() function. + Depending on compiler and platrofm this could + perform better than integer math as it avoids + an extra integer multiply instruction. + + diharmonic: + The triangular wave will be approximated by adding two + sinusoidials. This solution might especially hurt on + systems with weak floating point unit. + benchmark (default): + This is not an algorithm. Use this option if the + appropriate algorithm should be automatically + chosen by the configure script by performing a + benchmark between the algorithms mentioned above. + This will NOT work for cross compilation!], + [ if test ! "(" "${enableval}" = "intmath" \ + -o "${enableval}" = "intmathabs" \ + -o "${enableval}" = "diharmonic" ")" ; then + AC_MSG_ERROR([Unknown triangular wave algorithm for parameter --enable-signed-triang-algo]) + else + config_signed_triang_algo="${enableval}" + fi + ], + [config_signed_triang_algo="benchmark"] +) + +AC_ARG_ENABLE(unsigned-triang-algo, + [ --enable-unsigned-triang-algo + Unsigned triangular wave algorithm to be used (e.g. for LFOs). + Currently available options: + intmath: + Uses integer math without any branch will then be + converted to floating point value for each sample point. + This int->float conversion might hurt on some systems. + intmathabs: + Similar to intmath but uses abs() function. + Depending on compiler and platrofm this could + perform better than integer math as it avoids + an extra integer multiply instruction. + + diharmonic: + The triangular wave will be approximated by adding two + sinusoidials. This solution might especially hurt on + systems with weak floating point unit. + benchmark (default): + This is not an algorithm. Use this option if the + appropriate algorithm should be automatically + chosen by the configure script by performing a + benchmark between the algorithms mentioned above. + This will NOT work for cross compilation!], + [ if test ! "(" "${enableval}" = "intmath" \ + -o "${enableval}" = "intmathabs" \ + -o "${enableval}" = "diharmonic" ")" ; then + AC_MSG_ERROR([Unknown triangular wave algorithm for parameter --enable-unsigned-triang-algo]) + else + config_unsigned_triang_algo="${enableval}" + fi + ], + [config_unsigned_triang_algo="benchmark"] +) + +AC_ARG_ENABLE(process-muted-channels, + [ --enable-process-muted-channels + Enable processing of muted channels (default=no). + In that mode all MIDI events in the muted channels + will be processed. This will provide information + about the active voices in the muted channels and + will not discard notes, triggered in mute mode, + when the channel is unmuted. But also will reduce + the efficiency.], + [config_process_muted_channels="yes"], + [config_process_muted_channels="no"] +) +if test "$config_process_muted_channels" = "yes"; then + AC_DEFINE_UNQUOTED(CONFIG_PROCESS_MUTED_CHANNELS, 1, [Define to 1 if you want to enable processing of muted channels.]) +fi + + +########################################################################### +# Automatic Benchmarks (to detect the best algorithms for the system) + +AC_LANG_SAVE + +if test "$config_signed_triang_algo" = "benchmark"; then + echo -n "benchmarking for the best (signed) triangular oscillator algorithm... " + AC_LANG_CPLUSPLUS + AC_TRY_RUN([ + #define SIGNED 1 + #define SILENT 1 + #include "${srcdir}/benchmarks/triang.cpp" + ], + triang_signed=0, + triang_signed=$?, + triang_signed=0 + ) + if test "$triang_signed" = "2"; then + config_signed_triang_algo="intmath" + echo "integer math" + elif test "$triang_signed" = "3"; then + config_signed_triang_algo="diharmonic" + echo "di harmonics" + elif test "$triang_signed" = "5"; then + config_signed_triang_algo="intmathabs" + echo "integer math using abs()" + else + echo "Benchmark of signed triangular wave algorithms failed!" + echo "Maybe you are doing cross compilation? In that case you have to select" + echo "an algorithm manually with './configure --enable-signed-triang-algo=...'" + echo "Call './configure --help' for further information or read configure.in." + exit -1; + fi +fi +AC_DEFINE_UNQUOTED(CONFIG_SIGNED_TRIANG_ALGO, ${triang_signed}, [Define signed triangular wave algorithm to be used.]) + +if test "$config_unsigned_triang_algo" = "benchmark"; then + echo -n "benchmarking for the best (unsigned) triangular oscillator algorithm... " + AC_LANG_CPLUSPLUS + AC_TRY_RUN([ + #define SIGNED 0 + #define SILENT 1 + #include "${srcdir}/benchmarks/triang.cpp" + ], + triang_unsigned=0, + triang_unsigned=$?, + triang_unsigned=0 + ) + if test "$triang_unsigned" = "2"; then + config_unsigned_triang_algo="intmath" + echo "integer math" + elif test "$triang_unsigned" = "3"; then + config_unsigned_triang_algo="diharmonic" + echo "di harmonics" + elif test "$triang_unsigned" = "5"; then + config_unsigned_triang_algo="intmathabs" + echo "integer math using abs()" + else + echo "Benchmark of unsigned triangular wave algorithms failed!" + echo "Maybe you are doing cross compilation? In that case you have to select" + echo "an algorithm manually with './configure --enable-unsigned-triang-algo=...'" + echo "Call './configure --help' for further information or read configure.in." + exit -1; + fi +fi +AC_DEFINE_UNQUOTED(CONFIG_UNSIGNED_TRIANG_ALGO, ${triang_unsigned}, [Define unsigned triangular wave algorithm to be used.]) + +AC_LANG_RESTORE + ########################################################################### # Create Build Files AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(linuxsampler, 0.3.1) +AM_INIT_AUTOMAKE(linuxsampler, "$LINUXSAMPLER_RELEASE_MAJOR.$LINUXSAMPLER_RELEASE_MINOR.$LINUXSAMPLER_RELEASE_BUILD") AC_LANG_CPLUSPLUS AC_PROG_CXX +# some gcc 4.0 versions need -msse for SSE register allocations +if test "$config_asm" = "yes"; then + if test "$def_arch_x86" = 1; then + CXXFLAGS="$CXXFLAGS -msse" + fi +fi + # autoconf 2.59/libtool 1.5.12 bug? work-around. Without a check like # this, the dlfcn.h check in am_prog_libtool may fail. AC_CHECK_HEADER(stdlib.h) -AM_PROG_LIBTOOL - -AC_OUTPUT(Makefile man/Makefile man/linuxsampler.1 src/Makefile src/network/Makefile src/engines/Makefile src/engines/gig/Makefile src/engines/common/Makefile src/common/Makefile src/lib/Makefile src/lib/fileloader/Makefile src/lib/fileloader/libgig/Makefile src/testcases/Makefile src/drivers/Makefile src/drivers/audio/Makefile src/drivers/midi/Makefile) +AC_OUTPUT( \ + Makefile \ + man/Makefile \ + man/linuxsampler.1 \ + src/Makefile \ + src/network/Makefile \ + src/engines/Makefile \ + src/engines/gig/Makefile \ + src/engines/common/Makefile \ + src/common/Makefile src/lib/Makefile \ + src/lib/fileloader/Makefile \ + src/lib/fileloader/libgig/Makefile \ + src/testcases/Makefile \ + src/drivers/Makefile \ + src/drivers/audio/Makefile \ + src/drivers/midi/Makefile \ + linuxsampler.spec \ + debian/Makefile \ + Artwork/Makefile \ + scripts/Makefile \ + osx/Makefile \ + osx/LinuxSampler.xcode/Makefile \ + Documentation/Makefile \ + Documentation/Engines/Makefile \ + Documentation/Engines/gig/Makefile \ + linuxsampler.pc \ + Doxyfile \ +) ########################################################################### @@ -585,9 +825,12 @@ echo "# Stream Size: ${config_stream_size}" echo "# Maximum Disk Streams: ${config_max_streams}" echo "# Maximum Voices: ${config_max_voices}" +echo "# Default Subfragment Size: ${config_subfragment_size}" +echo "# Global Volume Attenuation: ${config_global_attenuation}" echo "# Voice Stealing Algorithm: ${config_voice_steal_algo}" +echo "# Signed Triangular Oscillator Algorithm: ${config_signed_triang_algo}" +echo "# Unsigned Triangular Oscillator Algorithm: ${config_unsigned_triang_algo}" echo "# SysEx Buffer Size: ${config_sysex_buffer_size} Byte" -echo "# Filter Update Steps: ${config_filter_update_steps}" echo "# Force Filter Usage: ${config_force_filter}" echo "# Filter Cutoff Minimum: ${config_filter_cutoff_min} Hz" echo "# Filter Cutoff Maximum: ${config_filter_cutoff_max} Hz" @@ -595,6 +838,7 @@ echo "# Override Filter Resonance Controller: ${config_override_resonance_ctrl}" echo "# Override Filter Type: ${config_override_filter_type}" echo "# Assert GS SysEx Checksum: ${config_assert_gs_sysex_checksum}" +echo "# Process Muted Channels: ${config_process_muted_channels}" echo "#-------------------------------------------------------------------#" echo "# Read './configure --help' or file 'configure.in' for details. #" echo "#####################################################################"