dnl
dnl This file was autogenerated from "configure.ac.in".
dnl Edit that file instead!
dnl

m4_define([intltool_minimum_version], [0.31])
m4_define([parole_verinfo],  [0:2:0])
m4_define([parole_version_api],  [0])
m4_define([parole_version_major],  [0])
m4_define([parole_version_minor],  [2])
m4_define([parole_version_micro],  [0.2])
m4_define([parole_version_build],  [])
m4_define([parole_version_tag], [])
m4_define([parole_version], [parole_version_major().parole_version_minor().parole_version_micro()ifelse(parole_version_tag(), [git], [parole_version_tag().parole_version_build()], [parole_version_tag()])])

AC_INIT([parole], [parole_version], [aliov@xfce.org])
AC_PREREQ(2.59c)

AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar])
AM_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE()
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_USE_SYSTEM_EXTENSIONS()

# ===================================================== #
#               Basic compiler settings                 #
# ===================================================== #
AC_PROG_CC()
AC_PROG_CXX()
AM_PROG_CC_C_O()
AC_PROG_LD()
AC_PROG_INSTALL()
AC_PROG_INTLTOOL([intltool_minimum_version], [no-xml])

# ===================================================== #
#               Initialize libtool                      #
# ===================================================== #
AC_DISABLE_STATIC()
AC_PROG_LIBTOOL()
m4_ifdef([LT_OUTPUT], [LT_OUTPUT])

# ===================================================== #
#               Version information                     #
# ===================================================== #
PAROLE_VERINFO=parole_verinfo()
PAROLE_VERSION_API=parole_version_api()
PAROLE_VERSION_MAJOR=parole_version_major()
PAROLE_VERSION_MINOR=parole_version_minor()
PAROLE_VERSION_MICRO=parole_version_micro()
AC_SUBST([PAROLE_VERINFO])
AC_SUBST([PAROLE_VERSION_API])
AC_SUBST([PAROLE_VERSION_MAJOR])
AC_SUBST([PAROLE_VERSION_MINOR])
AC_SUBST([PAROLE_VERSION_MICRO])

# ==================================================== #
#   Check for headers needed for standard interfaces   #
# ==================================================== #
AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h signal.h stddef.h sys/ioctl.h fcntl.h\
                  string.h sys/stat.h sys/types.h sys/wait.h time.h \
                  unistd.h])

# ===================================================== #
# 		Check for i18n support 			#
# ===================================================== #

XDT_I18N([ast ca cs da de es eu fr gl id ja lv nl pt ru sk sv tr uk zh_CN ])

#==================================================== #
#          Check for required packages 		      #
#=====================================================#
m4_define([gtk_minimum_version], [2.16.0])
m4_define([glib_minimum_version], [2.16.0])
m4_define([gstreamer_minimum_version], [0.10.11])

m4_define([dbus_minimum_version], [0.60])
m4_define([dbus_glib_minimum_version], [0.70])

m4_define([libxfcegui4_minimum_version],[4.6.0])
m4_define([libxfce4util_minimum_version],[4.6.0])

m4_define([libnotify_minimum_version], [0.4.1])

XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [gtk_minimum_version])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [glib_minimum_version])
XDT_CHECK_PACKAGE([GOBJECT], [gobject-2.0], [glib_minimum_version])
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [glib_minimum_version])
XDT_CHECK_PACKAGE([GMODULE], [gmodule-2.0], [glib_minimum_version])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [glib_minimum_version])

XDT_CHECK_PACKAGE([GST], [gstreamer-0.10], [gstreamer_minimum_version])
XDT_CHECK_PACKAGE([GST_BASE], [gstreamer-base-0.10], [gstreamer_minimum_version])
XDT_CHECK_PACKAGE([GST_VIDEO], [gstreamer-video-0.10], [gstreamer_minimum_version])
XDT_CHECK_PACKAGE([GST_INTERFACES], [gstreamer-interfaces-0.10], [gstreamer_minimum_version])

XDT_CHECK_PACKAGE([DBUS], [dbus-1], [dbus_minimum_version])
XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [dbus_glib_minimum_version])

