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

Diff of /linuxsampler/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.275  
changed lines
  Added in v.2535

  ViewVC Help
Powered by ViewVC