AC_PREREQ(2.63) AC_INIT([mate-power-manager], [1.6.2], [http://www.mate-desktop.org/]) AC_CONFIG_SRCDIR(src) AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-xz]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) # enable nice build output on automake1.11 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AC_PROG_CC AM_PROG_CC_C_O AC_PROG_INSTALL LT_INIT IT_PROG_INTLTOOL([0.35.0]) MATE_COMPILE_WARNINGS YELP_HELP_INIT AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) dnl --------------------------------------------------------------------------- dnl - Use strict options (default enabled for devs, disabled in releases) dnl --------------------------------------------------------------------------- dnl if .git directory is present, considering we are working in the repository if test -d ".git"; then default_strict=yes else default_strict=no fi AC_ARG_ENABLE(strict, AS_HELP_STRING([--enable-strict], [Enable strict compilation options]), enable_strict=$enableval, enable_strict=$default_strict) if test x$enable_strict != xno; then CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES" CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED" CPPFLAGS="$CPPFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE" CPPFLAGS="$CPPFLAGS -DGSEAL_ENABLE" if test "$GCC" = "yes"; then WARNINGFLAGS="$WARNINGFLAGS -Werror" fi fi AC_ARG_ENABLE(deprecated, [AS_HELP_STRING([--enable-deprecated], [Warn about deprecated usages [default=no]])],, [enable_deprecated=no]) if test "x$enable_deprecated" = "xyes"; then DISABLE_DEPRECATED="" CPPFLAGS="$CPPFLAGS $DISABLE_DEPRECATED" fi AC_ARG_ENABLE(extra-warn, [AS_HELP_STRING([--enable-extra-warn], [Enable extra warnings. gcc only. [default=no]])],, [enable_extra_warn=no]) if test "x$enable_extra_warn" = "xyes" && test "$GCC" = "yes"; then WARNINGFLAGS="$WARNINGFLAGS -Wall" WARNINGFLAGS="$WARNINGFLAGS -Wcast-align -Wno-uninitialized" WARNINGFLAGS="$WARNINGFLAGS -Wmissing-declarations" # WARNINGFLAGS="$WARNINGFLAGS -Wredundant-decls" # WARNINGFLAGS="$WARNINGFLAGS -Wmissing-noreturn" WARNINGFLAGS="$WARNINGFLAGS -Wpointer-arith" WARNINGFLAGS="$WARNINGFLAGS -Wcast-align" WARNINGFLAGS="$WARNINGFLAGS -Wwrite-strings" WARNINGFLAGS="$WARNINGFLAGS -Winit-self" WARNINGFLAGS="$WARNINGFLAGS -Wreturn-type" WARNINGFLAGS="$WARNINGFLAGS -Wformat-nonliteral" WARNINGFLAGS="$WARNINGFLAGS -Wformat-security" WARNINGFLAGS="$WARNINGFLAGS -Wmissing-include-dirs" WARNINGFLAGS="$WARNINGFLAGS -Wmissing-format-attribute" WARNINGFLAGS="$WARNINGFLAGS -Wclobbered" WARNINGFLAGS="$WARNINGFLAGS -Wempty-body" WARNINGFLAGS="$WARNINGFLAGS -Wignored-qualifiers" # WARNINGFLAGS="$WARNINGFLAGS -Wsign-compare" WARNINGFLAGS="$WARNINGFLAGS -Wtype-limits" # WARNINGFLAGS="$WARNINGFLAGS -Wuninitialized" # WARNINGFLAGS="$WARNINGFLAGS -Waggregate-return" WARNINGFLAGS="$WARNINGFLAGS -Wdeclaration-after-statement" WARNINGFLAGS="$WARNINGFLAGS -Wshadow" WARNINGFLAGS="$WARNINGFLAGS -Winline" # WARNINGFLAGS="$WARNINGFLAGS -Wswitch-enum" WARNINGFLAGS="$WARNINGFLAGS -Wmissing-parameter-type" WARNINGFLAGS="$WARNINGFLAGS -Woverride-init" WARNINGFLAGS="$WARNINGFLAGS -Wno-strict-aliasing" else WARNINGFLAGS="" fi AC_SUBST(WARNINGFLAGS) dnl --------------------------------------------------------------------------- dnl - Debugging switches (uncomment this if you want to use gdb) dnl --------------------------------------------------------------------------- CPPFLAGS="$CPPFLAGS -g" CPPFLAGS="$CPPFLAGS -fexceptions" dnl --------------------------------------------------------------------------- dnl - gettext stuff dnl --------------------------------------------------------------------------- GETTEXT_PACKAGE=AC_PACKAGE_NAME AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE(GETTEXT_PACKAGE, "AC_PACKAGE_NAME", [foo]) AM_GLIB_GNU_GETTEXT GLIB_GSETTINGS dnl ---------------------------------------------------------------------------- dnl - Library dependencies dnl ---------------------------------------------------------------------------- GTK_API_VERSION=2.0 GLIB_REQUIRED=2.13.0 GIO_REQUIRED=2.25.0 GTK_REQUIRED=2.17.7 GDK_REQUIRED=2.11.0 GNOME_KEYRING_REQUIRED=3.0.0 DBUS_REQUIRED=1.0 DBUS_GLIB_REQUIRED=0.70 LIBNOTIFY_REQUIRED=0.7.0 CAIRO_REQUIRED=1.0.0 UNIQUE_REQUIRED=0.9.4 LIBPANEL_REQUIRED=1.5.0 XRANDR_REQUIRED=1.2.0 CANBERRA_REQUIRED=0.10 UPOWER_REQUIRED=0.9.1 dnl ---------------------------------------------------------------------------- dnl GTK library version dnl ---------------------------------------------------------------------------- AC_MSG_CHECKING([which gtk+ version to compile against]) AC_ARG_WITH([gtk], [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])], [case "$with_gtk" in 2.0|3.0) ;; *) AC_MSG_ERROR([invalid gtk version specified]) ;; esac], [with_gtk=2.0]) AC_MSG_RESULT([$with_gtk]) case "$with_gtk" in 2.0) GTK_API_VERSION=2.0 GTK_REQUIRED=2.17.7 ;; 3.0) GTK_API_VERSION=3.0 GTK_REQUIRED=3.0.0 ;; esac dnl --------------------------------------------------------------------------- dnl - Check library dependencies dnl --------------------------------------------------------------------------- PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 gio-2.0 >= $GIO_REQUIRED gio-unix-2.0) PKG_CHECK_MODULES(CANBERRA, libcanberra-gtk >= $CANBERRA_REQUIRED) PKG_CHECK_MODULES(DBUS,[ dbus-glib-1 >= $DBUS_GLIB_REQUIRED dbus-1 >= $DBUS_REQUIRED gthread-2.0]) PKG_CHECK_MODULES(MATE, [ gtk+-2.0 >= $GTK_REQUIRED cairo >= $CAIRO_REQUIRED]) PKG_CHECK_MODULES(GDK, [ gdk-2.0 >= $GDK_REQUIRED gdk-x11-2.0 >= $GDK_REQUIRED]) PKG_CHECK_MODULES(X11, [ xrandr >= $XRANDR_REQUIRED xrender x11 xext xproto]) PKG_CHECK_MODULES(X11, x11 xrender) PKG_CHECK_EXISTS( [xrandr >= 1.3], [AC_DEFINE(HAVE_XRANDR_13, 1, [xrandr 1.3 available])]) PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED) dnl ---------------------------------------------------------------------------- dnl - Unique dnl ---------------------------------------------------------------------------- #PKG_CHECK_MODULES(UNIQUE, unique-1.0 >= $UNIQUE_REQUIRED) case "$with_gtk" in 2.0) LIBUNIQUE_VERSION=1.0 ;; 3.0) LIBUNIQUE_VERSION=3.0 ;; esac PKG_CHECK_MODULES(UNIQUE, unique-$LIBUNIQUE_VERSION, enable_libunique=yes, enable_libunique=no) AC_SUBST([UNIQUE_CFLAGS]) AC_SUBST([UNIQUE_LIBS]) AC_ARG_ENABLE(unique, [ --enable-unique enable the use of libunique instead of g_application or gtk_application], enable_libunique=yes,) if test "x$enable_libunique" = "xyes"; then UNIQUE_CFLAGS="$UNIQUE_CFLAGS -DUSE_UNIQUE=1" # fix for deprecated on 2.26 # unique en la version 1.0, contiene simbolos no definidos a partir de # glib 2.26, pero puede ser obviado si se utiliza -DG_CONST_RETURN=const if $PKG_CONFIG --atleast-version 2.26 glib-2.0; then UNIQUE_CFLAGS="$UNIQUE_CFLAGS -DG_CONST_RETURN=const" fi fi PKG_CHECK_MODULES(UPOWER, upower-glib >= $UPOWER_REQUIRED) dnl --------------------------------------------------------------------------- dnl - Check XF86XK_Keys dnl --------------------------------------------------------------------------- PKG_CHECK_EXISTS( [xproto >= 7.0.14], [AC_DEFINE(HAVE_XF86XK_BATTERY, 1, [Define if XF86XK_Battery is available])]) PKG_CHECK_EXISTS( [xproto >= 7.0.15], [AC_DEFINE(HAVE_XF86XK_SUSPEND, 1, [Define if XF86XK_Suspend is available]) AC_DEFINE(HAVE_XF86XK_HIBERNATE, 1, [Define if XF86XK_Hibernate is available])]) dnl --------------------------------------------------------------------------- dnl - Make paths available for source files dnl --------------------------------------------------------------------------- AC_SUBST(SYSCONFDIR, $sysconfdir) AC_SUBST(DATADIR, $datadir) AC_SUBST(BINDIR, $bindir) AC_SUBST(SBINDIR, $sbindir) dnl --------------------------------------------------------------------------- dnl - Where should we put documentation ? dnl --------------------------------------------------------------------------- AC_ARG_WITH(doc-dir, AS_HELP_STRING([--with-doc-dir=