- add -lossaudio if needed, and a check for <soundcard.h>, to configure.in
(run autoconf after this). Note that the check has been altered to break
out of the AC_CHECK_HEADERS after the first match - this is so
<sys/soundcard.h>, if found on NetBSD (a `real' OSS), will not conflict
with the emulated ossaudio.
- check for <soundcard.h> along with the other two in a mutually-exclusive
manner in the various *.c files that need it; change include of
"mmsystem.h" to "multimedia.h" so this logic is all in one place
- change mcicda.c to allow for CD audio manipulation on NetBSD. This
includes:
* changing ioctl() calls to be NON-SPLIT with exactly 3 args; on NetBSD
ossaudio, ioctl() is #defined to be _oss_ioctl by <soundcard.h>, and
neither splitting with #-directives nor a two-arg ioctl work;
* changing the #if logic to allow both FreeBSD and NetBSD to share the
appropriate code blocks
- block out MIDI code for NetBSD (init.c) and/or missing SNDCTL_MIDI_INFO
(midi.c, mcimidi.c). NetBSD's OSS emulation does not (yet) support MIDI.
Thanks go to mycroft@netbsd.org for the 99% bulk of this work.
diff --git a/configure.in b/configure.in
index 6557802..1910639 100644
--- a/configure.in
+++ b/configure.in
@@ -83,6 +83,8 @@
dnl Check for -li386 for NetBSD and OpenBSD
AC_CHECK_LIB(i386,i386_set_ldt)
+dnl Check for -lossaudio for NetBSD
+AC_CHECK_LIB(ossaudio,_oss_ioctl)
dnl Check for -lw for Solaris
AC_CHECK_LIB(w,iswalnum)
dnl Check for -lnsl for Solaris
@@ -115,16 +117,17 @@
fi
dnl **** Check for Open Sound System ****
-AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
+AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
AC_CACHE_CHECK("for Open Sound System",
ac_cv_c_opensoundsystem,
AC_TRY_COMPILE([
- #ifdef HAVE_SYS_SOUNDCARD_H
+ #if defined(HAVE_SYS_SOUNDCARD_H)
#include <sys/soundcard.h>
- #endif
- #ifdef HAVE_MACHINE_SOUNDCARD_H
+ #elif defined(HAVE_MACHINE_SOUNDCARD_H)
#include <machine/soundcard.h>
+ #elif defined(HAVE_SOUNDCARD_H)
+ #include <soundcard.h>
#endif
],[