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

dnl $Id$
dnl
dnl Copyright (c) 2004-2009 os-cillation.
dnl All rights reserved.
dnl
dnl Written by Benedikt Meurer <benny@xfce.org>.
dnl

dnl ***************************
dnl *** Version information ***
dnl ***************************
m4_define([libexo_verinfo], [5:0:5])
m4_define([libexo_version_major], [0])
m4_define([libexo_version_minor], [3])
m4_define([libexo_version_micro], [107])
m4_define([libexo_version_nano], [])
m4_define([libexo_version_build], [4a91956])
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], [full], [minimum])])

dnl ***************************
dnl *** Initialize autoconf ***
dnl ***************************
AC_COPYRIGHT([Copyright (c) 2004-2009 os-cillation.
All rights reserved.
        
Written by Benedikt Meurer <benny@xfce.org>.])
AC_INIT([exo], [libexo_version], [http://bugzilla.xfce.org/])
AC_PREREQ([2.50])
AC_REVISION([$Id$])
AC_CANONICAL_TARGET()

dnl ***************************
dnl *** Initialize automake ***
dnl ***************************
AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()])
AM_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE()

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

dnl ****************************
dnl *** Subst libexo version ***
dnl ****************************
LIBEXO_VERSION_MAJOR=libexo_version_major()
LIBEXO_VERSION_MINOR=libexo_version_minor()
LIBEXO_VERSION_MICRO=libexo_version_micro()
LIBEXO_VERSION_API=$LIBEXO_VERSION_MAJOR.$LIBEXO_VERSION_MINOR
AC_SUBST([LIBEXO_VERSION_MAJOR])
AC_SUBST([LIBEXO_VERSION_MINOR])
AC_SUBST([LIBEXO_VERSION_MICRO])
AC_SUBST([LIBEXO_VERSION_API])

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 *** Check for basic programs ***
dnl ********************************
AM_PROG_AS()
AC_PROG_CC()
AM_PROG_CC_C_O()
AC_PROG_INSTALL()
AC_PROG_INTLTOOL([0.31], [no-xml])
AC_PROG_LIBTOOL()
AC_CHECK_PROGS([PERL], [perl5 perl])

dnl ************************************************
dnl *** Loopup hardcoded paths we use internally ***
dnl ************************************************
AC_PATH_PROG([PATH_MOUNT], [mount], [/bin/mount])
AC_PATH_PROG([PATH_UMOUNT], [umount], [/bin/umount])
AC_SUBST([PATH_MOUNT])
AC_SUBST([PATH_UMOUNT])

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 fstab.h libintl.h \
                  locale.h math.h mmintrin.h mntent.h \
                  paths.h regex.h signal.h stdarg.h string.h sys/mman.h \
                  sys/mnttab.h sys/mount.h sys/param.h sys/resource.h \
                  sys/statvfs.h sys/stat.h sys/time.h sys/types.h sys/ucred.h \
                  sys/wait.h time.h])

dnl ************************************
dnl *** Check for standard functions ***
dnl ************************************
AC_FUNC_MMAP()
AC_CHECK_FUNCS([getfsstat getmntent getvfsstat regexec setfsent setmntent])

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 bn ca cs cy da de dz el en_GB es et eu fi fr gl he hu id it ja ka kk ku lt lv mk nb nl nn pa pl pt_BR pt ro ru sk sq sv tr ug uk ur_PK ur zh_CN zh_TW ], [libexo-libexo_version_major().libexo_version_minor()])

dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.6.4])
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.6.4])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.2.2])

dnl **************************************
dnl *** Check for libnotify (optional) ***
dnl **************************************
XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY], [libnotify], [0.4.0], [notifications], [Notifications support], [yes])

dnl ********************************
dnl *** Check for HAL (optional) ***
dnl ********************************
XDT_CHECK_OPTIONAL_PACKAGE([HAL], [hal-storage], [0.5.7], [hal], [HAL support], [yes])
if test x"$HAL_FOUND" = x"yes"; then
  dnl # substituted into exo-hal-0.3.pc
  HAL_STORAGE_DEPENDENCY="hal-storage"

  dnl # Check if LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL is declared
  save_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS $HAL_CFLAGS"
  AC_MSG_CHECKING([whether LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL is declared])
  AC_COMPILE_IFELSE(AC_LANG_SOURCE(
  [#include <libhal-storage.h>
    int main (int argc, char **argv) { return LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL; }
  ]),
  [
    AC_DEFINE([HAVE_LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL], [1], [Define if LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL present])
    AC_MSG_RESULT([yes])
  ],
  [
    AC_MSG_RESULT([no])
  ])
  CFLAGS="$save_CFLAGS"
