dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.am)

AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE(mtpng,0.1)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB

dnl **** Check for Open Sound System ****
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([
	#if defined(HAVE_SYS_SOUNDCARD_H)
		#include <sys/soundcard.h>
	#elif defined(HAVE_MACHINE_SOUNDCARD_H)
		#include <machine/soundcard.h>
	#elif defined(HAVE_SOUNDCARD_H)
		#include <soundcard.h>
	#endif
	],[

/* check for one of the Open Sound System specific SNDCTL_ defines */
#if !defined(SNDCTL_DSP_STEREO)
#error No open sound system
#endif
],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))

if test "$ac_cv_c_opensoundsystem" = "yes"
then
    AC_DEFINE(HAVE_OSS)
fi

dnl Checks for libraries.

dnl Checks for header files.

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.

dnl **** Check for endianness ****

AC_C_BIGENDIAN

AC_OUTPUT(Makefile mtpng/Makefile)
