[ostree/wip/embed-glib: 2/2] wip



commit 03a73242dd26df22322070958bb7110a45e8d208
Author: Colin Walters <walters verbum org>
Date:   Thu Jun 7 17:21:55 2012 -0400

    wip

 Makefile-embedded-dependencies.am |   32 ++++++++++++++++++++++++++++++++
 Makefile.am                       |    7 +++++++
 configure.ac                      |   15 +++++++++++----
 embedded-dependencies/Makefile.am |   33 +++++++++++++++++++++++++++++++++
 embedded-dependencies/README      |    1 +
 5 files changed, 84 insertions(+), 4 deletions(-)
---
diff --git a/Makefile-embedded-dependencies.am b/Makefile-embedded-dependencies.am
new file mode 100644
index 0000000..e7da008
--- /dev/null
+++ b/Makefile-embedded-dependencies.am
@@ -0,0 +1,32 @@
+# Import GLib into local tree
+#
+# Copyright (C) 2012 Colin Walters <walters verbum org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+if BUILD_EMBEDDED_GLIB
+
+OT_DEP_GIO_UNIX_CFLAGS = -I$(top_builddir)/embedded-dependencies/_install/glib/$(includedir)/glib-2.0 \
+	-I$(top_builddir)/embedded-dependencies/_install/glib/$(libdir)/glib-2.0/include \
+	$(NULL)
+OT_DEP_GIO_UNIX_LIBS = $(top_builddir)/embedded-dependencies/_install/glib/libglib-2.0.so \
+	$(top_builddir)/embedded-dependencies/_install/glib/libgthread-2.0.so \
+	$(top_builddir)/embedded-dependencies/_install/glib/libgmodule-2.0.so \
+	$(top_builddir)/embedded-dependencies/_install/glib/libgio-2.0.so \
+	$(NULL)
+
+endif
+
diff --git a/Makefile.am b/Makefile.am
index fba107f..9754193 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,6 +20,12 @@ AM_CPPFLAGS = -DDATADIR='"$(datadir)"' -DLIBEXECDIR='"$(libexecdir)"' \
 	-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_28 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_28
 AM_CFLAGS = $(WARN_CFLAGS)
 
+if BUILD_EMBEDDED_GLIB
+SUBDIRS = embedded-dependencies .
+else
+SUBDIRS = .
+endif
+
 NULL = 
 BUILT_SOURCES =
 MANPAGES =
@@ -35,6 +41,7 @@ privlibdir = $(pkglibdir)
 privlib_LTLIBRARIES =
 
 include Makefile-daemon.am
+include Makefile-embedded-dependencies.am
 include Makefile-otutil.am
 include Makefile-libostree.am
 include Makefile-ostree.am
diff --git a/configure.ac b/configure.ac
index 9b9bb2b..dcb5892 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,12 +26,18 @@ AC_CHECK_HEADER([attr/xattr.h],,[AC_MSG_ERROR([You must have attr/xattr.h from l
 
 PKG_PROG_PKG_CONFIG
 
-GIO_DEPENDENCY="gio-unix-2.0 >= 2.28"
+AC_ARG_ENABLE(embedded-glib,
+	    AS_HELP_STRING([--enable-embedded-glib], [Use embedded GLib copy]),,)
+AM_CONDITIONAL(BUILD_EMBEDDED_GLIB, test x$enable_embedded_glib = xyes)
+if test x$enable_embedded_glib = xyes; then
+  echo "NOTICE: Embedded glib enabled"
+else
+  GIO_DEPENDENCY="gio-unix-2.0 >= 2.28"
+  PKG_CHECK_MODULES(OT_DEP_GIO_UNIX, $GIO_DEPENDENCY)
+fi
 SOUP_DEPENDENCY="libsoup-2.4 >= 2.34.0"
 LIBARCHIVE_DEPENDENCY="libarchive >= 2.8.0"
 
-PKG_CHECK_MODULES(OT_DEP_GIO_UNIX, $GIO_DEPENDENCY)
-
 AC_ARG_ENABLE(documentation,
               AC_HELP_STRING([--enable-documentation],
                              [build documentation]),,
@@ -44,7 +50,6 @@ if test x$enable_documentation = xyes; then
 fi
 AM_CONDITIONAL(BUILD_DOCUMENTATION, test x$enable_documentation = xyes)
 
-
 AC_ARG_WITH(soup-gnome,
 	    AS_HELP_STRING([--without-soup-gnome], [Do not use libsoup-gnome (implies no pull support)]),
 	    :, with_soup_gnome=maybe)
@@ -95,6 +100,7 @@ AM_CONDITIONAL(BUILD_OSTBUILD, test x$enable_ostbuild = xyes)
 
 AC_CONFIG_FILES([
 Makefile
+embedded-dependencies/Makefile
 ])
 AC_OUTPUT
 
@@ -103,6 +109,7 @@ echo "
     ===============
 
 
+    embedded GLib: $enable_embedded_glib
     libsoup (retrieve remote HTTP repositories): $with_soup_gnome
     libarchive (parse tar files directly): $with_libarchive
 "
diff --git a/embedded-dependencies/Makefile.am b/embedded-dependencies/Makefile.am
new file mode 100644
index 0000000..73dc30f
--- /dev/null
+++ b/embedded-dependencies/Makefile.am
@@ -0,0 +1,33 @@
+# Import GLib into local tree
+#
+# Copyright (C) 2012 Colin Walters <walters verbum org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+embedded-glib-download:
+	(cd embedded-dependencies; git clone --depth=1 git://git.gnome.org/glib -b glib-2-32)
+
+embedded-glib-build:
+	$(MAKE) -C embedded-dependencies/glib
+	rm -rf $(top_builddir)/embedded-dependencies/_install/glib
+	$(MAKE) -C embedded-dependencies/glib install DESTDIR=$(top_builddir)/embedded-dependencies/_install/glib
+
+embedded-glib-install:
+	install embedded-dependencies/_install/glib/$(libdir)/*.so $(DESTDIR)/$(privlibdir)
+
+all-local: embedded-glib-build
+
+install-exec-local: embedded-glib-install
diff --git a/embedded-dependencies/README b/embedded-dependencies/README
new file mode 100644
index 0000000..fc383ed
--- /dev/null
+++ b/embedded-dependencies/README
@@ -0,0 +1 @@
+See Makefile-embedded-dependencies.am.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]