Skip to content
Snippets Groups Projects
configure.ac.in 7.26 KiB
m4_define([intltool_minimum_version], [0.31])
m4_define([xfpm_version_major],  [0])
m4_define([xfpm_version_minor],  [8])
m4_define([xfpm_version_micro],  [1.1])
m4_define([xfpm_version_build],  [])
m4_define([xfpm_version_tag],[@REVISION@])
m4_define([xfpm_version], [xfpm_version_major().xfpm_version_minor().xfpm_version_micro()ifelse(xfpm_version_tag(), [svn], [xfpm_version_tag().xfpm_version_build()], [xfpm_version_tag()])])

AC_INIT([xfce4-power-manager], [xfpm_version], [http://bugzilla.xfce.org/])
AC_PREREQ(2.50)

AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar])
AM_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE

# ===================================================== #
#               Check for UNIX variants                 #
# ===================================================== #
AC_AIX
AC_ISC_POSIX
AC_MINIX

# ===================================================== #
#               Basic compiler settings                 #
# ===================================================== #
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_LD
AC_PROG_INSTALL
AC_PROG_INTLTOOL([intltool_minimum_version], [no-xml])

# ===================================================== #
#               Initialize libtool                      #
# ===================================================== #
AC_DISABLE_STATIC
AC_PROG_LIBTOOL

# ==================================================== #
#   Check for headers needed for standard interfaces   #
# ==================================================== #
AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h signal.h stddef.h \
                  string.h sys/stat.h sys/types.h sys/wait.h time.h \
                  unistd.h])

# ===================================================== #
# 		Check for i18n support 			#
# ===================================================== #

XDT_I18N([@LINGUAS@])

#==================================================== #
#          Check for required packages 		      #
#=====================================================#
m4_define([gtk_minimum_version], [2.12.0])
m4_define([glib_minimum_version], [2.16.0]) 
m4_define([dbus_minimum_version], [0.60])
m4_define([dbus_glib_minimum_version], [0.70])

m4_define([xfconf_minimum_version], [4.6.0])
m4_define([libxfcegui4_minimum_version],[4.6.0])
m4_define([libxfce4util_minimum_version],[4.6.0])
m4_define([libxfce4panel_minimum_version],[4.6.0])

m4_define([libnotify_minimum_version], [0.4.1])

XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [gtk_minimum_version])
XDT_CHECK_PACKAGE([GLIB], [glib-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([GMODULE], [gmodule-2.0], [glib_minimum_version])
XDT_CHECK_PACKAGE([DBUS], [dbus-1], [dbus_minimum_version])
XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [dbus_glib_minimum_version])
XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0],[xfconf_minimum_version])
XDT_CHECK_PACKAGE([LIBXFCE4GUI], [libxfcegui4-1.0],[libxfcegui4_minimum_version])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0],[libxfce4util_minimum_version])
XDT_CHECK_PACKAGE([LIBNOTIFY],[libnotify], [libnotify_minimum_version])

#=======================================================#
#           Check for DPMS support                      #
#=======================================================#
DPMS_LIBS=
AC_ARG_ENABLE([dpms],
AC_HELP_STRING([--enable-dpms], [use dpms extension])
AC_HELP_STRING([--disable-dpms], [don't use dpms extension]),
  [], [enable_dpms=yes])
have_dpms="no"
if test x"$enable_dpms" = x"yes"; then
     AC_CHECK_LIB([Xext], [DPMSQueryExtension],
        [ have_dpms="yes"
          DPMS_LIBS=" -lXext -lX11"
          AC_DEFINE([HAVE_DPMS], [1], [Define to enable dpms])
        ],[])
fi
AC_SUBST([DPMS_LIBS])

#=======================================================#
#      Check for XF86_XK_Suspend && Hibernate           #
#=======================================================#

AC_CHECK_DECL(XF86XK_Suspend,have_XF86XK_Suspend=1,have_XF86XK_Suspend=0,[#include <X11/XF86keysym.h>])
if test "x${ac_cv_have_decl_XF86XK_Suspend}" != "xno"; then
  AC_DEFINE(HAVE_XF86XK_SUSPEND, 1, [Define if XF86XK_Suspend is available])
fi
AC_CHECK_DECL(XF86XK_Hibernate,have_XF86XK_Hibernate=1,have_XF86XK_Hibernate=0,[#include <X11/XF86keysym.h>])
if test "x${ac_cv_have_decl_XF86XK_Hibernate}" != "xno"; then
  AC_DEFINE(HAVE_XF86XK_HIBERNATE, 1, [Define if XF86XK_Hibernate is available])
fi

#=======================================================#
#                 Panel plugins ?                       #
#=======================================================#
AC_ARG_ENABLE([panel_plugins],
	[AC_HELP_STRING([--disable-panel-plugins],
		[Do not build panel plugins (default=enabled)])],
	[ac_cv_enable_panel_plugins=$enableval],
	[ac_cv_enable_panel_plugins=yes])
if test "x$ac_cv_enable_panel_plugins" = "xno"; then
	build_panel_plugins="no"
else
	build_panel_plugins="yes"
	XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0],
		[libxfce4panel_minimum_version])
fi
AM_CONDITIONAL([BUILD_PANEL_PLUGINS], [test "x$build_panel_plugins" = "xyes"])

#=======================================================#
#              Generate html doc		        #
#=======================================================#
AC_ARG_ENABLE([xsltproc],
              [AC_HELP_STRING([--enable-xsltproc],
                              [Use xsltproc to generate HTML documentation @<:@default=no@:>@])],
                              , [enable_xsltproc=no])
if test "x$enable_xsltproc" = "xyes"; then
    AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
    if test "x$XSLTPROC" = "xno"; then
        AC_MSG_FAILURE([*** xsltproc was requested, but not found.])
    fi
fi
AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$enable_xsltproc" = "xyes"])

#=======================================================#
#              Support for doc translations	        #
#=======================================================#
AC_ARG_ENABLE([xml2po],
              [AC_HELP_STRING([--enable-xml2po],
                              [Use xml2po to translate documentation @<:@default=no@:>@])],
              [], [enable_xml2po=no])
if test "x$enable_xml2po" = "xyes"; then
    AC_PATH_PROG([XML2PO], [xml2po], [no])
    if test "x$XML2PO" = "xno"; then
        AC_MSG_FAILURE([*** xml2po was requested, but not found.])
    fi
fi
AM_CONDITIONAL([ENABLE_XML2PO], [test "x$enable_xml2po" = "xyes"])

#=======================================================#
#              Check for debugging support              #
#=======================================================#
XDT_FEATURE_DEBUG

AC_OUTPUT([
Makefile
libxfpm/Makefile
src/Makefile
settings/Makefile
panel-plugins/Makefile
panel-plugins/brightness/Makefile
data/Makefile
data/icons/Makefile
data/icons/scalable/Makefile
data/icons/scalable/status/Makefile
data/icons/scalable/actions/Makefile
data/interfaces/Makefile
doc/Makefile
doc/C/Makefile
doc/C/xfce4-power-manager.xml
doc/C/images/Makefile
po/Makefile.in
])

echo "
--------------------------------------------------
 	    Xfce Power Manager $VERSION
	======================================
 
	prefix:			$prefix
	xdg autostart:		$sysconfdir/xdg/autostart
   	DPMS         support:   $have_dpms
  	Build panel  plugins:   $build_panel_plugins
   	Debug        support:   $enable_debug
--------------------------------------------------

Configuration finished, type make to compile"