AC_SUBST(SO_VERSION)
AC_SUBST(api)
AC_SUBST(req)
+AC_SUBST(visibility)
api=""
req=""
+use_asio=""
+
# configure flags
AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable various debug output])])
# Check version number coherency between RtAudio.h and configure.ac
AC_MSG_CHECKING([that version numbers are coherent])
RTAUDIO_VERSION=`sed -n 's/#define RTAUDIO_VERSION "\(.*\)"/\1/p' $srcdir/RtAudio.h`
-AS_IF(
- [test "x$RTAUDIO_VERSION" != "x$PACKAGE_VERSION"],
- [AC_MSG_FAILURE([testing RTAUDIO_VERSION==PACKAGE_VERSION failed, check that RtAudio.h defines RTAUDIO_VERSION as "$PACKAGE_VERSION" or that the first line of configure.ac has been updated.])]
-)
+AS_IF([test "x$RTAUDIO_VERSION" != "x$PACKAGE_VERSION"],[
+ AC_MSG_RESULT([no])
+ AC_MSG_FAILURE([testing RTAUDIO_VERSION==PACKAGE_VERSION failed, check that RtAudio.h defines RTAUDIO_VERSION as "$PACKAGE_VERSION" or that the first line of configure.ac has been updated.])
+ ],[
+ AC_MSG_RESULT([yes])
+])
# Enable some nice automake features if they are available
m4_ifdef([AM_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AS_IF([test "x$CXXFLAGS" = "x" ], [override_cxx=yes], [override_cxx=no])
AS_IF([test "x$CFLAGS" = "x" ], [override_c=yes], [override_c=no])
-dnl Check for pkg-config program, used for configuring some libraries.
-m4_define_default([PKG_PROG_PKG_CONFIG],
-[AC_MSG_CHECKING([pkg-config])
-AC_MSG_RESULT([no])])
-
-PKG_PROG_PKG_CONFIG
-
-dnl If the pkg-config autoconf support isn't installed, define its
-dnl autoconf macro to disable any packages depending on it.
-m4_define_default([PKG_CHECK_MODULES],
-[AC_MSG_CHECKING([$1])
-AC_MSG_RESULT([no])
-$4])
-
-
# Checks for programs.
AC_PROG_CXX(g++ CC c++ cxx)
AM_PROG_AR
])
# Check for debug
-AC_MSG_CHECKING(whether to compile debug version)
+AC_MSG_CHECKING([whether to compile debug version])
debugflags=""
AS_CASE([${enable_debug}],
[ yes ], [
# Checks for package options and external software
AC_CANONICAL_HOST
-AC_MSG_CHECKING(for audio API)
+AC_MSG_CHECKING([for audio API])
AS_IF([test "x$with_jack" = "xyes"], [
- AC_MSG_RESULT(using JACK)
- AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))
+ AC_MSG_RESULT([using JACK])
+ AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR([JACK support requires the jack library!]))
api="$api -D__UNIX_JACK__"
+ req="$req jack"
])
AS_CASE([$host],
[*-*-netbsd*],
AS_IF([test "x$api" = "x"], [
- AC_MSG_RESULT(using OSS)
+ AC_MSG_RESULT([using OSS])
api="$api -D__LINUX_OSS__"
AC_CHECK_LIB(ossaudio, main, , AC_MSG_ERROR([RtAudio requires the ossaudio library]))
- AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
+ AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR([RtAudio requires the pthread library!]))
]),
[*-*-freebsd*],
AS_IF([test "x$api" = "x"], [
- AC_MSG_RESULT(using OSS)
+ AC_MSG_RESULT([using OSS])
api="$api -D__LINUX_OSS__"
AC_CHECK_LIB(ossaudio, main, , AC_MSG_ERROR([RtAudio requires the ossaudio library]))
- AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
+ AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR([RtAudio requires the pthread library!]))
]),
[*-*-linux*], [
# Look for ALSA flag
AS_IF([test "x$with_alsa" = "xyes"], [
- AC_MSG_RESULT(using ALSA)
+ AC_MSG_RESULT([using ALSA])
api="$api -D__LINUX_ALSA__"
req="$req alsa"
- AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))
+ AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR([ALSA support requires the asound library!]))
])
# Look for PULSE flag
AS_IF([test "x$with_pulse" = "xyes"], [
- AC_MSG_RESULT(using PulseAudio)
+ AC_MSG_RESULT([using PulseAudio])
api="$api -D__LINUX_PULSE__"
req="$req libpulse-simple"
- AC_CHECK_LIB(pulse-simple, pa_simple_flush, , AC_MSG_ERROR(PulseAudio support requires the pulse-simple library!))
+ AC_CHECK_LIB(pulse-simple, pa_simple_flush, , AC_MSG_ERROR([PulseAudio support requires the pulse-simple library!]))
])
# Look for OSS flag
AS_IF([test "x$with_oss" = "xyes"], [
- AC_MSG_RESULT(using OSS)
+ AC_MSG_RESULT([using OSS])
api="$api -D__LINUX_OSS__"
])
# If no audio api flags specified, use ALSA
AS_IF([test "x$api" = "x" ], [
- AC_MSG_RESULT(using ALSA)
+ AC_MSG_RESULT([using ALSA])
api="${api} -D__LINUX_ALSA__"
req="${req} alsa"
- AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))
+ AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR([ALSA support requires the asound library!]))
])
- AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
+ AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR([RtAudio requires the pthread library!]))
],
[*-apple*],[
# Look for Core flag
AS_IF([test "x$with_core" = "xyes"], [
- AC_MSG_RESULT(using CoreAudio)
+ AC_MSG_RESULT([using CoreAudio])
api="$api -D__MACOSX_CORE__"
- AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [], [AC_MSG_ERROR(CoreAudio header files not found!)] )
+ AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [], [AC_MSG_ERROR([CoreAudio header files not found!])] )
LIBS="$LIBS -framework CoreAudio -framework CoreFoundation"
])
# If no audio api flags specified, use CoreAudio
AS_IF([test "x$api" = "x" ], [
- AC_MSG_RESULT(using CoreAudio)
+ AC_MSG_RESULT([using CoreAudio])
api="${api} -D__MACOSX_CORE__"
AC_CHECK_HEADER(CoreAudio/CoreAudio.h,
[],
- [AC_MSG_ERROR(CoreAudio header files not found!)] )
+ [AC_MSG_ERROR([CoreAudio header files not found!])] )
LIBS="LIBS -framework CoreAudio -framework CoreFoundation"
])
- AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
+ AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR([RtAudio requires the pthread library!]))
],
[*-mingw32*],[
AS_IF([test "x$with_asio" = "xyes" ], [
- AC_MSG_RESULT(using ASIO)
+ AC_MSG_RESULT([using ASIO])
api="$api -D__WINDOWS_ASIO__"
- AC_SUBST( objects, ["asio.o asiodrivers.o asiolist.o iasiothiscallresolver.o"] )
+ use_asio=yes
+ CPPFLAGS="-I$srcdir/include $CPPFLAGS"
])
# Look for DirectSound flag
AS_IF([test "x$with_ds" = "xyes" ], [
- AC_MSG_RESULT(using DirectSound)
+ AC_MSG_RESULT([using DirectSound])
api="$api -D__WINDOWS_DS__"
LIBS="-ldsound -lwinmm $LIBS"
])
# Look for WASAPI flag
AS_IF([test "x$with_wasapi" = "xyes"], [
- AC_MSG_RESULT(using WASAPI)
+ AC_MSG_RESULT([using WASAPI])
api="$api -D__WINDOWS_WASAPI__"
LIBS="-lwinmm -luuid -lksuser $LIBS"
+ CPPFLAGS="-I$srcdir/include $CPPFLAGS"
])
# If no audio api flags specified, use DS
AS_IF([test "x$api" = "x" ], [
- AC_MSG_RESULT(using DirectSound)
+ AC_MSG_RESULT([using DirectSound])
api="$api -D__WINDOWS_DS__"
LIBS="-ldsound -lwinmm $LIBS"
])
LIBS="-lole32 $LIBS"
],[
+ AC_MSG_RESULT([none])
# Default case for unknown realtime systems.
- AC_MSG_ERROR(Unknown system type for realtime support!)
+ AC_MSG_ERROR([Unknown system type for realtime support!])
]
)
+AM_CONDITIONAL( ASIO, [test "x${use_asio}" = "xyes" ])
+
CPPFLAGS="$CPPFLAGS $api"
AC_OUTPUT