dnl Process this file with autoconf to produce a configure script.

AC_INIT(configure.in)
AM_CONFIG_HEADER(config.h)

PLUGIN_MAJOR_VERSION=1
PLUGIN_MINOR_VERSION=2
PLUGIN_MICRO_VERSION=0
PLUGIN_VERSION=$PLUGIN_MAJOR_VERSION.$PLUGIN_MINOR_VERSION.$PLUGIN_MICRO_VERSION

VERSION=$PLUGIN_VERSION

PLUGIN_NAME=jgimp-extension

AM_INIT_AUTOMAKE($PLUGIN_NAME, $VERSION)

AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC

ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"

AM_MAINTAINER_MODE

AM_PATH_GTK(1.2.8, ,
            AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?))

AM_PATH_GIMP(1.2.1, ,
            AC_MSG_ERROR(Cannot find GIMP: Is gimptool in path?))

dnl For Debian, all directories must be expressed in terms of prefix
GIMP_PLUGIN_DIR=`gimptool --gimpplugindir | sed -e "s/$( gimptool --prefix | sed 's/\//\\\\\\//g')/\$\{prefix\}/"`

dnl Add the languages which your application supports here.
ALL_LINGUAS="de"
AM_GNU_GETTEXT

LOCALEDIR='${prefix}/${DATADIRNAME}/locale'

DATADIR='${prefix}/${DATADIRNAME}/${PLUGIN_NAME}'

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

CPPFLAGS="$CPPFLAGS -DGTK_DISABLE_COMPAT_H"

AC_SUBST(PLUGIN_MAJOR_VERSION)
AC_SUBST(PLUGIN_MINOR_VERSION)
AC_SUBST(PLUGIN_MICRO_VERSION)
AC_SUBST(PLUGIN_VERSION)

AC_SUBST(PLUGIN_NAME)

AC_SUBST(LOCALEDIR)
AC_SUBST(DATADIR)

dnl JAVA=java

dnl Checks for programs.
AC_JAVA_OPTIONS
AC_CHECK_CLASSPATH
AC_PROG_JAVAC
AC_PROG_JAVAH
AC_PROG_JAVADOC
AC_PROG_JAVA
AC_PROG_PLUGIN_DIR
AC_PROG_JAVA_DIR

AC_JYTHON_OPTIONS


AC_CHECK_PROG(antpath, ant, true, false)
AC_MSG_CHECKING(for ant executable)
if $antpath; then
  AC_MSG_RESULT(yes)
else
  AC_MSG_ERROR([Can't find ant!  You need ant to build this.  See http://ant.apache.org/])
fi


AC_OUTPUT([
Makefile
src/Makefile
intl/Makefile
po/Makefile.in
help/Makefile
help/images/Makefile
help/C/Makefile
])
