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

dnl
dnl Copyright (c) 2003-2020
dnl         The Xfce development team. All rights reserved.
dnl
dnl xfdesktop - xfce4's desktop manager
dnl

dnl version info
m4_define([xfdesktop_version_major], [4])
m4_define([xfdesktop_version_minor], [16])
m4_define([xfdesktop_version_micro], [0])
m4_define([xfdesktop_version_nano], [])
m4_define([xfdesktop_version_build], [59640b4d])
m4_define([xfdesktop_version_tag], [])
m4_define([xfdesktop_version], [xfdesktop_version_major().xfdesktop_version_minor().xfdesktop_version_micro()ifelse(xfdesktop_version_nano(), [], [], [.xfdesktop_version_nano()])ifelse(xfdesktop_version_tag(), [git], [xfdesktop_version_tag()-xfdesktop_version_build()], [xfdesktop_version_tag()])])

dnl minimum required versions
m4_define([glib_minimum_version], [2.50.0])
m4_define([gtk_minimum_version], [3.22.0])
m4_define([libxfce4util_minimum_version], [4.13.0])
m4_define([libxfce4ui_minimum_version], [4.13.0])
m4_define([garcon_minimum_version], [0.6.0])
m4_define([exo_minimum_version], [0.11.0])
m4_define([thunar_minimum_version], [1.7.0])
m4_define([wnck_minimum_version], [3.14])
m4_define([intltool_minimum_version], [0.31])
m4_define([xfconf_minimum_version], [4.12.1])
m4_define([cairo_minimum_version], [1.12])

dnl define a short version string for xfdesktop
m4_append([xfdesktop_version_short], ["])
m4_append([xfdesktop_version_short], [xfdesktop_version_major])
m4_append([xfdesktop_version_short], [.])
m4_append([xfdesktop_version_short], [xfdesktop_version_minor])
m4_append([xfdesktop_version_short], ["])

dnl init autoconf
AC_INIT([xfdesktop], [xfdesktop_version], [https://gitlab.xfce.org/xfce/xfdesktop])
AC_PREREQ([2.60])

dnl init automake
AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar no-dist-gzip foreign])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4])
AM_MAINTAINER_MODE
AM_SILENT_RULES([yes])

dnl check for UNIX variants
AC_USE_SYSTEM_EXTENSIONS
AC_SEARCH_LIBS([strerror],[cposix])

dnl check for basic programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
IT_PROG_INTLTOOL([intltool_minimum_version], [no-xml])
m4_ifdef([AC_PROG_SED], [AC_PROG_SED], [AC_CHECK_PROG(SED, sed, sed)])

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

dnl check for standard header files
AC_HEADER_STDC
AC_CHECK_HEADERS([ctype.h errno.h fcntl.h math.h pwd.h signal.h \
                  string.h sys/param.h sys/stat.h  \
                  sys/types.h time.h \
                  unistd.h])
dnl Check for i18n support
XDT_I18N([bg nb hye ur_PK ca fa_IR ug de ro si gl hr en_GB en_AU hy_AM ast ie nl ur te th ru tr ne sq el et id eo zh_CN oc ar cs uz sr fr pt_BR is be@tarask ko be es ka bn eu zh_HK sk sv da pt uk it vi am he lv pa lt pl zh_TW ms en_CA fi nn kk hu sl ja ])

dnl Check for X11 installed
XDT_CHECK_LIBX11_REQUIRE

dnl define xfdesktop's short version (major.minor)
AC_DEFINE([XFDESKTOP_VERSION_SHORT], [xfdesktop_version_short], [Short version string of xfdesktop])
dnl replace the version in settings/xfce-backdrop-settings.desktop.in.in
AC_SUBST([XFDESKTOP_VERSION_SHORT], [xfdesktop_version_short])

dnl required
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [glib_minimum_version])
XDT_CHECK_PACKAGE([GIO_UNIX], [gio-unix-2.0], [glib_minimum_version])
XDT_CHECK_PACKAGE([GMODULE], [gmodule-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([GTK], [gtk+-3.0], [gtk_minimum_version])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0],
                  [libxfce4util_minimum_version])
XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2],
                  [libxfce4ui_minimum_version])
XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-3.0], [wnck_minimum_version])
XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [xfconf_minimum_version])
XDT_CHECK_PACKAGE([LIBEXO], [exo-2], [exo_minimum_version])
XDT_CHECK_PACKAGE([CAIRO], [cairo], [cairo_minimum_version])

dnl do we want desktop icons at all?
AC_ARG_ENABLE([desktop-icons],
    [AS_HELP_STRING([--disable-desktop-icons],
            [Do not compile in support for desktop icons (default=enabled)])],
        [ac_cv_enable_desktop_icons=$enableval],
        [ac_cv_enable_desktop_icons=yes])
if test "x$ac_cv_enable_desktop_icons" = "xno"; then
    enable_desktop_icons="no"
