--- linuxsampler/trunk/configure.in 2005/07/19 15:43:40 697 +++ linuxsampler/trunk/configure.in 2005/07/23 21:55:38 714 @@ -218,6 +218,8 @@ 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) @@ -228,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.]) @@ -579,6 +583,126 @@ 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. + 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}" = "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. + 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}" = "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"] +) + + +########################################################################### +# 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 "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" + 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, signed_triang_algo_${config_signed_triang_algo}, [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 "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" + 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, unsigned_triang_algo_${config_unsigned_triang_algo}, [Define unsigned triangular wave algorithm to be used.]) + +AC_LANG_RESTORE + ########################################################################### # Create Build Files @@ -653,6 +777,8 @@ echo "# Maximum Disk Streams: ${config_max_streams}" echo "# Maximum Voices: ${config_max_voices}" 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}"