--- configure.in.in	6 May 2003 16:58:33 -0000	1.1.1.8
+++ configure.in.in	6 May 2003 17:00:12 -0000	1.25
@@ -57,7 +57,7 @@
 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 sys/soundcard.h fam.h)
+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 sys/soundcard.h sys/syscall.h fam.h)
 
 dnl Checks for libraries.
 AC_BASE_PATH_KDE([don't test]) dnl arts is a special case
@@ -183,6 +183,35 @@
   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="$LDFLAGS -lesd"
+     AC_DEFINE(HAVE_LIBESD, 1,
+        [Define if you have libesd (required if you want EsounD support)])
+   ])
+  fi
+  AC_SUBST(LIBESD)
+  AC_LANG_RESTORE
+  CPPFLAGS="$ac_CPPFLAGS_save"
+  LDFLAGS="$ac_ldflags_save"
+])
+
 dnl libaudiofile is used for loading wave files
 AC_DEFUN([AC_CHECK_LIBAUDIOFILE],
 [
@@ -283,6 +312,19 @@
 fi
 ])
 
+dnl needed for mach realtime scheduling
+AC_DEFUN([AC_CHECK_MACH_REALTIME_SCHED],
+[
+  AC_CHECK_HEADERS([mach/mach.h mach/thread_policy.h sys/param.h sys/sysctl.h],
+    [AC_CHECK_FUNCS(thread_policy_set,
+      arts_mach_realtime_sched=yes,
+      arts_mach_realtime_sched=no)]
+  )
+  if test "x$arts_mach_realtime_sched" = "xyes"; then
+    AC_DEFINE(HAVE_MACH_REALTIME_SCHED,1, [Define if your system supports mach 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
@@ -430,9 +472,11 @@
 dnl call the tests
 AC_CHECK_LIBAUDIOIO
 AC_CHECK_LIBAUDIONAS
+AC_CHECK_LIBESD
 AC_CHECK_LIBAUDIOFILE
 AC_CHECK_SGILIBAUDIO
 AC_CHECK_REALTIME_SCHED
+AC_CHECK_MACH_REALTIME_SCHED
 AC_CHECK_GETDOMAINNAME
 AC_CHECK_IOCTL_TYPE
 AC_CHECK_X86_FLOAT_INT
@@ -605,6 +649,27 @@
 AC_CHECK_HEADERS(soundcard.h)
 AC_CHECK_LIB(ossaudio, _oss_ioctl, [LIBOSSAUDIO="-lossaudio"])
 AC_SUBST(LIBOSSAUDIO)
+
+dnl MacOSX has a similar library called liboss
+dnl AC_MSG_CHECKING([for liboss])
+dnl 
+dnl LIBOSS_CFLAGS=
+dnl LIBOSS_LIBADD=
+dnl LIBOSS_LDFLAGS=
+dnl 
+dnl if test "x$PKG_CONFIG" != "xno" && test x`$PKG_CONFIG --modversion liboss 2>/dev/null` != x; then
+dnl   LIBOSS_CFLAGS=""
+dnl   LIBOSS_LIBADD="`$PKG_CONFIG --libs-only-l liboss`"
+dnl   LIBOSS_LDFLAGS="`$PKG_CONFIG --libs-only-L liboss`"
+dnl   AC_DEFINE(HAVE_LIBOSS,1,[Define if you have the liboss compatibility library])
+dnl   AC_MSG_RESULT(yes)
+dnl else
+dnl   AC_MSG_RESULT(not installed)
+dnl fi
+dnl 
+dnl AC_SUBST(LIBOSS_CFLAGS)
+dnl AC_SUBST(LIBOSS_LIBADD)
+dnl AC_SUBST(LIBOSS_LDFLAGS)
 
 dnl Don't remove !
 dnl AC_OUTPUT(artsc/artsc-config)