XDT_CHECK_PACKAGE([LIBXFCE4GUI], [libxfcegui4-1.0],[libxfcegui4_minimum_version])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0],[libxfce4util_minimum_version])

#=======================================================#
#           Check for availability of libnotify         #
#=======================================================#
LIBNOTIFY_FOUND="no"
XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY],
                       [libnotify], [libnotify_minimum_version],
                       [libnotify], 
                       [libnotify library], [yes])

# Taken from Gnome system tools
#=======================================================#
#              Pixmaps  files              		#
#=======================================================#
if test "x${prefix}" = "xNONE"; then
  AC_DEFINE_UNQUOTED(PIXMAPS_DIR, "${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps", [pixmaps directory])
  pixmapsdir="${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps"
else
  AC_DEFINE_UNQUOTED(PIXMAPS_DIR, "${prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps", [pixmaps directory])
  pixmapsdir="${prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps"
fi

AC_SUBST(pixmapsdir)

#=======================================================#
#      	       Check XF86keysysm            		#
#=======================================================#
# Check for the AudioPlay sym other should exist
# if this one exists.
AC_CHECK_DECL(XF86XK_AudioPlay,have_XF86XK_AudioPlay=1,have_XF86XK_AudioPlay=0,[#include <X11/XF86keysym.h>])
if test "x${ac_cv_have_decl_XF86XK_AudioPlay}" != "xno"; then
  AC_DEFINE(HAVE_XF86_KEYSYM, 1, [Define if XF86keysysm.h is available])
fi

#=======================================================#
#      	       TagLib support	          		#
#=======================================================#
TAGLIB_FOUND="no"
XDT_CHECK_OPTIONAL_PACKAGE([TAGLIB], 
    [taglib], [1.4],
    [taglib], 
    [tag lib], [yes])

if test x"$TAGLIB_FOUND" = x"yes"; then
TAGLIBC_LIBS=""
TAGLIBC_CFLAGS=""
AC_CHECK_LIB([tag_c], [taglib_file_new],
[
    AC_CHECK_HEADER([taglib/tag_c.h],
    [
	TAGLIBC_LIBS="-ltag_c"
	AC_DEFINE([HAVE_TAGLIBC], [1], [Define to 1 if tag_c is found])
    ])
], [-lm])
AC_SUBST([TAGLIBC_CFLAGS])
AC_SUBST([TAGLIBC_LIBS])
fi

#=======================================================#
#              Check plugins to build                   #
#=======================================================#

# Stream Properties plugin.
#--------------------------
AC_ARG_ENABLE([properties-plugin], AC_HELP_STRING([--disable-properties-plugin], [Don't build parole stream properties plugin]),
  [ac_properties_plugin=$enableval], [ac_properties_plugin=yes])
AC_MSG_CHECKING([whether to build the Parole stream properties plugin])
AM_CONDITIONAL([PAROLE_PROPERTIES_PLUGIN], [test x"$ac_properties_plugin" = x"yes"])
AC_MSG_RESULT([$ac_properties_plugin])

# Tray plugin.
#--------------------------
AC_ARG_ENABLE([tray-plugin], AC_HELP_STRING([--disable-tray-plugin], [Don't build parole tray icon plugin]),
  [ac_tray_plugin=$enableval], [ac_tray_plugin=yes])
AC_MSG_CHECKING([whether to build the system tray plugin])
AM_CONDITIONAL([PAROLE_TRAY_PLUGIN], [test x"$ac_tray_plugin" = x"yes"])
AC_MSG_RESULT([$ac_tray_plugin])
# Should we build the tray icon with notification support?
LIBNOTIFY_FOUND="no"
if test x"$ac_tray_plugin" = x"yes"; then
 	XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY],
 	[libnotify], [libnotify_minimum_version],
 	[libnotify],
 	[libnotify library], [yes]) 
fi

# Window title plugin.
#--------------------------
AC_ARG_ENABLE([window-title-plugin], AC_HELP_STRING([--disable-window-title-plugin], [Don't build the window title plugin]),
  [ac_window_title_plugin=$enableval], [ac_window_title_plugin=yes])
AC_MSG_CHECKING([whether to build the window title plugin])
AM_CONDITIONAL([WINDOW_TITLE_PLUGIN], [test x"$ac_window_title_plugin" = x"yes"])
AC_MSG_RESULT([$ac_window_title_plugin])

# Power Manager
#--------------------------
AC_ARG_ENABLE([power-manager-plugin], AC_HELP_STRING([--disable-power-manager-plugin], [Don't build the power manager plugin]),
  [ac_power_manager_plugin=$enableval], [ac_power_manager_plugin=yes])
AC_MSG_CHECKING([whether to build the power manager plugin])
AM_CONDITIONAL([POWER_MANAGER_PLUGIN], [test x"$ac_power_manager_plugin" = x"yes"])
AC_MSG_RESULT([$ac_power_manager_plugin])

#=======================================================#
#              Build browser plugin?                    #
#=======================================================#
AC_ARG_ENABLE([browser-plugin], AC_HELP_STRING([--disable-browser-plugin], [Don't build the browser plugin]),
  [ac_browser_plugin=$enableval], [ac_browser_plugin=yes])
AC_MSG_CHECKING([whether to build the browser plugin])
AM_CONDITIONAL([ENABLE_BROWSER_PLUGIN], [test x"$ac_browser_plugin" = x"yes"])
AC_MSG_RESULT([$ac_browser_plugin])
if test x"$ac_browser_plugin" = x"yes"; then
    BROWSER_PLUGIN_DIR="${BROWSER_PLUGIN_DIR:-"\${libdir}/mozilla/plugins"}"
    AC_ARG_VAR([BROWSER_PLUGIN_DIR],[Where to install the browser plugin])
    AC_DEFINE(BUILD_BROWSER_PLUGIN, 1, [whether to build with browser plugin support])
fi

#=======================================================#
#              Check for debugging support              #
#=======================================================#
XDT_FEATURE_DEBUG()
AM_CONDITIONAL([DEBUG_BROWSER_PLUGIN], [test x"$enable_debug" = x"full"])

#=======================================================#
#              Check for Gtk doc	                #
#=======================================================#
GTK_DOC_CHECK(1.9)

AC_OUTPUT([
Makefile
data/Makefile
data/pixmaps/Makefile
data/interfaces/Makefile
data/icons/Makefile
data/icons/16x16/Makefile
data/icons/22x22/Makefile
data/icons/32x32/Makefile
data/icons/48x48/Makefile
data/icons/scalable/Makefile
data/mime/Makefile
data/desktop/Makefile
parole/Makefile
parole/parole.h
common/Makefile
gst/Makefile
dbus/Makefile
src/Makefile
plugins/Makefile
plugins/sample/Makefile
plugins/properties/Makefile
plugins/tray/Makefile
plugins/window-title/Makefile
plugins/power-manager/Makefile
browser-plugin/Makefile
browser-plugin/media-plugin/Makefile
docs/Makefile
docs/plugin-api/version.xml
docs/plugin-api/Makefile
po/Makefile.in
])

echo "
------------------------------------------------------
            Parole Media Player $VERSION
        ====================================
	
	Installation:
	=============
        prefix:                 	$prefix
	pixmapsdir:			$pixmapsdir
        Debug:   			$enable_debug
	Building plugin api docs:       ${enable_gtk_doc}
	
	Optional dependencies:
	======================
	Libnotify:			$LIBNOTIFY_FOUND
	Taglib:				$TAGLIB_FOUND
	
	Plugins to build:
	=================
	Stream Properties:       	${ac_properties_plugin}" 
	if test x${ac_properties_plugin} = x"yes"; then 
	echo "	(With taglib $TAGLIB_FOUND)" 
	fi 
	echo "	
	System Tray icon:       	${ac_tray_plugin}" 
	if test x${ac_tray_plugin} = x"yes"; then 
	echo " 	(With notification $LIBNOTIFY_FOUND)" 
	fi 
	
	echo "
	Window title:			${ac_window_title_plugin}
	Power Manager:			${ac_power_manager_plugin}

	Browser plugin:
	===============
	Build browser plugin:		${ac_browser_plugin}"
	if test x${ac_browser_plugin} = x"yes"; then
echo "	installation path:		${BROWSER_PLUGIN_DIR}"
	fi
echo "
------------------------------------------------------

Configuration finished, type make to compile"
