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

dnl configure.ac
dnl
dnl xfconf - dbus-based configuration daemon and library for xfce
dnl
dnl Copyright (c) 2007-2011 Brian Tarricone <bjt23@cornell.edu>
dnl

dnl version info
m4_define([libxfconf_verinfo], [2:0:0])
m4_define([libxfconf_version_api], [0])
m4_define([xfconf_version_major], [4])
m4_define([xfconf_version_minor], [12])
m4_define([xfconf_version_micro], [0])
m4_define([xfconf_version_nano], [])
m4_define([xfconf_version_build], [3e4a791])
m4_define([xfconf_version_tag], [])
m4_define([xfconf_version], [xfconf_version_major().xfconf_version_minor().xfconf_version_micro()ifelse(xfconf_version_nano(), [], [], [.xfconf_version_nano()])ifelse(xfconf_version_tag(), [git], [xfconf_version_tag()-xfconf_version_build()], [xfconf_version_tag()])])

m4_define([xfconf_default_debug], [ifelse(xfconf_version_tag(), [git], [yes], [minimum])])

dnl init autoconf
AC_INIT([xfconf], [xfconf_version], [http://bugzilla.xfce.org/])
AC_PREREQ([2.50])

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

dnl set helper path prefix
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 check for UNIX variants
AC_AIX
AC_ISC_POSIX
AC_MINIX

dnl check for basic programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S

IT_PROG_INTLTOOL([0.35.0])

LT_PREREQ([2.2.6])
LT_INIT([disable-static])

dnl check for standard header files
AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h fcntl.h  grp.h locale.h \
                  signal.h stdlib.h string.h \
                  sys/stat.h sys/time.h sys/types.h sys/wait.h \
                  unistd.h])
dnl AC_CHECK_FUNCS([fdwalk getdtablesize setlocale setsid sysconf])
AC_CHECK_FUNCS([fdatasync fsync setlocale])

dnl version information
XFCONF_VERSION=xfconf_version
LIBXFCONF_VERSION_API=libxfconf_version_api
LIBXFCONF_VERINFO=libxfconf_verinfo
AC_SUBST(XFCONF_VERSION)
AC_SUBST(LIBXFCONF_VERSION_API)
AC_SUBST(LIBXFCONF_VERINFO)

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

dnl Check for X11 installed
dnl XDT_CHECK_LIBX11_REQUIRE

dnl required
XDT_CHECK_PACKAGE([GLIB], [gobject-2.0], [2.30.0])
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.30.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.10.0])
XDT_CHECK_PACKAGE([DBUS], [dbus-1], [1.1.0])
XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [0.84])

dnl check for perl bindings for --disable-perl-bindings and make-exo-alias.pl
AC_PATH_PROGS([PERL], [perl5.8 perl5.6 perl5 perl])

