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

Legend:
Removed from v.31  
changed lines
  Added in v.2787

  ViewVC Help
Powered by ViewVC