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

Legend:
Removed from v.80  
changed lines
  Added in v.1649

  ViewVC Help
Powered by ViewVC