fi
AC_SUBST([HAL_STORAGE_DEPENDENCY])

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

dnl ***********************************
dnl *** Check for python (optional) ***
dnl ***********************************
AC_ARG_ENABLE([python], 
  [AC_HELP_STRING([--enable-python], [build python bindings])],
  [enable_python=$enableval],
  [enable_python=auto])
have_python=no
if test x"$enable_python" != x"no"; then
  AC_MSG_NOTICE([Checking to see if we can build Python bindings])
  AM_PATH_PYTHON([2.2],, [:])

  if test x"$PYTHON" = x":"; then
    AC_MSG_WARN([Python not found])
  else
    XDT_CHECK_PYTHON_HEADERS([have_python_headers=yes],[have_python_headers=no])
    XDT_CHECK_PACKAGE([PYGTK], [pygtk-2.0], [2.4.0], \
                      [have_pygtk=yes], [have_pygtk=no])

    AC_PATH_PROG([PYGTK_CODEGEN], [pygtk-codegen-2.0], [no])

    if test x"$have_python_headers" = x"yes" -a x"$have_pygtk" = x"yes" -a x"$PYGTK_CODEGEN" != x"no"; then
      have_python=yes

      AC_MSG_CHECKING([for PyGTK defs])
      PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
      AC_MSG_RESULT([$PYGTK_DEFSDIR])
      AC_SUBST([PYGTK_DEFSDIR])

      dnl Check whether the compiler accepts -fno-strict-aliasing,
      dnl which is required to compile the source generated by
      dnl pygtk-codegen-2.0 with gcc 3.x.
      save_CPPFLAGS="$CPPFLAGS"
      CPPFLAGS="$CPPFLAGS -fno-strict-aliasing"
      AC_MSG_CHECKING([whether $CC accepts -fno-strict-aliasing])
      AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
        AC_MSG_RESULT([yes])
        PYGTK_CFLAGS="$PYGTK_CFLAGS -fno-strict-aliasing"
      ], [
        AC_MSG_RESULT([no])
      ])
      CPPFLAGS="$save_CPPFLAGS"
    fi
  fi

  if test x"$have_python" = x"no"; then
    if test x"$enable_python" = x"yes"; then
      AC_MSG_ERROR([Building python explicitly requested, but cannot build python bindings])
    else
      AC_MSG_WARN([Couldn't find either PyGTK or the Python headers, not building Python bindings])
    fi
  fi
fi
AM_CONDITIONAL([HAVE_PYTHON], [test x"$have_python" = x"yes"])

dnl **************************
dnl *** Check for xsltproc ***
dnl **************************
AC_ARG_ENABLE([xsltproc], [AC_HELP_STRING([--enable-xsltproc], [Use xsltproc to build documentation [default=no]])],, [enable_xsltproc=no])
if test x"$enable_xsltproc" = x"yes"; then
  AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
  if test x"$XSLTPROC" = x"no"; then
    enable_xsltproc=no
  fi
fi
AM_CONDITIONAL([ENABLE_XSLTPROC], [test x"$enable_xsltproc" = x"yes"])

dnl ************************
dnl *** Check for xml2po ***
dnl ************************
AC_ARG_ENABLE([xml2po], [AC_HELP_STRING([--enable-xml2po], [Use xml2po to translate documentation @<:@default=no@:>@])],, [enable_xml2po=no])
if test x"$enable_xml2po" = x"yes"; then
  AC_PATH_PROG([XML2PO], [xml2po], [no])
  if test x"$XML2PO" = x"no"; then
    enable_xml2po=no
  fi
fi
AM_CONDITIONAL([ENABLE_XML2PO], [test x"$enable_xml2po" = x"yes"])

dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@], [Turn on debugging @<:@default=libexo_debug_default@:>@]),
  [], [enable_debug=libexo_debug_default])
AC_MSG_CHECKING([whether to enable debugging support])
if test x"$enable_debug" = x"yes" -o x"$enable_debug" = x"full"; then
  dnl Print the result
  AC_MSG_RESULT([$enable_debug])

  dnl Make sure we detect possible errors (if supported)
  save_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -Wall -Werror"
  AC_MSG_CHECKING([whether $CC accepts -Wall -Werror])
  AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
    AC_MSG_RESULT([yes])
  ], [
    CFLAGS="$save_CFLAGS"
    AC_MSG_RESULT([no])
  ])

  dnl Paranoia for --enable-debug=full
  if test x"$enable_debug" = x"full"; then
    dnl Enable extensive debugging
    CFLAGS="$CFLAGS -DG_ENABLE_DEBUG"

    dnl Use -O0 -g3 if the compiler supports it
    save_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -O0 -g3"
    AC_MSG_CHECKING([whether $CC accepts -O0 -g3])
    AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
      AC_MSG_RESULT([yes])
    ], [
      CFLAGS="$save_CFLAGS"
      AC_MSG_RESULT([no])
    ])
  fi
