You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arts/configure.in.in

852 lines
22 KiB

# Original Author was Kalle@kde.org
# I lifted it in some mater. (Stephan Kulow)
# I used much code from Janos Farkas
dnl Process this file with autoconf to produce a configure script.
AC_INIT(acinclude.m4) dnl a source file from your sub dir
dnl This is so we can use kde-common
AC_CONFIG_AUX_DIR(admin)
dnl right now: install aRts in the same prefix as KDE3.x currently
KDE_SET_PREFIX_CORE
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
dnl Version (we /might/ want to use libtool versioning, too)
ARTS_MAJOR_VERSION=1
ARTS_MINOR_VERSION=5
ARTS_MICRO_VERSION=10
ARTS_VERSION=$ARTS_MAJOR_VERSION.$ARTS_MINOR_VERSION.$ARTS_MICRO_VERSION
dnl Automake doc recommends to do this only here. (Janos)
AM_INIT_AUTOMAKE(arts, $ARTS_VERSION) dnl searches for some needed programs
AC_PROG_INSTALL
dnl generate the config header
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
dnl Checks for programs.
AC_CHECK_COMPILERS
AC_LIBLTDL_CONVENIENCE
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
KDE_PROG_LIBTOOL
AC_LANG_SAVE
AC_LANG_C
KDE_LIB_LTDL
AC_LANG_RESTORE
# this checks for --with-extra-libs
KDE_CHECK_EXTRA_LIBS
KDE_MISC_TESTS
dnl KDE_CHECK_LIBDL
dnl AC_PROG_LIBTOOL
KDE_CHECK_QT_DIRECT
KDE_ENABLE_HIDDEN_VISIBILITY
dnl for NLS support. Call them in this order!
dnl WITH_NLS is for the po files, GNU_GETTEXT for the sources
dnl AM_KDE_WITH_NLS
dnl AM_KDE_GNU_GETTEXT
dnl Checks for header files.
KDE_CHECK_STL
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/cdefs.h fnmatch.h sysent.h strings.h sys/stat.h sys/select.h sys/socket.h linux/socket.h socketbits.h sigaction.h paths.h malloc.h monetary.h sys/param.h limits.h sys/mnttab.h mntent.h fstab.h)
KDE_CHECK_HEADERS(sys/soundcard.h)
dnl Checks for libraries.
AC_BASE_PATH_KDE([don't test]) dnl arts is a special case
AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for FreeBSD
AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(rt, sem_init, [LIBSEM="-lrt"]))
AM_CONDITIONAL(HAVE_LIBJPEG, test -n "$LIBJPEG" )
AM_CONDITIONAL(HAVE_LIBPNG, test -n "$LIBPNG" )
AM_CONDITIONAL(HAVE_LIBTIFF, test -n "$LIBTIFF")
# configure would do this very late. Too late for us!
test "x$prefix" = xNONE && prefix=$ac_default_prefix
AC_DEFINE_UNQUOTED(KDEDIR, "$prefix", [The prefix to use as fallback])
ac_cpp_safe=$ac_cpp
ac_cpp='$CXXCPP $CPPFLAGS $X_INCLUDES'
KDE_CHECK_HEADERS(X11/ICE/ICElib.h)
ac_cpp=$ac_cpp_safe
dnl Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_TIME
AC_C_BIGENDIAN
dnl check if the compiler has bool
AC_CHECK_BOOL
dnl AC_CHECK_GNU_EXTENSIONS
dnl Checks for library functions.
AC_CHECK_FUNCS(socket snprintf vsnprintf seteuid setegid random strfmon stpcpy mkstemp setmntent gettimeofday vasprintf)
AC_FUNC_VFORK
AC_CHECK_USLEEP
AC_CHECK_SETENV
AC_CHECK_GETHOSTNAME
AC_CHECK_RANDOM
AC_CHECK_S_ISSOCK
AC_CHECK_SOCKLEN_T
dnl output files
AC_SUBST(x_includes)
AC_SUBST(x_libraries)
AC_SUBST(LIBSOCKET)
AC_SUBST(LIBCOMPAT)
AC_SUBST(LIBUTIL)
AC_SUBST(LIBSEM)
AC_SUBST(LIBICE)
all_includes="$all_includes $INCLTDL"
AC_SUBST(all_includes)
AC_SUBST(EXTRA_SUBDIRS)
topdir=`cd $srcdir && pwd`
ac_configure_args="$ac_configure_args --with-auxdir=$topdir/admin"
CXXFLAGS="$CXXFLAGS $USE_RTTI"
dnl----------------------------------------------------------------------------
dnl aRts specific configure tests
dnl
dnl Check for libaudioio (which can be used to get solaris audio support)
AC_DEFUN([AC_CHECK_LIBAUDIOIO],
[
ac_ldflags_save="$LDFLAGS"
ac_CPPFLAGS_save="$CPPFLAGS"
LDFLAGS="$all_libraries $LDFLAGS"
CPPFLAGS="$CPPFLAGS $all_includes"
arts_libaudioio_found=no
AC_LANG_SAVE
AC_LANG_C
kde_have_libaudioio=no
AC_CHECK_HEADER(libaudioio.h,
[
kde_have_libaudioio=yes
])
if test "x$kde_have_libaudioio" = "xyes"; then
AC_CHECK_LIB(audioio,AudioIOGetVersion,[
dnl LDFLAGS in case it's in KDEDIR/lib
LIBAUDIOIO="$LDFLAGS -laudioio"
AC_DEFINE(HAVE_LIBAUDIOIO, 1,
[Define if you have libaudioIO (required if you want to have libaudioio support)])
arts_libaudioio_found=yes
])
fi
AC_SUBST(LIBAUDIOIO)
AC_LANG_RESTORE
CPPFLAGS="$ac_CPPFLAGS_save"
LDFLAGS="$ac_ldflags_save"
])
dnl aRts specific configure tests
dnl
dnl Check for libaudio (which can be used to get network audio support)
AC_DEFUN([AC_CHECK_LIBAUDIONAS],
[
ac_ldflags_save="$LDFLAGS"
ac_CPPFLAGS_save="$CPPFLAGS"
LDFLAGS="$all_libraries $LDFLAGS"
CPPFLAGS="$CPPFLAGS $all_includes"
AC_LANG_SAVE
AC_LANG_C
arts_libaudionas_include=no
AC_CHECK_HEADER(audio/audiolib.h,
[
arts_libaudionas_include=yes
])
if test "x$arts_libaudionas_include" = "xyes"; then
AC_CHECK_LIB(audio,AuOpenServer,[
dnl LDFLAGS in case it's in KDEDIR/lib
LIBAUDIONAS="-laudio -lXt"
LIBAUDIONAS_LDFLAGS="$LDFLAGS"
AC_DEFINE(HAVE_LIBAUDIONAS, 1,
[Define if you have libaudio (required if you want to have NAS support)])
])
fi
AC_SUBST(LIBAUDIONAS)
AC_SUBST(LIBAUDIONAS_LDFLAGS)
AC_LANG_RESTORE
CPPFLAGS="$ac_CPPFLAGS_save"
LDFLAGS="$ac_ldflags_save"
])
dnl Check for libesd (for EsounD support)
AC_DEFUN([AC_CHECK_LIBESD],
[
ac_ldflags_save="$LDFLAGS"
ac_CPPFLAGS_save="$CPPFLAGS"
LDFLAGS="$all_libraries $LDFLAGS"
CPPFLAGS="$CPPFLAGS $all_includes"
AC_LANG_SAVE
AC_LANG_C
arts_libaudionas_include=no
AC_CHECK_HEADER(esd.h,
[
arts_libesd_include=yes
])
if test "x$arts_libesd_include" = "xyes"; then
AC_CHECK_LIB(esd,esd_open_sound,[
dnl LDFLAGS in case it's in KDEDIR/lib
LIBESD="-lesd"
LIBESD_LDFLAGS="$LDFLAGS"
AC_DEFINE(HAVE_LIBESD, 1,
[Define if you have libesd (required if you want EsounD support)])
])
fi
AC_SUBST(LIBESD)
AC_SUBST(LIBESD_LDFLAGS)
AC_LANG_RESTORE
CPPFLAGS="$ac_CPPFLAGS_save"
LDFLAGS="$ac_ldflags_save"
])
dnl libaudiofile is used for loading wave files
AC_DEFUN([AC_CHECK_LIBAUDIOFILE],
[
ac_ldflags_save="$LDFLAGS"
ac_CPPFLAGS_save="$CPPFLAGS"
LDFLAGS="$all_libraries $LDFLAGS"
CPPFLAGS="$CPPFLAGS $all_includes"
arts_audiolib_found=no
dnl WAV reading
AC_LANG_SAVE
AC_LANG_C
kde_has_audio_lib=no
AC_CHECK_HEADER(audiofile.h,
[
kde_has_audio_lib=yes
])
if test "x$kde_has_audio_lib" = "xyes"; then
KDE_CHECK_LIB(audiofile,afOpenFile,[
dnl LDFLAGS in case it's in KDEDIR/lib
LIBAUDIOFILE="-laudiofile"
LIBAUDIOFILE_LDFLAGS="$LDFLAGS"
AC_DEFINE(HAVE_LIBAUDIOFILE, 1,
[Define if you have libaudiofile (required for playing wavs with aRts)])
arts_audiolib_found=yes
])
fi
AC_SUBST(LIBAUDIOFILE)
AC_SUBST(LIBAUDIOFILE_LDFLAGS)
AC_LANG_RESTORE
CPPFLAGS="$ac_CPPFLAGS_save"
LDFLAGS="$ac_ldflags_save"
])
dnl check if sgi libaudio is present
AC_DEFUN([AC_CHECK_SGILIBAUDIO],
[
ac_ldflags_save="$LDFLAGS"
ac_CPPFLAGS_save="$CPPFLAGS"
LDFLAGS="$all_libraries $LDFLAGS"
CPPFLAGS="$CPPFLAGS $all_includes"
dnl SGI libaudio (required on IRIX)
AC_LANG_SAVE
AC_LANG_C
arts_dmedia_include=no
AC_CHECK_HEADER(dmedia/audio.h,
[
arts_dmedia_include=yes
])
if test "x$arts_dmedia_include" = "xyes"; then
KDE_CHECK_LIB(audio,alOpenPort,[
SGILIBAUDIO="-laudio"
AC_DEFINE(HAVE_SGILIBAUDIO, 1,
[Define if you have libaudio (required for sound i/o on IRIX)])
])
fi
AC_SUBST(SGILIBAUDIO)
AC_LANG_RESTORE
CPPFLAGS="$ac_CPPFLAGS_save"
LDFLAGS="$ac_ldflags_save"
])
dnl check if we want to build MAS support
AC_DEFUN([AC_CHECK_LIBMAS],
[
AC_PATH_PROG(MAS_CONFIG, mas-config, no)
if test "$MAS_CONFIG" != "no"; then
AC_DEFINE(HAVE_LIBMAS, 1,
[Define if you have libmas (required if you want MAS support)])
MAS_CFLAGS="`$MAS_CONFIG --cflags`"
tmp_mas_libs="`$MAS_CONFIG --libs` -lmas_jrtp"
MAS_LDFLAGS="`for i in $tmp_mas_libs; do echo $i; done |grep ^-L`"
MAS_LDFLAGS="$MAS_LDFLAGS `for i in $tmp_mas_libs; do echo $i; done |grep ^-L |sed s/^-L/-R/g`"
LIBMAS="$MAS_LDFLAGS"
for i in $tmp_mas_libs; do LIBMAS="$LIBMAS `echo $i |grep ^-l`"; done
fi
AC_SUBST(MAS_CFLAGS)
AC_SUBST(MAS_LDFLAGS)
AC_SUBST(LIBMAS)
])
dnl Posix realtime scheduling - this is helpful if you want arts to run with
dnl higher priority than everthing else
AC_DEFUN([ARTS_TRY_LINK_POSIX_REALTIME],
[
AC_TRY_LINK([
#include <sched.h>
],
[
sched_getscheduler(0);
],
arts_realtime_sched=yes,
arts_realtime_sched=no)
])
AC_DEFUN([AC_CHECK_REALTIME_SCHED],
[
AC_MSG_CHECKING([for posix realtime scheduling support])
save_LIBS="$LIBS"
LIBPOSIX4=""
ARTS_TRY_LINK_POSIX_REALTIME
if test "x$arts_realtime_sched" = "xno"; then
LIBS="$LIBS -lposix4"
ARTS_TRY_LINK_POSIX_REALTIME
if test "x$arts_realtime_sched" = "xyes"; then
LIBPOSIX4="-lposix4"
fi
fi
LIBS="$save_LIBS"
AC_SUBST(LIBPOSIX4)
AC_MSG_RESULT($arts_realtime_sched)
if test "x$arts_realtime_sched" = "xyes"; then
AC_DEFINE(HAVE_REALTIME_SCHED,1,
[Define if your system supports realtime scheduling])
fi
])
dnl Type of the ioctl function test - after some tries, it seems that this
dnl not required for Linux vs. FreeBSD (for which this test was written), and
dnl that only the Linux documentation claims that it has an "int" as second
dnl argument. But maybe there will pop up systems for which the signature
dnl differs, later.
AC_DEFUN([AC_CHECK_IOCTL_TYPE],
[
AC_MSG_CHECKING([ioctl type])
AC_CACHE_VAL(ac_cv_ioctl_type,
[
AC_LANG_SAVE
AC_LANG_C
AC_TRY_COMPILE(
[
#include <unistd.h>
#include <sys/ioctl.h>
int ioctl(int d, int request,...);
],
[
],
ac_cv_ioctl_type=1)
AC_TRY_COMPILE(
[
#include <unistd.h>
#include <sys/ioctl.h>
int ioctl(int d, unsigned long request,...);
],
[
],
ac_cv_ioctl_type=2)
AC_TRY_COMPILE(
[
#include <unistd.h>
#include <sys/ioctl.h>
int ioctl(int d, unsigned long int request,...);
],
[
],
ac_cv_ioctl_type=3)
AC_LANG_RESTORE
])
AC_MSG_RESULT($ac_cv_ioctl_type)
if test "$ac_cv_ioctl_type" = "1"; then
AC_DEFINE(HAVE_IOCTL_INT_INT_DOTS,1,
[Define if ioctl is declared as int ioctl(int d, int request,...)])
fi
if test "$ac_cv_ioctl_type" = "2"; then
AC_DEFINE(HAVE_IOCTL_INT_ULONG_DOTS,2,
[Define if ioctl is declared as int ioctl(int d, unsigned long request,...)])
fi
if test "$ac_cv_ioctl_type" = "3"; then
AC_DEFINE(HAVE_IOCTL_INT_ULONGINT_DOTS,3,
[Define if ioctl is declared as int ioctl(int d, unsigned long int request,...)])
fi
])
dnl check whether we can do rouding using asm optimization
AC_DEFUN([AC_CHECK_X86_FLOAT_INT],
[
AC_MSG_CHECKING([for x86 float to int conversions])
AC_CACHE_VAL(ac_cv_x86_float_int,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_LINK([
#if defined(__i386__)
static inline long QRound (float inval)
{
long ret;
__asm__ ("fistpl %0" : "=m" (ret) : "t" (inval) : "st");
return ret;
}
#else
error
#endif
],
[
long i = QRound(41.93); /* should be 42 */
],
ac_cv_x86_float_int=yes,
ac_cv_x86_float_int=no)
AC_LANG_RESTORE
])
AC_MSG_RESULT($ac_cv_x86_float_int)
if test "x$ac_cv_x86_float_int" = "xyes"; then
AC_DEFINE(HAVE_X86_FLOAT_INT,1,
[Define if you want to use optimized x86 float to int conversion code])
fi
])
dnl check if the assembler supports SSE instructions
AC_DEFUN([AC_CHECK_X86_SSE],
[
AC_MSG_CHECKING([for x86 SSE instructions])
AC_CACHE_VAL(ac_cv_x86_sse,
[
AC_TRY_COMPILE(,
[
#if defined(__GNUC__) && defined(__i386__)
__asm__("movups %xmm0, (%esp)");
#else
/* IRIX's cc treats #error as a warning, make sure it errors out here */
error Not gcc on x86
#endif
],
ac_cv_x86_sse=yes,
ac_cv_x86_sse=no)
])
AC_MSG_RESULT($ac_cv_x86_sse)
if test "x$ac_cv_x86_sse" = "xyes"; then
AC_DEFINE(HAVE_X86_SSE,1,
[Define if your assembler supports x86 SSE instructions])
fi
])
dnl check whether we should try to emulate stdio fopen/fclose via
dnl glibc facilities (this *really* depends on glibc internals)
AC_DEFUN([AC_CHECK_ARTSDSP_STDIO_EMU],
[
AC_MSG_CHECKING([for stdio emulation in artsdsp])
AC_CACHE_VAL(ac_cv_artsdsp_stdio_emu,
[
AC_LANG_SAVE
AC_LANG_C
AC_TRY_LINK([
#define _GNU_SOURCE
#include <stdio.h>
],
[
cookie_io_functions_t fns = { 0, 0, 0, 0 };
struct fd_cookie *fdc = 0;
FILE *out = fopencookie (fdc,"w", fns);
out->_fileno = 0;
],
ac_cv_artsdsp_stdio_emu=yes,
ac_cv_artsdsp_stdio_emu=no)
])
AC_LANG_RESTORE
AC_MSG_RESULT($ac_cv_artsdsp_stdio_emu)
if test "x$ac_cv_artsdsp_stdio_emu" = "xyes"; then
AC_DEFINE(HAVE_ARTSDSP_STDIO_EMU,1,
[Define if you want to use glibc facilities to emulate stdio accesses in artsdsp])
fi
])
dnl call the tests
AC_ARG_WITH(libaudioio,
[AC_HELP_STRING(--with-libaudioio,
[enable support for libaudioio @<:@default=check@:>@])],
[], with_libaudioio=check)
if test "x$with_libaudioio" != xno; then
AC_CHECK_LIBAUDIOIO
if test "x$with_libaudioio" != xcheck && test -z "$LIBAUDIOIO"; then
AC_MSG_FAILURE([--with-libaudioio was given, but test for libaudioio failed])
fi
fi
AC_ARG_WITH(nas,
[AC_HELP_STRING(--with-nas,
[enable support for NAS @<:@default=check@:>@])],
[], with_nas=check)
if test "x$with_nas" != xno; then
AC_CHECK_LIBAUDIONAS
if test "x$with_nas" != xcheck && test -z "$LIBAUDIONAS"; then
AC_MSG_FAILURE([--with-nas was given, but test for NAS failed])
fi
fi
AC_ARG_WITH(esd,
[AC_HELP_STRING(--with-esd,
[enable support for EsounD @<:@default=check@:>@])],
[], with_esd=check)
if test "x$with_esd" != xno; then
AC_CHECK_LIBESD
if test "x$with_esd" != xcheck && test -z "$LIBESD"; then
AC_MSG_FAILURE([--with-esd was given, but test for EsounD failed])
fi
fi
AC_ARG_WITH(audiofile,
[AC_HELP_STRING(--with-audiofile,
[enable support for audiofile @<:@default=check@:>@])],
[], with_audiofile=check)
if test "x$with_audiofile" != xno; then
AC_CHECK_LIBAUDIOFILE
if test "x$with_audiofile" != xcheck && test -z "$LIBAUDIOFILE"; then
AC_MSG_FAILURE([--with-audiofile was given, but test for audiofile failed])
fi
fi
AM_CONDITIONAL(HAVE_WAVSUPPORT, test -n "$LIBAUDIOFILE")
AC_ARG_WITH(sgilibaudio,
[AC_HELP_STRING(--with-sgilibaudio,
[enable support for SGI libaudio @<:@default=check@:>@])],
[], with_sgilibaudio=check)
if test "x$with_sgilibaudio" != xno; then
AC_CHECK_SGILIBAUDIO
if test "x$with_sgilibaudio" != xcheck && test -z "$SGILIBAUDIO"; then
AC_MSG_FAILURE([--with-sgilibaudio was given, but test for SGI libaudio failed])
fi
fi
AC_ARG_WITH(mas,
[AC_HELP_STRING(--with-mas,
[enable support for MAS @<:@default=check@:>@])],
[], with_mas=check)
if test "x$with_mas" != xno; then
AC_CHECK_LIBMAS
if test "x$with_mas" != xcheck && test -z "$LIBMAS"; then
AC_MSG_FAILURE([--with-mas was given, but test for MAS failed])
fi
fi
AC_CHECK_REALTIME_SCHED
AC_CHECK_GETDOMAINNAME
AC_CHECK_IOCTL_TYPE
AC_CHECK_X86_FLOAT_INT
AC_CHECK_X86_SSE
AC_CHECK_ARTSDSP_STDIO_EMU
KDE_CHECK_THREADING
dnl somewhat more deeply nested template code than gcc understands by default
if test "$GXX" = "yes"; then
KDE_CHECK_COMPILER_FLAG(ftemplate-depth-99,
[
CXXFLAGS="$CXXFLAGS -ftemplate-depth-99"
])
fi
dnl check for ALSA audio support
arts_with_alsa=yes
AC_ARG_WITH(alsa, [ --with-alsa enable aRts ALSA support],
[arts_with_alsa=$withval])
if test "$arts_with_alsa" = "yes"; then
AC_DEFUN([AC_CHECK_LIBASOUND],
[
ac_ldflags_save="$LDFLAGS"
LDFLAGS="$all_libraries $LDFLAGS"
kde_has_asoundlib=no
AC_CHECK_HEADERS([ sys/asoundlib.h alsa/asoundlib.h ],
[
kde_has_asoundlib=yes
])
dnl trial and error version check for ALSA 0.5.x / ALSA 0.9.x
AC_LANG_SAVE
AC_LANG_C
if test "x$kde_has_asoundlib" = "xyes"; then
AC_TRY_COMPILE([
#include "confdefs.h"
#ifdef HAVE_SYS_ASOUNDLIB_H
#include <sys/asoundlib.h>
#endif
#ifdef HAVE_ALSA_ASOUNDLIB_H
#include <alsa/asoundlib.h>
#endif
],[
#if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)
/* we have ALSA 0.9.x */
#else
#error not ALSA 0.9.x
#endif
],
kde_has_alsa_0_9=yes,
kde_has_alsa_0_9=no)
fi
if test "x$kde_has_asoundlib" = "xyes"; then
AC_TRY_COMPILE([
#include "confdefs.h"
#ifdef HAVE_SYS_ASOUNDLIB_H
#include <sys/asoundlib.h>
#endif
#ifdef HAVE_ALSA_ASOUNDLIB_H
#include <alsa/asoundlib.h>
#endif
],[
#if (SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0)
/* we have ALSA 1.x */
#else
#error not ALSA 1.x
#endif
],
kde_has_alsa_1_0=yes,
kde_has_alsa_1_0=no)
fi
if test "x$kde_has_asoundlib" = "xyes"; then
AC_TRY_COMPILE([
#include "confdefs.h"
#ifdef HAVE_SYS_ASOUNDLIB_H
#include <sys/asoundlib.h>
#endif
#ifdef HAVE_ALSA_ASOUNDLIB_H
#include <alsa/asoundlib.h>
#endif
],[
#if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5)
/* we have ALSA 0.5.x */
#else
#error not ALSA 0.5.x
#endif
],
kde_has_alsa_0_5=yes,
kde_has_alsa_0_5=no)
fi
AC_LANG_RESTORE
if test "x$kde_has_asoundlib" = "xyes"; then
AC_CHECK_LIB(asound,snd_seq_create_simple_port,[
if test "x$kde_has_alsa_0_5" = "xyes"; then
LIBASOUND="-lasound"
AC_DEFINE(HAVE_LIBASOUND, 1,
[Define if you have libasound.so.1 (required for ALSA 0.5.x support)])
fi
if test "x$kde_has_alsa_0_9" = "xyes"; then
LIBASOUND="-lasound"
AC_DEFINE(HAVE_LIBASOUND2, 1,
[Define if you have libasound.so.2 (required for ALSA 0.9.x support)])
AC_CHECK_LIB(asound,snd_pcm_resume,[
AC_DEFINE(HAVE_SND_PCM_RESUME, 1,
[Define if libasound has snd_pcm_resume()])])
fi
if test "x$kde_has_alsa_1_0" = "xyes"; then
LIBASOUND="-lasound"
AC_DEFINE(HAVE_LIBASOUND2, 1,
[Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
AC_DEFINE(ALSA_PCM_OLD_SW_PARAMS_API, 1,
[Define if you have alsa 1.x])
AC_DEFINE(ALSA_PCM_OLD_HW_PARAMS_API, 1,
[Define if you have alsa 1.x])
AC_CHECK_LIB(asound,snd_pcm_resume,[
AC_DEFINE(HAVE_SND_PCM_RESUME, 1,
[Define if libasound has snd_pcm_resume()])])
fi
])
fi
AC_SUBST(LIBASOUND)
LDFLAGS="$ac_ldflags_save"
])
AC_CHECK_LIBASOUND
fi
AC_SUBST(LIBASOUND)
dnl check for IRIX audio support
AC_MSG_CHECKING([for IRIX])
if test `uname` = "IRIX" -o `uname` = "IRIX64" ; then
AC_DEFINE(HAVE_IRIX, 1, [Define if you compile under IRIX])
AC_MSG_RESULT("yes")
else
AC_MSG_RESULT("no")
fi
dnl check wether we want to use libcsl style sound I/O
AC_ARG_ENABLE(csl,
[ --enable-csl enable libcsl style sound I/O for aRts],
[arts_want_csl="$enableval"],[arts_want_csl="no"])
if test "$arts_want_csl" = "yes"; then
LIBCSL="-lcsl"
AC_DEFINE(HAVE_LIBCSL, 1,
[Define if you have libcsl (required if you want to have CSL support)])
else
LIBCSL=""
fi
AC_SUBST(LIBCSL)
dnl Check for pkg-config
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "$PKG_CONFIG" = "no"; then
AC_MSG_ERROR([
This package requires pkg-config.
])
fi
dnl Check for Glib-2.0
# GLIB_CFLAGS: cflags for compiling glib dependant sources
# GLIB_LIBADD: glib libraries (-l options)
# GLIB_LDFLAGS: flags containing path to glib libraries (-L options)
GLIB_PACKAGES="gmodule-2.0 gthread-2.0"
GLIB_VERSION="1.3.3"
AC_MSG_CHECKING(for GLib-2.0 (at least $GLIB_VERSION))
if $PKG_CONFIG --atleast-pkgconfig-version 0.15 ; then
if $PKG_CONFIG --atleast-version $GLIB_VERSION $GLIB_PACKAGES >/dev/null 2>&1 ; then
GLIB_CFLAGS="`$PKG_CONFIG --cflags $GLIB_PACKAGES`"
GLIB_LIBADD="`$PKG_CONFIG --libs-only-l --libs-only-other $GLIB_PACKAGES`"
GLIB_LDFLAGS="`$PKG_CONFIG --libs-only-L $GLIB_PACKAGES`"
AC_MSG_RESULT(yes)
fi
else
if $PKG_CONFIG --atleast-version $GLIB_VERSION $GLIB_PACKAGES >/dev/null 2>&1 ; then
GLIB_CFLAGS="`$PKG_CONFIG --cflags $GLIB_PACKAGES`"
GLIB_LIBADD="`$PKG_CONFIG --libs $GLIB_PACKAGES`"
GLIB_LDFLAGS="`$PKG_CONFIG --libs-only-L $GLIB_PACKAGES`"
AC_MSG_RESULT(yes)
AC_MSG_WARN([you may need to run make LDFLAGS=-pthread to compile arts])
fi
fi
if test -z "$GLIB_LIBADD"; then
AC_MSG_RESULT(not installed)
AC_ERROR([
Please install glib-2.0 (see http://www.gtk.org).
])
DO_NOT_COMPILE="$DO_NOT_COMPILE gmcop"
fi
CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS"
CFLAGS="$CFLAGS $GLIB_CFLAGS"
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBADD)
AC_SUBST(GLIB_LDFLAGS)
AC_ARG_WITH(jack,
[AC_HELP_STRING(--with-jack,
[enable support for Jack @<:@default=check@:>@])],
[], with_jack=check)
if test "x$with_jack" != xno; then
AC_MSG_CHECKING(for Jack Audio Connection Kit)
if $PKG_CONFIG --atleast-version 0.90 jack >/dev/null 2>&1 ; then
JACK_CFLAGS="`$PKG_CONFIG --cflags jack`"
JACK_LIBADD="`$PKG_CONFIG --libs-only-l jack`"
JACK_LDFLAGS="`$PKG_CONFIG --libs-only-L jack`"
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LIBJACK, 1,
[Define if you have libjack (required if you want Jack support)])
else
AC_MSG_RESULT(not installed)
fi
AC_SUBST(JACK_CFLAGS)
AC_SUBST(JACK_LIBADD)
AC_SUBST(JACK_LDFLAGS)
if test "x$with_jack" != xcheck && test -z "$JACK_LIBADD"; then
AC_MSG_FAILURE([--with-jack was given, but test for Jack failed])
fi
fi
dnl OpenBSD requires an -lossaudio and soundcard.h to provide OSS audio I/O
AC_CHECK_HEADERS(soundcard.h)
AC_CHECK_LIB(ossaudio, _oss_ioctl, [LIBOSSAUDIO="-lossaudio"])
AC_SUBST(LIBOSSAUDIO)
AM_CONFIG_HEADER(mcop/arts_export.h)
AM_CONFIG_HEADER(artsc/artsc_export.h)
dnl Don't remove !
dnl AC_OUTPUT(artsc/artsc-config)
dnl Check if we are building as part of KDE. Arts can also be built as
dnl a standalone snapshot in which case KDE may not be present and things
dnl that depend on KDE should not be built.
dnl AC_MSG_CHECKING(if building standalone aRts snapshot without KDE)
dnl if test "$DCOPIDL" = ""; then
dnl AC_MSG_RESULT(yes)
dnl ARTS_BUILD_KDE=""
dnl MOC="true"
dnl DCOPIDL="true"
dnl DCOPIDL2CPP="true"
dnl AC_SUBST(MOC)
dnl AC_SUBST(DCOPIDL)
dnl AC_SUBST(DCOPIDL2CPP)
dnl else
dnl AC_MSG_RESULT(no)
dnl if test "x$kde_use_qt_emb" = "xyes"; then
dnl ARTS_BUILD_KDE="qtmcop kde knotify message"
dnl else
dnl ARTS_BUILD_KDE="x11 qtmcop kde knotify message"
dnl fi
dnl fi
dnl AC_SUBST(ARTS_BUILD_KDE)
MCOPIDL='$(top_builddir)/mcopidl/mcopidl'
AC_SUBST(MCOPIDL)
AC_SUBST(ARTS_MAJOR_VERSION)
AC_SUBST(ARTS_MINOR_VERSION)
AC_SUBST(ARTS_MICRO_VERSION)
AC_SUBST(ARTS_VERSION)
dnl Don't remove !
dnl AC_OUTPUT(artsc/artsdsp)
dnl AC_OUTPUT(soundserver/artsversion-new.h)
dnl AC_OUTPUT(flow/gsl/gslconfig.h)