[glib/wip/msanchez/libmount: 123/129] Added autotools support for libmount
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/msanchez/libmount: 123/129] Added autotools support for libmount
- Date: Tue, 19 Jul 2016 12:39:14 +0000 (UTC)
commit 19ed55d1a8532dd5f6ccdb6d2cef3997f83faada
Author: Mario Sanchez Prada <mario endlessm com>
Date: Tue May 17 20:14:20 2016 +0100
Added autotools support for libmount
Check whether libmount is available at configuration time and provide
an option to explicitly enable or disable it, similar to libelf.
https://bugzilla.gnome.org/show_bug.cgi?id=522053
configure.ac | 24 ++++++++++++++++++++++++
gio/Makefile.am | 5 +++++
2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5a3368f..ede9b55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1745,6 +1745,30 @@ AS_IF([test "$have_libsystemd" = "yes"],[
AC_DEFINE([HAVE_LIBSYSTEMD],[1],[Define if libsystemd is available])
])
+dnl ************************
+dnl *** check for libmount ***
+dnl ************************
+AC_ARG_ENABLE(mount,
+ AS_HELP_STRING([--disable-libmount], [build without libmount support]))
+AS_IF([ test "x$enable_libmount" != "xno"],[
+PKG_CHECK_MODULES([LIBMOUNT], [mount >= 2.28], [have_libmount=yes], [have_libmount=maybe])
+AS_IF([ test $have_libmount = maybe ], [
+ glib_save_LIBS=$LIBS
+ AC_CHECK_HEADER([libmount/libmount.h], [:], [have_libmount=no])
+ LIBS=$glib_save_LIBS
+
+ if test $have_libmount != no; then
+ LIBMOUNT_LIBS=-lmount
+ have_libmount=yes
+ fi
+])
+])
+
+if test x$have_libmount = xyes; then
+ AC_DEFINE(HAVE_LIBMOUNT, 1, [Define if libmount is available])
+fi
+AM_CONDITIONAL(HAVE_LIBMOUNT, [test x$have_libmount = xyes])
+
dnl ****************************************
dnl *** platform dependent source checks ***
dnl ****************************************
diff --git a/gio/Makefile.am b/gio/Makefile.am
index 7248eb1..ce1c2ab 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -586,6 +586,11 @@ libgio_2_0_la_CFLAGS += -xobjective-c
libgio_2_0_la_LDFLAGS += -Wl,-framework,Foundation -Wl,-framework,AppKit
endif
+if HAVE_LIBMOUNT
+libgio_2_0_la_CFLAGS += $(LIBMOUNT_CFLAGS)
+libgio_2_0_la_LIBADD += $(LIBMOUNT_LIBS)
+endif
+
libgio_2_0_la_DEPENDENCIES = $(gio_win32_res) $(gio_def) $(platform_deps)
gio-win32-res.o: gio.rc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]