else
  dnl Print the result
  AC_MSG_RESULT([$enable_debug])

  dnl Disable debugging (release build)
  CFLAGS="$CFLAGS -DNDEBUG"

  dnl Disable object cast checks
  CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS"

  dnl Disable all checks for --enable-debug=no
  if test x"$enable_debug" = x"no"; then
    CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
  fi
fi

dnl **************************************
dnl *** Check for linker optimizations ***
dnl **************************************
AC_MSG_CHECKING([whether $LD accepts --as-needed])
case `$LD --as-needed -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
  LDFLAGS="$LDFLAGS -Wl,--as-needed"
  AC_MSG_RESULT([yes])
  ;;
*)
  AC_MSG_RESULT([no])
  ;;
esac
AC_MSG_CHECKING([whether $LD accepts -O1])
case `$LD -O1 -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
  LDFLAGS="$LDFLAGS -Wl,-O1"
  AC_MSG_RESULT([yes])
  ;;
*)
  AC_MSG_RESULT([no])
  ;;
esac

dnl ****************************************
dnl *** Check for ELF visibility support ***
dnl ****************************************
AC_ARG_ENABLE([visibility], AC_HELP_STRING([--disable-visibility], [Don't 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 __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"])

AC_OUTPUT([
Makefile
docs/Makefile
docs/manual/Makefile
docs/manual/am/Makefile
docs/manual/am/exo-preferred-applications.xml
docs/manual/am/images/Makefile
docs/manual/C/Makefile
docs/manual/C/exo-preferred-applications.xml
docs/manual/C/images/Makefile
docs/manual/da/Makefile
docs/manual/da/exo-preferred-applications.xml
docs/manual/da/images/Makefile
docs/manual/es/Makefile
docs/manual/es/exo-preferred-applications.xml
docs/manual/es/images/Makefile
docs/manual/fr/Makefile
docs/manual/fr/exo-preferred-applications.xml
docs/manual/fr/images/Makefile
docs/manual/gl/Makefile
docs/manual/gl/exo-preferred-applications.xml
docs/manual/gl/images/Makefile
docs/manual/id/Makefile
docs/manual/id/exo-preferred-applications.xml
docs/manual/id/images/Makefile
docs/manual/it/Makefile
docs/manual/it/exo-preferred-applications.xml
docs/manual/it/images/Makefile
docs/manual/ja/Makefile
docs/manual/ja/exo-preferred-applications.xml
docs/manual/ja/images/Makefile
docs/manual/pt/Makefile
docs/manual/pt/exo-preferred-applications.xml
docs/manual/pt/images/Makefile
docs/manual/pt_BR/Makefile
docs/manual/pt_BR/exo-preferred-applications.xml
docs/manual/pt_BR/images/Makefile
docs/manual/tr/Makefile
docs/manual/tr/exo-preferred-applications.xml
docs/manual/tr/images/Makefile
docs/manual/ug/Makefile
docs/manual/ug/exo-preferred-applications.xml
docs/manual/ug/images/Makefile
docs/reference/Makefile
docs/reference/version.xml
exo.spec
exo/Makefile
exo/exo-0.3.pc
exo/exo-config.h
exo-csource/Makefile
exo-desktop-item-edit/Makefile
exo-hal/Makefile
exo-hal/exo-hal-0.3.pc
exo-helper/Makefile
exo-helper/helpers/Makefile
exo-mount/Makefile
exo-mount-notify/Makefile
exo-open/Makefile
exo-support/Makefile
icons/Makefile
icons/24x24/Makefile
icons/48x48/Makefile
pixmaps/Makefile
po/Makefile.in
po-doc/Makefile
python/Makefile
python/examples/Makefile
tests/Makefile
tests/data/Makefile
])

dnl ***************************
dnl *** Print configuration ***
dnl ***************************
echo
echo "Build Configuration:"
echo
if test x"$HAL_FOUND" = x"yes"; then
echo "* HAL support:    yes"
else
echo "* HAL support:    no"
fi
echo "* Debug Support:  $enable_debug"
echo "* Python Support: $have_python"
echo
