dnl configure.ac
dnl
dnl xfce4-screenshooter
dnl

m4_define([xfce4_screenshooter_version_major], [1])
m4_define([xfce4_screenshooter_version_minor], [5])
m4_define([xfce4_screenshooter_version_micro], [0])
m4_define([xfce4_screenshooter_version_nano],  [1]) dnl leave this empty to have no nano version
m4_define([xfce4_screenshooter_version_build], [r@REVISION@])
m4_define([xfce4_screenshooter_version_tag],   [svn])
m4_define([xfce4_screenshooter_version], [xfce4_screenshooter_version_major().xfce4_screenshooter_version_minor().xfce4_screenshooter_version_micro()ifelse(xfce4_screenshooter_version_nano(), [], [], [.xfce4_screenshooter_version_nano()])ifelse(xfce4_screenshooter_version_tag(), [svn], [xfce4_screenshooter_version_tag()-xfce4_screenshooter_version_build()], [xfce4_screenshooter_version_tag()])])

AC_INIT([xfce4-screenshooter], [xfce4_screenshooter_version], [http://bugzilla.xfce.org/], [xfce4-screenshooter])

dnl ***************************
dnl *** Initialize automake ***
dnl ***************************
AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar])
AM_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE()

dnl *******************************
dnl *** Check for UNIX variants ***
dnl *******************************
AC_AIX()
AC_ISC_POSIX()
AC_MINIX()

dnl ********************************
dnl *** Check for basic programs ***
dnl ********************************
AC_PROG_CC()
AC_PROG_CC_C_O()
AC_PROG_LD()
AC_PROG_INSTALL()
AC_PROG_INTLTOOL()

dnl **************************
dnl *** Initialize libtool ***
dnl **************************
AC_DISABLE_STATIC()
AC_PROG_LIBTOOL()

dnl **********************************
dnl *** Check for standard headers ***
dnl **********************************
AC_HEADER_STDC

dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.4.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0])
XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0])
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.12.0])

dnl ***********************************
dnl *** Check for optional packages ***
dnl ***********************************
XDT_CHECK_OPTIONAL_PACKAGE([GIO], [gio-2.0], [2.16])

dnl **************************
dnl *** Check for xsltproc ***
dnl **************************
AC_ARG_ENABLE([xsltproc], [AC_HELP_STRING([--enable-xsltproc], [Use xsltproc to build documentation @<:@default=no@:>@])],, [enable_xsltproc=no])
if test x"$enable_xsltproc" = x"yes"; then
  AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
  if test x"$XSLTPROC" = x"no"; then
    enable_xsltproc=no
  fi
fi
AM_CONDITIONAL([ENABLE_XSLTPROC], [test x"$enable_xsltproc" = x"yes"])

dnl ************************
dnl *** Check for xml2po ***
dnl ************************
AC_ARG_ENABLE([xml2po], [AC_HELP_STRING([--enable-xml2po], [Use xml2po to translate documentation @<:@default=no@:>@])],, [enable_xml2po=no])
if test x"$enable_xml2po" = x"yes"; then
  AC_PATH_PROG([XML2PO], [xml2po], [no])
  if test x"$XML2PO" = x"no"; then
    enable_xml2po=no
  fi
fi
AM_CONDITIONAL([ENABLE_XML2PO], [test x"$enable_xml2po" = x"yes"])


dnl ******************************
dnl *** Check for i18n support ***
dnl ******************************
XDT_I18N([@LINGUAS@])

dnl Check for debugging support
XDT_FEATURE_DEBUG()

AC_OUTPUT([
Makefile
docs/Makefile
docs/manual/Makefile
docs/manual/C/Makefile
docs/manual/C/xfce4-screenshooter.xml
docs/manual/C/images/Makefile
docs/manual/fr/Makefile
docs/manual/fr/xfce4-screenshooter.xml
docs/manual/fr/images/Makefile
icons/Makefile
icons/48x48/Makefile
icons/scalable/Makefile
lib/Makefile
src/Makefile
panel-plugin/Makefile
po/Makefile.in
po-doc/Makefile
])

dnl ***************************
dnl *** Print configuration ***
dnl ***************************

echo ""
echo "Build Configuration:"
echo ""

if test x"$GIO_FOUND" = x"yes"; then
echo "  * Open with support:             yes"
else
echo "  * Open with support:             no"
fi

echo "  * Debugging support:             $enable_debug"

echo ""
echo "Maintainer Configuration:"
echo ""

echo "  * Xml2po enabled:                $enable_xml2po"
echo "  * Xsltproc enabled:              $enable_xsltproc"

echo ""
