[Xfce4-commits] <exo:master> Make GIO-Unix an optional package.
Nick Schermer
noreply at xfce.org
Fri Oct 23 17:46:03 CEST 2009
Updating branch refs/heads/master
to afc76d7cbf690024d4cfd819c4a2900b274290b7 (commit)
from 7963243f4f83a78b927dd93237a0c68fdd45a028 (commit)
commit afc76d7cbf690024d4cfd819c4a2900b274290b7
Author: Nick Schermer <nick at xfce.org>
Date: Fri Oct 23 14:17:23 2009 +0200
Make GIO-Unix an optional package.
configure.in.in | 50 +++++++++++++++++++++++++++----------------
exo-gio-module/Makefile.am | 4 +++
exo-mount/main.c | 3 +-
exo-open/main.c | 13 +++++++++-
4 files changed, 47 insertions(+), 23 deletions(-)
diff --git a/configure.in.in b/configure.in.in
index 43bee55..6cf58ff 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -160,24 +160,26 @@ dnl *** Check for required packages ***
dnl ***********************************
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.18.0])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.18.0])
-XDT_CHECK_PACKAGE([GIO_UNIX], [gio-unix-2.0], [2.18.0])
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.16.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.2.2])
-dnl ****************************
-dnl *** GIO modules location ***
-dnl ****************************
-AC_ARG_WITH([gio-module-dir],
- [AC_HELP_STRING([--with-gio-module-dir=PATH],
- [Specify where to install the exo gio module (default=autodetect)])],
- [gio_module_dir="$withval"])
-if test x"$gio_module_dir" = x""; then
- GIOMODULEDIR="`$PKG_CONFIG gio-2.0 --variable giomoduledir`"
-elif test x"$gio_module_dir" = x"distcheck"; then
- GIOMODULEDIR=""
-else
- GIOMODULEDIR="$gio_module_dir"
+dnl *************************************
+dnl *** Check for GIO-Unix (optional) ***
+dnl *************************************
+XDT_CHECK_OPTIONAL_PACKAGE([GIO_UNIX], [gio-unix-2.0], [2.18.0], [gio-unix], [GIO-Unix features], [yes])
+GIOMODULEDIR=""
+if test x"$GIO_UNIX_FOUND" = x"yes"; then
+ dnl GIO directory for extensions
+ AC_ARG_WITH([gio-module-dir],
+ [AC_HELP_STRING([--with-gio-module-dir=PATH],
+ [Specify where to install the exo gio module (default=autodetect)])],
+ [gio_module_dir="$withval"])
+ if test x"$gio_module_dir" = x""; then
+ GIOMODULEDIR="`$PKG_CONFIG gio-2.0 --variable giomoduledir`"
+ elif test x"$gio_module_dir" != x"distcheck"; then
+ GIOMODULEDIR="$gio_module_dir"
+ fi
fi
AC_SUBST([GIOMODULEDIR])
AM_CONDITIONAL([HAVE_GIO_MODULEDIR], [test x"$GIOMODULEDIR" != x""])
@@ -414,11 +416,21 @@ echo
echo "Build Configuration:"
echo
if test x"$HAL_FOUND" = x"yes"; then
-echo "* HAL support: yes"
+echo "* HAL support: yes"
+else
+echo "* HAL support: no"
+fi
+if test x"$LIBNOTIFY_FOUND" = x"yes"; then
+echo "* Notification support: yes"
+else
+echo "* Notification support: no"
+fi
+if test x"$GIO_UNIX_FOUND" = x"yes"; then
+echo "* GIO-Unix features: yes"
+echo " - GIO Module Dir: $GIOMODULEDIR"
else
-echo "* HAL support: no"
+echo "* GIO-Unix features: no"
fi
-echo "* GIO Module Dir: $GIOMODULEDIR"
-echo "* Debug Support: $enable_debug"
-echo "* Python Support: $have_python"
+echo "* Debug Support: $enable_debug"
+echo "* Python Support: $have_python"
echo
diff --git a/exo-gio-module/Makefile.am b/exo-gio-module/Makefile.am
index 2101fc6..921d9ab 100644
--- a/exo-gio-module/Makefile.am
+++ b/exo-gio-module/Makefile.am
@@ -7,6 +7,8 @@ INCLUDES = \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DLIBEXO_VERSION_API=\"$(LIBEXO_VERSION_API)\"
+if HAVE_GIO_UNIX
+
if HAVE_GIO_MODULEDIR
exomoduledir = \
$(GIOMODULEDIR)
@@ -44,4 +46,6 @@ libexo_module_1_la_LIBADD = \
$(LIBXFCE4UTIL_LIBS) \
$(top_builddir)/exo/libexo-$(LIBEXO_VERSION_API).la
+endif
+
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/exo-mount/main.c b/exo-mount/main.c
index 1ce40f8..a351020 100644
--- a/exo-mount/main.c
+++ b/exo-mount/main.c
@@ -45,7 +45,6 @@
#include <glib/gstdio.h>
#include <gio/gio.h>
-#define HAVE_GIO_UNIX
#ifdef HAVE_GIO_UNIX
#include <gio/gunixmounts.h>
#endif
@@ -275,7 +274,7 @@ main (gint argc, gchar **argv)
}
#ifndef HAVE_GIO_UNIX
- g_warning (_("%s is not compiled with GIO-Unix support. Therefore it will "
+ g_warning (_("%s is compiled without GIO-Unix features. Therefore it will "
"probably not work on this system."), g_get_prgname ());
#endif
diff --git a/exo-open/main.c b/exo-open/main.c
index 37426b8..b556186 100644
--- a/exo-open/main.c
+++ b/exo-open/main.c
@@ -33,7 +33,9 @@
#include <glib/gstdio.h>
#include <gio/gio.h>
+#ifdef HAVE_GIO_UNIX
#include <gio/gdesktopappinfo.h>
+#endif
#include <exo/exo.h>
@@ -117,6 +119,7 @@ usage (void)
static gboolean
exo_open_launch_desktop_file (const gchar *arg)
{
+#ifdef HAVE_GIO_UNIX
GFile *gfile;
gchar *contents;
gsize length;
@@ -157,13 +160,19 @@ exo_open_launch_desktop_file (const gchar *arg)
else
result = FALSE;
+ g_object_unref (G_OBJECT (appinfo));
+
#ifndef NDEBUG
g_debug ("launching desktop file %s", result ? "succeeded" : "failed");
#endif
- g_object_unref (G_OBJECT (appinfo));
-
return result;
+#else /* !HAVE_GIO_UNIX */
+ g_critical (_("Launching desktop files is not supported when %s is compiled "
+ "without GIO-Unix features."), g_get_prgname ());
+
+ return FALSE;
+#endif
}
More information about the Xfce4-commits
mailing list