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

dnl
dnl Copyright (c) 2004-2009 os-cillation.
dnl Copyright (c) 2009-2019 Xfce Development Team <xfce4-dev@xfce.org>
dnl All rights reserved.
dnl
dnl Written by Benedikt Meurer <benny@xfce.org>.
dnl

dnl ***************************
dnl *** Version information ***
dnl ***************************
m4_define([libexo_verinfo], [1:0:1])
m4_define([libexo_version_api], [1])
m4_define([libexo2_version_api], [2])
m4_define([libexo_version_major], [0])
m4_define([libexo_version_minor], [12])
m4_define([libexo_version_micro], [8])
m4_define([libexo_version_nano], [])
m4_define([libexo_version_build], [de811a59])
m4_define([libexo_version_tag], [])
m4_define([libexo_version], [libexo_version_major().libexo_version_minor().libexo_version_micro()ifelse(libexo_version_nano(), [], [], [.libexo_version_nano()])ifelse(libexo_version_tag(), [git], [libexo_version_tag()-libexo_version_build()], [libexo_version_tag()])])

dnl ********************************************
dnl *** Full debug support for GIT snapshots ***
dnl ********************************************
m4_define([libexo_debug_default], [ifelse(libexo_version_tag(), [git], [yes], [minimum])])

dnl ****************************
dnl *** For intltool support ***
dnl ****************************
m4_define([intltool_minimum_version], [0.35])

dnl ***************************
dnl *** Initialize autoconf ***
dnl ***************************
AC_COPYRIGHT([Copyright (c) 2004-2010 os-cillation.
Copyright (c) 2004-2019 Xfce Development Team])
AC_INIT([exo], [libexo_version], [https://bugzilla.xfce.org/])
AC_PREREQ([2.60])
AC_CONFIG_MACRO_DIR([m4])
AC_REVISION([de811a59])
AC_CANONICAL_TARGET()

dnl ***************************
dnl *** Initialize automake ***
dnl ***************************
AM_INIT_AUTOMAKE([1.11 dist-bzip2 tar-ustar no-dist-gzip])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE()
AM_SILENT_RULES([yes])

dnl **************************
dnl *** Libtool versioning ***
dnl **************************
LIBEXO_VERINFO=libexo_verinfo()
AC_SUBST([LIBEXO_VERINFO])

dnl ****************************
dnl *** Subst libexo version ***
dnl ****************************
LIBEXO_VERSION_API=libexo_version_api()
LIBEXO2_VERSION_API=libexo2_version_api()
LIBEXO_VERSION_MAJOR=libexo_version_major()
LIBEXO_VERSION_MINOR=libexo_version_minor()
LIBEXO_VERSION_MICRO=libexo_version_micro()
AC_SUBST([LIBEXO_VERSION_API])
AC_SUBST([LIBEXO2_VERSION_API])
AC_SUBST([LIBEXO_VERSION_MAJOR])
AC_SUBST([LIBEXO_VERSION_MINOR])
AC_SUBST([LIBEXO_VERSION_MICRO])

dnl ******************************
dnl *** Set helper path prefix ***
dnl ******************************
AC_ARG_WITH([helper-path-prefix],
            [AC_HELP_STRING([--with-helper-path-prefix=PATH],
                            [Path prefix under which helper executables will be installed (default: $libdir)])],
            [HELPER_PATH_PREFIX="$withval"],
            [HELPER_PATH_PREFIX="$libdir"])
AC_SUBST([HELPER_PATH_PREFIX])

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

dnl ********************************
dnl *** Check for Win32 variants ***
dnl ********************************
AC_MSG_CHECKING([if building for some Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
  ac_bm_platform_win32=yes
  ;;
*)
  ac_bm_platform_win32=no
  ;;
esac
AC_MSG_RESULT([$ac_bm_platform_win32])
AM_CONDITIONAL([PLATFORM_WIN32], [test x"$ac_bm_platform_win32" = x"yes"])

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

dnl ********************************
dnl *** Check for basic programs ***
dnl ********************************
AM_PROG_AS()
AC_PROG_CC()
AM_PROG_CC_C_O()
AC_PROG_INSTALL()
IT_PROG_INTLTOOL([intltool_minimum_version], [no-xml])
AC_CHECK_PROGS([PERL], [perl5 perl])

dnl ***************************************
dnl *** Check for required Perl modules ***
dnl ***************************************
AC_PROG_PERL_MODULES([URI::Escape URI::file URI::URL], [],
[
  AC_MSG_ERROR([Atleast one of the required Perl modules (URI::Escape, URI::file and URI::URL) was not found on your system])
])

dnl ***************************************
dnl *** Check for standard header files ***
dnl ***************************************
AC_HEADER_STDC()
AC_CHECK_HEADERS([assert.h errno.h fcntl.h fnmatch.h libintl.h \
                  locale.h math.h mmintrin.h paths.h regex.h \
                  signal.h stdarg.h string.h sys/mman.h \
                  sys/stat.h sys/time.h sys/types.h sys/wait.h time.h])

dnl ************************************
dnl *** Check for standard functions ***
dnl ************************************
AC_FUNC_MMAP()

dnl ***************************************
dnl *** Check for strftime() extensions ***
dnl ***************************************
AC_TRY_RUN([
  #include <string.h>
  #include <time.h>
  int
  main (int argc, char **argv)
  {
    struct tm tm;
    char      buffer[16];
    tm.tm_year = 81;
    if (strftime (buffer, 16, "%EY", &tm) == 4 && strcmp (buffer, "1981") == 0)
      return 0;
    return 1;
  }
], [
  AC_DEFINE([HAVE_STRFTIME_EXTENSION], 1, [Define if strftime supports %E and %O modifiers.])
])

dnl ******************************
dnl *** Check for i18n support ***
dnl ******************************
XDT_I18N([am ar ast be bg bn ca cs da de el en_AU en_GB es et eu fi fr gl he hr hu hy_AM hy id ie is it ja kk kn ko lt lv ms nb nl nn oc pa pl pt_BR pt ro ru si sk sl sq sr sv te th tr ug uk ur_PK ur vi zh_CN zh_HK zh_TW ], [exo-libexo_version_api()])

dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.42.0])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.42.0])
XDT_CHECK_PACKAGE([GTK3], [gtk+-3.0], [3.22.0])
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.42.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.12.0])
XDT_CHECK_PACKAGE([LIBXFCE4UI2], [libxfce4ui-2], [4.12.0])
XDT_CHECK_OPTIONAL_PACKAGE([GIO_UNIX], [gio-unix-2.0], [2.42.0], [gio-unix], [GIO-Unix features])

