--- linuxsampler/trunk/configure.in 2004/02/16 19:30:42 33 +++ linuxsampler/trunk/configure.in 2004/10/19 00:36:34 288 @@ -2,6 +2,13 @@ AC_C_BIGENDIAN AC_CANONICAL_SYSTEM +AC_SUBST(target) +AC_SUBST(target_alias) +AC_SUBST(target_cpu) +AC_SUBST(target_os) +AC_SUBST(target_vendor) + + echo -n "checking whether x86 architecture... " def_arch_x86=0 @@ -15,6 +22,44 @@ AC_DEFINE_UNQUOTED(ARCH_X86,$def_arch_x86,[Define to 1 if you build for x86 architecture.]) +AC_MSG_CHECKING([whether UNIX98 compatible]) +AC_LANG_SAVE +AC_LANG_C +AC_TRY_RUN([ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif +#include +void main(void) { +#if _XOPEN_SOURCE >= 500 +exit(0); /* UNIX98 compatible */ +#else +exit(-1); /* not UNIX98 compatible */ +#endif +} +], +have_unix98="yes", +have_unix98="no", +have_unix98="no" +) +AC_LANG_RESTORE +AC_MSG_RESULT([$have_unix98]) +if test "$have_unix98" = "no"; then + if test "x$HAVE_UNIX98" = "x"; then + echo "LinuxSampler only runs on UNIX98 compatible systems, which is mandatory for" + echo "pthread_mutexattr_settype() call in Mutex.cpp. You may want to run + echo "./configure with environment variable HAVE_UNIX98=1 in case you think you + echo "have a UNIX98 compatible system." + exit -1; + fi +fi + + +# Checks for available audio and MIDI systems / drivers +# (we throw an error if there's not at least one system for audio output and MIDI input available) +have_midi_input_driver="false" +have_audio_output_driver="false" + AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true" @@ -24,11 +69,12 @@ , have_alsa="false" ) -if test "$have_alsa" = "false"; then - echo "Alsa not installed!" - echo "Sorry, LinuxSampler only supports Alsa sound drivers at the moment!" - exit -1; +if test "$have_alsa" = "true"; then + have_midi_input_driver="true" + have_audio_output_driver="true"; fi +AM_CONDITIONAL(HAVE_ALSA, test $have_alsa = "true") +AC_DEFINE_UNQUOTED(HAVE_ALSA,$have_alsa,[Define to 1 if you have ALSA installed.]) echo -n "checking Alsa version... " @@ -90,16 +136,30 @@ if test $HAVE_JACK = false; then HAVE_JACK=0; else - HAVE_JACK=1; + HAVE_JACK=1 + have_audio_output_driver="true"; fi +AM_CONDITIONAL(HAVE_JACK, test $HAVE_JACK = 1) AC_DEFINE_UNQUOTED(HAVE_JACK,$HAVE_JACK,[Define to 1 if you have JACK installed.]) +if test "$have_midi_input_driver=" = "false"; then + echo "No supported MIDI input system found!" + echo "Sorry, LinuxSampler only supports ALSA as MIDI input driver at the moment!" + exit -1; +fi +if test "$have_audio_output_driver=" = "false"; then + echo "No supported audio output system found!" + echo "Sorry, LinuxSampler only supports ALSA and JACK as audio output driver at the moment!" + exit -1; +fi + + AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(linuxsampler, 0.1) +AM_INIT_AUTOMAKE(linuxsampler, 0.2) AC_LANG_CPLUSPLUS AC_PROG_CXX AM_PROG_LIBTOOL -AC_OUTPUT(Makefile src/Makefile) +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)