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

Diff of /linuxsampler/trunk/configure.in

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

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

Legend:
Removed from v.379  
changed lines
  Added in v.1742

  ViewVC Help
Powered by ViewVC