AC_PREREQ(2.52)

AC_INIT(magicdev, 1.1.6,
	http://bugzilla.gnome.org/enter_bug.cgi?product=magicdev)
AC_CONFIG_SRCDIR(daemon.c)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)

AC_PROG_INTLTOOL

AC_PROG_CC

changequote(,)dnl
if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  *[\ \	]-Wall[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wall" ;;
  esac
fi
changequote([,])dnl

AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, AC_PACKAGE_NAME, [foo])
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)

PKG_CHECK_MODULES(MAGICDEV, libgnomeui-2.0)
AC_SUBST(MAGICDEV_CFLAGS)
AC_SUBST(MAGICDEV_LIBS)

PKG_CHECK_MODULES(CAPPLET, libgnomeui-2.0 >= 2.1.5 libglade-2.0)
AC_SUBST(CAPPLET_CFLAGS)
AC_SUBST(CAPPLET_LIBS)

PKG_CHECK_MODULES(MAGICPLUG, gtk+-2.0 libglade-2.0 gconf-2.0)
AC_SUBST(MAGICPLUG_CFLAGS)
AC_SUBST(MAGICPLUG_LIBS)


AC_PATH_PROG(GCONFTOOL, gconftool-2)
AM_GCONF_SOURCE_2

dnl Initialize gettext
ALL_LINGUAS="am az be bn ca cs da de el es fi fr gl he hr hu id it ja lv ml mn ms nl nn no pl pt pt_BR ro ru sk sl sq sr sr@Latn sv tr uk vi wa zh_CN zh_TW"
AM_GLIB_GNU_GETTEXT

AC_CHECK_FUNCS(getline flockfile)

AC_OUTPUT([
Makefile
magicdev.spec
po/Makefile.in
])
