Files
stk/configure.ac
Gary Scavone d199342e86 Version 4.3.1
2013-09-29 23:07:08 +02:00

175 lines
6.4 KiB
Plaintext

# Process this file with autoconf to produce a configure script.
AC_INIT(STK, 4.3, gary@music.mcgill.ca, stk)
AC_CONFIG_SRCDIR(src/Stk.cpp)
AC_CONFIG_FILES(src/Makefile projects/demo/Makefile projects/effects/Makefile projects/ragamatic/Makefile projects/examples/Makefile projects/examples/libMakefile)
# Fill GXX with something before test.
AC_SUBST( GXX, ["no"] )
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX(g++ CC c++ cxx)
AC_PROG_CXX
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h termio.h unistd.h)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_C_BIGENDIAN
AC_EGREP_CPP(yes,
[#ifndef WORDS_BIGENDIAN
yes
#endif
], [AC_SUBST( byte_order, [-D__LITTLE_ENDIAN__] )] )
AC_MSG_CHECKING(for RAWWAVE_PATH argument)
AC_SUBST( rawwaves, $RAWWAVE_PATH )
AC_MSG_RESULT($RAWWAVE_PATH)
AC_MSG_CHECKING(for INCLUDE_PATH argument)
AC_SUBST( include, $INCLUDE_PATH )
AC_MSG_RESULT($INCLUDE_PATH)
# Check for realtime support disable
AC_MSG_CHECKING(whether to compile realtime support)
AC_ARG_ENABLE(realtime, [ --disable-realtime = only compile generic non-realtime classes], [AC_SUBST( realtime, [no] ) AC_SUBST( sound_api, [] )], [AC_SUBST( realtime, [yes] ) ] )
AC_MSG_RESULT($realtime)
# Check for math library
AC_CHECK_LIB(m, cos, , AC_MSG_ERROR(math library is needed!))
# Checks for functions
if test $realtime = yes; then
AC_CHECK_FUNCS(select socket)
AC_CHECK_FUNC(gettimeofday, [cflags=$cflags" -DHAVE_GETTIMEOFDAY"], )
fi
# Check for debug
AC_MSG_CHECKING(whether to compile debug version)
AC_ARG_ENABLE(debug,
[ --enable-debug = enable various debug output],
[AC_SUBST( debug, ["-D_STK_DEBUG_ -D__RTAUDIO_DEBUG__"] ) AC_SUBST( cflags, ["-g -O2"] ) AC_SUBST( object_path, [Debug] ) AC_MSG_RESULT(yes)],
[AC_SUBST( debug, [] ) AC_SUBST( cflags, [-O3] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)])
# Check compiler and use -Wall if gnu.
if test $GXX = "yes" ; then
AC_SUBST( warn, ["-Wall -g -D__GXX__"] )
fi
if test $realtime = yes; then
# Checks for package options and external software
AC_CANONICAL_HOST
AC_MSG_CHECKING(for audio API)
case $host in
*-*-linux*)
AC_SUBST( sound_api, [_NO_API_] )
# Look for ALSA library because we need it for RtMidi
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(STK in Linux requires the ALSA asound library for RtMidi!))
audio_apis="-D__LINUX_ALSASEQ__"
# Look for Jack flag
AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (linux only)], [AC_SUBST( sound_api, [-D__UNIX_JACK__] ) AC_MSG_RESULT(using JACK)] , )
if [test $sound_api = -D__UNIX_JACK__;] then
TEMP_LIBS=$LIBS
AC_CHECK_LIB(jack, jack_client_new, , AC_MSG_ERROR(JACK support requires the jack library!))
LIBS="`pkg-config --cflags --libs jack` $TEMP_LIBS -lasound"
audio_apis="-D__UNIX_JACK__ $audio_apis"
fi
# Look for Alsa flag
AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_ALSA__] ) AC_MSG_RESULT(using ALSA)], )
if test $sound_api = -D__LINUX_ALSA__; then
audio_apis="-D__LINUX_ALSA__ $audio_apis"
fi
# Look for OSS flag
AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_OSS__] ) AC_MSG_RESULT(using OSS)], )
if test $sound_api = -D__LINUX_OSS__; then
audio_apis="-D__LINUX_OSS__ $audio_apis"
fi
# If no audio api flags specified, use ALSA
if [test $sound_api = _NO_API_;] then
AC_MSG_RESULT(using ALSA)
audio_apis="-D__LINUX_ALSA__ $audio_apis"
fi
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(realtime support requires the pthread library!))
;;
*-apple*)
AC_SUBST( sound_api, [_NO_API_] )
# Look for JACK flag
AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (unix only)], [AC_SUBST( sound_api, [-D__UNIX_JACK__] ) AC_MSG_RESULT(using JACK)], )
if [test $sound_api = -D__UNIX_JACK__;] then
AC_CHECK_LIB(jack, jack_client_new, , AC_MSG_ERROR(JACK support requires the jack library!))
audio_apis="-D__UNIX_JACK__"
fi
# Look for Core flag
AC_ARG_WITH(core, [ --with-core = choose CoreAudio API support (mac only)], [AC_SUBST( sound_api, [-D__MACOSX_CORE__] ) AC_MSG_RESULT(using CoreAudio)], )
if test $sound_api = -D__MACOSX_CORE__; then
AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [], [AC_MSG_ERROR(CoreAudio header files not found!)] )
AC_SUBST( frameworks, ["-framework CoreAudio -framework CoreFoundation -framework CoreMidi"] )
audio_apis="-D__MACOSX_CORE__ $audio_apis"
fi
# If no audio api flags specified, use CoreAudio
if [test $sound_api = _NO_API_;] then
AC_SUBST( sound_api, [-D__MACOSX_CORE__] )
AC_MSG_RESULT(using CoreAudio)
AC_CHECK_HEADER(CoreAudio/CoreAudio.h,
[AC_SUBST( audio_apis, [-D__MACOSX_CORE__] )],
[AC_MSG_ERROR(CoreAudio header files not found!)] )
AC_SUBST( frameworks, ["-framework CoreAudio -framework CoreFoundation -framework CoreMidi"] )
fi
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(realtime support requires the pthread library!))
;;
*-mingw32*)
AC_SUBST( sound_api, [_NO_API_] )
AC_ARG_WITH(asio, [ --with-asio = choose ASIO API support (windoze only)], [AC_SUBST( sound_api, [-D__WINDOWS_ASIO__] ) AC_MSG_RESULT(using ASIO)], )
if [test $sound_api = -D__WINDOWS_ASIO__;] then
audio_apis="-D__WINDOWS_ASIO__"
AC_SUBST( objects, ["asio.o asiodrivers.o asiolist.o iasiothiscallresolver.o"] )
fi
# Look for DirectSound flag
AC_ARG_WITH(ds, [ --with-ds = choose DirectSound API support (windoze only)], [AC_SUBST( sound_api, [-D__WINDOWS_DS__] ) AC_MSG_RESULT(using DirectSound)], )
if test $sound_api = -D__WINDOWS_DS__; then
audio_apis="-D__WINDOWS_DS__ $audio_apis"
LIBS="-ldsound $LIBS"
fi
# If no audio api flags specified, use DirectSound
if [test $sound_api = _NO_API_;] then
AC_SUBST( sound_api, [-D__WINDOWS_DS__] )
AC_MSG_RESULT(using DirectSound)
audio_apis="-D__WINDOWS_DS__"
LIBS="-ldsound $LIBS"
fi
audio_apis="-D__WINDOWS_MM__ $audio_apis"
LIBS="-lole32 -lwinmm -lWsock32 $LIBS"
;;
*)
# Default case for unknown realtime systems.
AC_MSG_ERROR(Unknown system type for realtime support ... try --disable-realtime argument!)
;;
esac
fi
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_CHECK_FUNCS(strstr)
AC_OUTPUT