dnl see if we can build the perl bindings
AC_ARG_ENABLE([perl-bindings],
              [AC_HELP_STRING([--disable-perl-bindings],
                              [Don't try to build the perl bindings (default=auto)])],
              [use_perl=$enableval], [use_perl=auto])
PERL_GLIB_REQUIRED_VERSION=1.020
PERL_EXTUTILS_DEPENDS_REQUIRED_VERSION=0.300
PERL_EXTUTILS_PKGCONFIG_REQUIRED_VERSION=1.000
if test "x$use_perl" != "xno"; then
    if test "$PERL"; then
        # we need Glib, as well as a few support modules
        AC_MSG_CHECKING([for perl modules: ExtUtils::Depends, ExtUtils::PkgConfig, Glib])
        if `$PERL -e "use Glib '$PERL_GLIB_REQUIRED_VERSION'; \
                      use ExtUtils::Depends '$PERL_EXTUTILS_DEPENDS_REQUIRED_VERSION'; \
                      use ExtUtils::PkgConfig '$PERL_EXTUTILS_PKGCONFIG_REQUIRED_VERSION';" \
            >/dev/null 2>&1`
        then
            have_perl=yes
            AC_MSG_RESULT([yes])
        else
            have_perl=no
            AC_MSG_RESULT([no])
            echo '
*** Required perl modules not found to build perl bindings.  Requirements are:
***
***     ExtUtils::Depends    '"$PERL_EXTUTILS_DEPENDS_REQUIRED_VERSION"'
***     ExtUtils::PkgConfig  '"$PERL_EXTUTILS_PKGCONFIG_REQUIRED_VERSION"'
***     Glib                 '"$PERL_GLIB_REQUIRED_VERSION"'
***
*** Please install the required dependencies and run '"$0"' again.
'
        fi
    fi
fi
AM_CONDITIONAL([BUILD_PERL_BINDINGS], [test "x$have_perl" = "xyes"])
AC_SUBST([PERL_GLIB_REQUIRED_VERSION])
AC_SUBST([PERL_EXTUTILS_DEPENDS_REQUIRED_VERSION])
AC_SUBST([PERL_EXTUTILS_PKGCONFIG_REQUIRED_VERSION])

dnl Options to pass when configuring Perl bindings
AC_ARG_WITH([perl-options],
            [AC_HELP_STRING([--with-perl-options=OPTIONS],
                            [options to pass on command-line when generating Perl bindings build file])],
            [perl_makeopts="$withval"], [perl_makeopts=""])
PERL_MAKE_OPTIONS="$perl_makeopts"
AC_SUBST(PERL_MAKE_OPTIONS)

dnl check alignment for struct returns
AC_DEFUN([BT_GLIB_CHECK_ALIGNOF],
[
    saved_CFLAGS="$CFLAGS"
    saved_LIBS="$LIBS"
    CFLAGS="$CFLAGS $GLIB_CFLAGS"
    LIBS="$LIBS $GLIB_LIBS"
    AC_CHECK_ALIGNOF([$1], [#include <glib.h>])
    CFLAGS="$saved_CFLAGS"
    LIBS="$saved_LIBS"
])
BT_GLIB_CHECK_ALIGNOF(guchar)
BT_GLIB_CHECK_ALIGNOF(gchar)
BT_GLIB_CHECK_ALIGNOF(guint16)
BT_GLIB_CHECK_ALIGNOF(gint16)
BT_GLIB_CHECK_ALIGNOF(guint32)
BT_GLIB_CHECK_ALIGNOF(gint32)
BT_GLIB_CHECK_ALIGNOF(guint64)
BT_GLIB_CHECK_ALIGNOF(gint64)
BT_GLIB_CHECK_ALIGNOF(gfloat)
BT_GLIB_CHECK_ALIGNOF(gdouble)
BT_GLIB_CHECK_ALIGNOF(gboolean)
BT_GLIB_CHECK_ALIGNOF(gpointer)

dnl gtk-doc
GTK_DOC_CHECK([1.0])

dnl backends

dnl always build the perchannel-xml backend
xfconf_backend_perchannel_xml=yes
AM_CONDITIONAL([BUILD_XFCONF_BACKEND_PERCHANNEL_XML],
               [test "x$xfconf_backend_perchannel_xml" = "xyes"])
if test "x$xfconf_backend_perchannel_xml" = "xyes"; then
    AC_DEFINE([BUILD_XFCONF_BACKEND_PERCHANNEL_XML], [1],
              [Define if the perchannel-xml backend should be built])
fi

dnl check for debugging support
XDT_FEATURE_DEBUG([xfconf_default_debug])
dnl gtk-doc is broken
XDT_SUPPORTED_FLAGS([GTK_DOC_EXTRA_CFLAGS], [-Wno-sign-compare])
AC_SUBST([GTK_DOC_EXTRA_CFLAGS])

AC_ARG_ENABLE([checks],
              AC_HELP_STRING([--enable-checks],
                             [Enables some runtime checks for libxfconf that print debugging information at a slight cost to library code size and speed]),
              [enable_checks=$enableval])
if test "x$enable_checks" = "xyes"; then
    AC_DEFINE([XFCONF_ENABLE_CHECKS], [1],
              [Define if runtime checks should be performed])
fi

dnl check whether the compiler supports the visibility attribute
XDT_FEATURE_VISIBILITY

dnl add -O1 and --as-needed to LDFLAGS if supported
XDT_FEATURE_LINKER_OPTS

AC_ARG_ENABLE([profiling],
              AC_HELP_STRING([--enable-profiling],
                             [Enable gprof profiling support]),
              [enable_profiling=$enableval])
if test "x$enable_profiling" = "xyes"; then
    AC_DEFINE([XFCONF_ENABLE_PROFILING], [1],
              [Define if gprof profiling should be compiled in])
fi
AM_CONDITIONAL([ENABLE_PROFILING], [test "x$enable_profiling" = "xyes"])


AC_OUTPUT([
Makefile
common/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/version.xml
docs/spec/Makefile
po/Makefile.in
tests/Makefile
tests/set-properties/Makefile
tests/has-properties/Makefile
tests/get-properties/Makefile
tests/reset-properties/Makefile
tests/object-bindings/Makefile
tests/property-changed-signal/Makefile
xfconf/Makefile
xfconf/libxfconf-0.pc
xfconf-perl/Makefile.PL
xfconf-perl/Makefile
xfconf-perl/Xfconf.pm
xfconf-perl/xs/Makefile
xfconf-query/Makefile
xfconfd/Makefile
])