dnl ***********************************************************
dnl *** Optional support for a GTK+2 version of the library ***
dnl ***********************************************************
XDT_CHECK_OPTIONAL_PACKAGE([GTK2],
                           [gtk+-2.0], [2.24.0], [gtk2],
                           [GTK+ 2 support])
AM_CONDITIONAL([ENABLE_GTK2_LIBRARY], [test "x$GTK2_FOUND" = "xyes"])

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

dnl *************************
dnl *** Check for gtk-doc ***
dnl *************************
GTK_DOC_CHECK([1.9])

dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
XDT_FEATURE_DEBUG([libexo_debug_default])

dnl **************************************
dnl *** Check for linker optimizations ***
dnl **************************************
XDT_FEATURE_LINKER_OPTS()

dnl ****************************************
dnl *** Check for ELF visibility support ***
dnl ****************************************
AC_ARG_ENABLE([visibility], AC_HELP_STRING([--disable-visibility], [Do not use ELF visibility attributes]), [], [enable_visibility=yes])
have_gnuc_visibility=no
if test x"$enable_visibility" != x"no"; then
  dnl Check whether the compiler supports the visibility attribute
  save_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -Wall -Werror"
  AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute])
  AC_COMPILE_IFELSE([AC_LANG_SOURCE(
  [
    void test_default (void);
    void test_hidden (void);

    void __attribute__ ((visibility("default"))) test_default (void) {}
    void __attribute__ ((visibility("hidden"))) test_hidden (void) {}

    int main (int argc, char **argv) { test_default (); test_hidden (); return 0; }
  ])],
  [
    have_gnuc_visibility=yes
    AC_MSG_RESULT([yes])
  ],
  [
    AC_MSG_RESULT([no])
  ])
  CFLAGS="$save_CFLAGS"
fi
if test x"$have_gnuc_visibility" = x"yes"; then
  CPPFLAGS="$CPPFLAGS -DHAVE_GNUC_VISIBILITY"
fi
AM_CONDITIONAL([HAVE_GNUC_VISIBILITY], [test x"$have_gnuc_visibility" = x"yes"])

dnl *************************************
dnl *** Use GSEAL if possible         ***
dnl *************************************
XDT_SUPPORTED_FLAGS([CFLAGS], [-DGSEAL_ENABLE])

AC_OUTPUT([
Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/version.xml
exo/Makefile
exo/exo-1.pc
exo/exo-2.pc
exo/exo-config.h
exo-csource/Makefile
exo-desktop-item-edit/Makefile
exo-helper/Makefile
exo-helper/helpers/Makefile
exo-open/Makefile
icons/Makefile
icons/24x24/Makefile
icons/48x48/Makefile
pixmaps/Makefile
po/Makefile.in
tests/Makefile
tests/data/Makefile
])

dnl ***************************
dnl *** Print configuration ***
dnl ***************************
echo
echo "Build Configuration:"
echo
echo "* Debug Support:        $enable_debug"
echo "* GNU Visibility:       $have_gnuc_visibility"
if test x"$GTK2_FOUND" = x"yes"; then
echo "* GTK+ 2 Support:       yes"
else
echo "* GTK+ 2 Support:       no"
fi
echo