else
    enable_desktop_icons="yes"
    AC_DEFINE([ENABLE_DESKTOP_ICONS], [1], [Set if desktop icon support is enabled])
fi
AM_CONDITIONAL([ENABLE_DESKTOP_ICONS], [test "x$enable_desktop_icons" = "xyes"])

dnl if we want desktop icons, do we also want file icons?
AC_ARG_ENABLE([file-icons],
    [AS_HELP_STRING([--disable-file-icons],
            [Do not compile in support for desktop file icons (default=enabled)])],
        [ac_cv_enable_file_icons=$enableval],
        [ac_cv_enable_file_icons=yes])
if test "x$ac_cv_enable_file_icons" = "xno" -o "x$enable_desktop_icons" != "xyes"; then
    enable_file_icons="no"
else
    enable_file_icons="yes"
fi

if test "x$enable_desktop_icons" = "xyes" -a "x$enable_file_icons" = "xyes"; then
        AC_DEFINE([ENABLE_FILE_ICONS], [1],
                  [Define if file icons should be enabled])
fi

AM_CONDITIONAL([ENABLE_FILE_ICONS], [test "x$enable_file_icons" = "xyes"])


dnl i'd rather have these two only checked conditionally, but this macro also
dnl calls AM_CONDITIONAL(), which cannot be in an 'if' block

XDT_CHECK_OPTIONAL_PACKAGE([THUNARX], [thunarx-3], [thunar_minimum_version],
    [thunarx],
    [Thunar's extension mechanism, to add external features to the desktop icon implementation])


AC_ARG_ENABLE([desktop-menu],
        AS_HELP_STRING([--disable-desktop-menu],
                [Do not build the desktop menu module (default=enabled)]),
        [ac_cv_enable_desktop_menu=$enableval],
        [ac_cv_enable_desktop_menu=yes])
if test "x$ac_cv_enable_desktop_menu" = "xno"; then
    build_desktop_menu="no"
else
    dnl time for more abuse!
    XDT_CHECK_PACKAGE([GARCON], [garcon-1],
                      [garcon_minimum_version], [build_desktop_menu="yes"],
                      [
echo "*** Optional package garcon-1 was either not found on your system"
echo "*** or is too old.  Please install or upgrade to at least version"
echo "*** garcon_minimum_version, or adjust the PKG_CONFIG_PATH environment variable"
echo "*** if you installed the new version of the package in a nonstandard"
echo "*** prefix.  Desktop menu will be disabled."
build_desktop_menu="no"
])
    XDT_CHECK_PACKAGE([GARCON_GTK3], [garcon-gtk3-1],
                      [garcon_minimum_version], [build_desktop_menu="yes"],
                      [
echo "*** Optional package garcon-gtk3-1 was either not found on your system"
echo "*** or is too old.  Please install or upgrade to at least version"
echo "*** garcon_minimum_version, or adjust the PKG_CONFIG_PATH environment variable"
echo "*** if you installed the new version of the package in a nonstandard"
echo "*** prefix.  Desktop menu will be disabled."
build_desktop_menu="no"
])
    if test "x$build_desktop_menu" = "xyes"; then
        AC_DEFINE([USE_DESKTOP_MENU], [1],
                  [Define if we should build the desktop menu module])
    fi
fi
AM_CONDITIONAL([BUILD_DESKTOP_MENU], [test "x$build_desktop_menu" = "xyes"])

AC_ARG_WITH([file-manager-fallback],
    [AS_HELP_STRING([--with-file-manager-fallback=PATH],
            [Default file manager fallback to handle external folders and applications (default=Thunar)])],
    [ac_cv_file_manager_fallback="$withval"],
    [ac_cv_file_manager_fallback=Thunar])
AC_DEFINE_UNQUOTED([FILE_MANAGER_FALLBACK], ["$ac_cv_file_manager_fallback"],
    [Set to the file manager to use as a fallback])

dnl **************************************
dnl *** Optional support for libnotify ***
dnl **************************************
XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY], [libnotify], [0.4.0], [notifications],
                           [Mount notification support], [yes])

dnl check for debugging support
XDT_FEATURE_DEBUG

AC_CONFIG_FILES([
Makefile
backgrounds/Makefile
common/Makefile
doc/Makefile
pixmaps/Makefile
po/Makefile.in
settings/xfce-backdrop-settings.desktop.in
settings/Makefile
src/Makefile
])
AC_OUTPUT

echo
echo "Build Configuration:"
echo "* Build desktop menu module:                    $build_desktop_menu"
echo "* Build support for desktop icons:              $enable_desktop_icons"
echo "      Include support for file/launcher icons:  $enable_file_icons"
if test x"$LIBNOTIFY_FOUND" = x"yes"; then
echo "* Mount notification support:                   yes"
else
echo "* Mount notification support:                   no"
fi
echo
