AC_INIT(envy24control.c)
AM_INIT_AUTOMAKE(envy24control, 0.6.0)
AC_PROG_CC
AC_PROG_INSTALL
AC_HEADER_STDC

AC_ARG_WITH(gtk2,
  [  --with-gtk2=yes,no   Build with GTK+2 (default = yes)],
  with_gtk2="$withval", with_gtk2="yes")

if test "$with_gtk2" = "yes"; then

PKG_CHECK_MODULES(ENVY24CONTROL, gtk+-2.0 alsa >= 0.9.0)

else

AM_PATH_GTK(1.0.1)
AM_PATH_ALSA(1.0.0)
ENVY24CONTROL_CFLAGS="$CFLAGS $ALSA_CFLAGS $GTK_CFLAGS"
ENVY24CONTROL_LIBS="$LIBS $ALSA_LIBS $GTK_LIBS"
AC_SUBST(ENVY24CONTROL_CFLAGS)
AC_SUBST(ENVY24CONTROL_LIBS)

fi

AC_OUTPUT(Makefile)
