dnl xfce4-pulseaudio-plugin - A pulseaudio plugin for the Xfce panel
dnl
dnl 2009 Mark Trompell <mark@foresightlinux.org>
dnl

dnl ***************************
dnl *** Version information ***
dnl ***************************
m4_define([pulseaudio_version_major], [0])
m4_define([pulseaudio_version_minor], [1])
m4_define([pulseaudio_version_micro], [0])
m4_define([pulseaudio_version_nano],  []) dnl leave this empty to have no nano version
m4_define([pulseaudio_version_build], [@REVISION@])
m4_define([pulseaudio_version_tag],   [git])
m4_define([pulseaudio_version], [pulseaudio_version_major().pulseaudio_version_minor().pulseaudio_version_micro()ifelse(pulseaudio_version_nano(), [], [], [.pulseaudio_version_nano()])ifelse(pulseaudio_version_tag(), [git], [pulseaudio_version_tag()-pulseaudio_version_build()], [pulseaudio_version_tag()])])

dnl ***************************
dnl *** Initialize autoconf ***
dnl ***************************
AC_COPYRIGHT([Copyright (c) 2014
        The Xfce development team. All rights reserved.])
AC_INIT([xfce4-pulseaudio-plugin], [pulseaudio_version], [http://bugzilla.xfce.org/], [xfce4-pulseaudio-plugin])
AC_PREREQ([2.50])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_TARGET()
AC_REVISION([@REVISION@])

dnl ***************************
dnl *** Initialize automake ***
dnl ***************************
AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar])
AM_MAINTAINER_MODE()
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

dnl ********************************
dnl *** Check for basic programs ***
dnl ********************************
AC_PROG_CC()
AC_PROG_LD()
AC_PROG_INSTALL()
AC_PROG_INTLTOOL()
LT_PREREQ([2.2.6])
LT_INIT([disable-static])

dnl **************************
dnl *** Initialize libtool ***
dnl **************************
LT_PREREQ([2.2.6])
LT_INIT([disable-static])

dnl **********************************
dnl *** Check for standard headers ***
dnl **********************************
AC_CHECK_HEADERS([math.h memory.h stdlib.h string.h sys/stat.h \
                  sys/time.h time.h])

dnl ************************************
dnl *** Check for standard functions ***
dnl ************************************
AC_CHECK_FUNCS([])

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

dnl *******************************
dnl *** Check for X11 installed ***
dnl *******************************
XDT_CHECK_LIBX11_REQUIRE()

dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
m4_define([libxfce4panel_version_api], [2.0])
LIBXFCE4PANEL_VERSION_API=libxfce4panel_version_api()
AC_DEFINE([LIBXFCE4PANEL_VERSION_API], "libxfce4panel_version_api()", [libxfce4panel api version])
AC_SUBST([LIBXFCE4PANEL_VERSION_API])

XDT_CHECK_PACKAGE([PULSEAUDIO], [libpulse-mainloop-glib], [0.9.19])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.24.0])
XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.6.0])
dnl XDT_CHECK_PACKAGE([EXO], [exo-1], [0.6.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.9.0])
XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.11.0])
XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-${LIBXFCE4PANEL_VERSION_API}], [4.11.0])
XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])

dnl ****************************
dnl *** Optional IDO library ***
dnl ****************************
XDT_CHECK_OPTIONAL_PACKAGE([IDO], [libido3-0.1], [13.10.0], [ido], [IDO library])

dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
XDT_FEATURE_DEBUG()

dnl *********************************
dnl *** Substitute platform flags ***
dnl *********************************
AC_MSG_CHECKING([PLATFORM_CPPFLAGS])
AC_MSG_RESULT([$PLATFORM_CPPFLAGS])
AC_SUBST([PLATFORM_CPPFLAGS])
AC_MSG_CHECKING([PLATFORM_CFLAGS])
AC_MSG_RESULT([$PLATFORM_CFLAGS])
AC_SUBST([PLATFORM_CFLAGS])
AC_MSG_CHECKING([PLATFORM_LDFLAGS])
AC_MSG_RESULT([$PLATFORM_LDFLAGS])
AC_SUBST([PLATFORM_LDFLAGS])

AC_OUTPUT([
Makefile
icons/Makefile
icons/48x48/Makefile
icons/scalable/Makefile
panel-plugin/Makefile
panel-plugin/pulseaudio.desktop.in
po/Makefile.in
])

dnl ***************************
dnl *** Print configuration ***
dnl ***************************
echo
echo "Build Configuration:"
echo
echo "* Debug Support:        $enable_debug"
if test x"$IDO_FOUND" = x"yes"; then
echo "* Use IDO library:      yes"
else
echo "* Use IDO library:      no"
fi
echo
