dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/Tap.cxx)
AM_INIT_AUTOMAKE(tapiir, 0.7.2)
AM_CONFIG_HEADER(src/config.h)

dnl Checks for programs.
AC_PROG_CXX

dnl Checks for libraries.
AC_CHECK_LIB(pthread,pthread_mutex_init,,AC_MSG_ERROR("missing pthread"))

save_LIBS="$LIBS"
AC_CHECK_LIB(jack,jack_client_new,,AC_MSG_ERROR("missing jack"),-ldl)
JACK_LIBS="$LIBS"
LIBS=$save_LIBS

AC_ARG_WITH(alsa,
[  --without-alsa          Do not use alsa],
[with_alsa=no],
[with_alsa=yes])

if test $with_alsa == yes; then
AM_PATH_ALSA(0.9.0,,AC_MSG_ERROR("missing alsa"))
fi

AM_PATH_FLTK(1.1.0,,AC_MSG_ERROR("missing fltk"))

dnl Checks for header files.
AC_STDC_HEADERS
AC_HAVE_HEADERS(stdio.h string.h stdlib.h getopt.h \
sched.h pthread.h sys/mman.h sys/time.h)

AC_SUBST(JACK_LIBS)

AC_OUTPUT([Makefile src/Makefile doc/Makefile doc/images/Makefile doc/examples/Makefile debian/Makefile])
