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

dnl $Id$
dnl
dnl Copyright (c) 2007 The Xfce development team.
dnl All rights reserved.
dnl
dnl Written for Xfce by Jannis Pohlmann <jannis@xfce.org>.
dnl

dnl ***************************
dnl *** Version information ***
dnl ***************************
m4_define([libxfce4menu_verinfo], [0:0:0])
m4_define([libxfce4menu_version_api_major], [0])
m4_define([libxfce4menu_version_api_minor], [1])
m4_define([libxfce4menu_version_major], [4])
m4_define([libxfce4menu_version_minor], [6])
m4_define([libxfce4menu_version_micro], [2])
m4_define([libxfce4menu_version_nano], [])
m4_define([libxfce4menu_version_build], [5dd7c77])
m4_define([libxfce4menu_version_tag], [])
m4_define([libxfce4menu_version], [libxfce4menu_version_major().libxfce4menu_version_minor().libxfce4menu_version_micro()ifelse(libxfce4menu_version_nano(), [], [], [.libxfce4menu_version_nano()])ifelse(libxfce4menu_version_tag(), [git], [libxfce4menu_version_tag()-libxfce4menu_version_build()], [libxfce4menu_version_tag()])])

dnl ********************************************
dnl *** Full debug support for GIT snapshots ***
dnl ********************************************
m4_define([libxfce4menu_debug_default], [ifelse(libxfce4menu_version_tag(), [git], [full], [minimum])])

dnl ***************************
dnl *** Initialize autoconf ***
dnl ***************************
AC_COPYRIGHT([Copyright (c) 2009 The Xfce development team.
All rights reserved.
        
Written for Xfce by Jannis Pohlmann <jannis@xfce.org>.])
AC_INIT([libxfce4menu], [libxfce4menu_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 **************************
LIBXFCE4MENU_VERINFO=libxfce4menu_verinfo()
AC_SUBST([LIBXFCE4MENU_VERINFO])

dnl ****************************
dnl *** Subst libxfce4menu version ***
dnl ****************************
LIBXFCE4MENU_VERSION_MAJOR=libxfce4menu_version_major()
LIBXFCE4MENU_VERSION_MINOR=libxfce4menu_version_minor()
LIBXFCE4MENU_VERSION_MICRO=libxfce4menu_version_micro()
LIBXFCE4MENU_VERSION_API_MAJOR=libxfce4menu_version_api_major()
LIBXFCE4MENU_VERSION_API_MINOR=libxfce4menu_version_api_minor()
LIBXFCE4MENU_VERSION_API=$LIBXFCE4MENU_VERSION_API_MAJOR.$LIBXFCE4MENU_VERSION_API_MINOR
AC_SUBST([LIBXFCE4MENU_VERSION_MAJOR])
AC_SUBST([LIBXFCE4MENU_VERSION_MINOR])
AC_SUBST([LIBXFCE4MENU_VERSION_MICRO])
AC_SUBST([LIBXFCE4MENU_VERSION_API_MAJOR])
AC_SUBST([LIBXFCE4MENU_VERSION_API_MINOR])
AC_SUBST([LIBXFCE4MENU_VERSION_API])

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

dnl ********************************
dnl *** Check for basic programs ***
dnl ********************************
AM_PROG_AS()
AC_PROG_CC()
AC_PROG_INSTALL()
AC_PROG_INTLTOOL([0.31], [no-xml])
AC_PROG_LIBTOOL()
AM_PROG_CC_C_O()

dnl ***********************************************
dnl *** Determine the u32 type required for tdb ***
dnl ***********************************************
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([short])
AC_MSG_CHECKING([for 32bit unsigned integer])
case 4 in
$ac_cv_sizeof_int)   TDB_U32_TYPE="unsigned int" ;;
$ac_cv_sizeof_long)  TDB_U32_TYPE="unsigned long" ;;
$ac_cv_sizeof_short) TDB_U32_TYPE="unsigned short" ;;
esac
AC_SUBST([TDB_U32_TYPE])
AC_MSG_RESULT([$TDB_U32_TYPE])

dnl ***************************************
dnl *** Check for standard header files ***
dnl ***************************************
AC_HEADER_STDC()
AC_CHECK_HEADERS([fcntl.h errno.h sys/mman.h sys/stat.h sys/wait.h memory.h \
		  stdlib.h stdio.h string.h sys/types.h sys/time.h unistd.h \
		  time.h stdarg.h sys/types.h sys/uio.h sched.h ctype.h])

dnl ************************************
dnl *** Check for standard functions ***
dnl ************************************
AC_FUNC_MMAP()
dnl AC_CHECK_FUNCS([])

dnl ******************************
dnl *** Check for i18n support ***
dnl ******************************
XDT_I18N([am ast ca cs da de el en_GB es eu fi fr gl hu id it ja kk ku lv nb nl nn pa pl pt_BR pt ro ru sq sv tr ug uk ur_PK ur zh_CN ], [libxfce4menu-libxfce4menu_version_api_major().libxfce4menu_version_api_minor()])

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

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

dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@], [Turn on debugging @<:@default=libxfce4menu_debug_default@:>@]),
  [], [enable_debug=libxfce4menu_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

AC_OUTPUT([
Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/version.xml
libxfce4menu/Makefile
libxfce4menu/libxfce4menu-0.1.pc
libxfce4menu/libxfce4menu-config.h
po/Makefile.in
tdb/tdbconfig.h
tdb/Makefile
tests/Makefile
])

dnl ***************************
dnl *** Print configuration ***
dnl ***************************
echo
echo "Build Configuration:"
echo
echo "* Debug Support:  $enable_debug"
echo
