AC_INIT(gimpmodule.c)

AM_INIT_AUTOMAKE(pygimp, 1.2)

AC_DISABLE_STATIC
AC_PROG_LIBTOOL

AM_PATH_PYTHON(module)
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])

AM_CHECK_PYMOD(gtk,,,AC_MSG_ERROR([You need the pygtk package to use pygimp]))

AC_PATH_PROG(GIMPTOOL, gimptool, no)

if test "x$GIMPTOOL" = xno; then
  AC_MSG_ERROR([could not find gimptool script])
fi

GIMP_CFLAGS_NOUI=`$GIMPTOOL --cflags-noui`
GIMP_LIBS_NOUI=`$GIMPTOOL --libs-noui`

AC_MSG_CHECKING(where to install gimp plug-ins)
gimp_ver=`$GIMPTOOL --version | cut -d. -f 1-2 `
pluginexecdir=\${libdir}/gimp/$gimp_ver/plug-ins
AC_MSG_RESULT($pluginexecdir)

AC_SUBST(GIMP_CFLAGS_NOUI)
AC_SUBST(GIMP_LIBS_NOUI)
AC_SUBST(pluginexecdir)

AC_OUTPUT(Makefile doc/Makefile plug-ins/Makefile)
