[ostree] Support building with embedded libsoup



commit 10bf223f0a71031b7e0749760f517155f852cb6b
Author: Colin Walters <walters verbum org>
Date:   Thu Jun 14 16:22:23 2012 -0400

    Support building with embedded libsoup

 Makefile-ostree.am                       |    4 +-
 Makefile.am                              |   35 ++++++++++++------
 configure.ac                             |   58 +++++++++++++++--------------
 embedded-dependencies/Makefile.am        |   31 +++++++++++++---
 embedded-dependencies/Makefile.bootstrap |    5 ++-
 5 files changed, 84 insertions(+), 49 deletions(-)
---
diff --git a/Makefile-ostree.am b/Makefile-ostree.am
index 628d9a1..b5b07b4 100644
--- a/Makefile-ostree.am
+++ b/Makefile-ostree.am
@@ -57,8 +57,8 @@ ostree_pull_SOURCES = src/ostree/ot-main.h \
 	src/ostree/ostree-fetcher.c \
 	src/ostree/ostree-pull.c
 
-ostree_pull_CFLAGS = $(ostree_bin_shared_cflags) $(OT_DEP_SOUP_CFLAGS)
-ostree_pull_LDADD = $(ostree_bin_shared_ldadd) $(OT_DEP_SOUP_LIBS)
+ostree_pull_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS)
+ostree_pull_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS)
 endif
 
 MANPAGES += doc/ostree.1
diff --git a/Makefile.am b/Makefile.am
index af35877..7ff7d49 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,7 +20,7 @@ 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
+if BUILD_EMBEDDED_DEPENDENCIES
 SUBDIRS = embedded-dependencies .
 else
 SUBDIRS = .
@@ -40,22 +40,32 @@ noinst_PROGRAMS =
 privlibdir = $(pkglibdir)
 privlib_LTLIBRARIES =
 
-if BUILD_EMBEDDED_GLIB
+if BUILD_EMBEDDED_DEPENDENCIES
 OT_INTERNAL_GIO_UNIX_CFLAGS = \
-	-I$(top_builddir)/embedded-dependencies/install-glib/EMBEDGLIB/include/glib-2.0 \
-	-I$(top_builddir)/embedded-dependencies/install-glib/EMBEDGLIB/include/gio-unix-2.0 \
-	-I$(top_builddir)/embedded-dependencies/install-glib/EMBEDGLIB/lib/glib-2.0/include \
+	-I$(top_builddir)/embedded-dependencies/EMBEDDEPS/include/glib-2.0 \
+	-I$(top_builddir)/embedded-dependencies/EMBEDDEPS/include/gio-unix-2.0 \
+	-I$(top_builddir)/embedded-dependencies/EMBEDDEPS/lib/glib-2.0/include \
 	$(NULL)
 OT_INTERNAL_GIO_UNIX_LIBS = \
-	$(top_builddir)/embedded-dependencies/install-glib/EMBEDGLIB/lib/libglib-2.0.so \
-	$(top_builddir)/embedded-dependencies/install-glib/EMBEDGLIB/lib/libgthread-2.0.so \
-	$(top_builddir)/embedded-dependencies/install-glib/EMBEDGLIB/lib/libgmodule-2.0.so \
-	$(top_builddir)/embedded-dependencies/install-glib/EMBEDGLIB/lib/libgobject-2.0.so \
-	$(top_builddir)/embedded-dependencies/install-glib/EMBEDGLIB/lib/libgio-2.0.so \
+	$(top_builddir)/embedded-dependencies/EMBEDDEPS/lib/libglib-2.0.so \
+	$(top_builddir)/embedded-dependencies/EMBEDDEPS/lib/libgthread-2.0.so \
+	$(top_builddir)/embedded-dependencies/EMBEDDEPS/lib/libgmodule-2.0.so \
+	$(top_builddir)/embedded-dependencies/EMBEDDEPS/lib/libgobject-2.0.so \
+	$(top_builddir)/embedded-dependencies/EMBEDDEPS/lib/libgio-2.0.so \
+	$(NULL)
+OT_INTERNAL_SOUP_CFLAGS = \
+	$(OT_INTERNAL_GIO_UNIX_CFLAGS) \
+	-I$(top_builddir)/embedded-dependencies/EMBEDDEPS/include/libsoup-2.4 \
+	$(NULL)
+OT_INTERNAL_SOUP_LIBS = \
+	$(OT_INTERNAL_GIO_UNIX_LIBS) \
+	$(top_builddir)/embedded-dependencies/EMBEDDEPS/lib/libsoup-2.4.so \
 	$(NULL)
 else
 OT_INTERNAL_GIO_UNIX_CFLAGS = $(OT_DEP_GIO_UNIX_CFLAGS)
 OT_INTERNAL_GIO_UNIX_LIBS = $(OT_DEP_GIO_UNIX_LIBS)
+OT_INTERNAL_SOUP_CFLAGS = $(OT_DEP_SOUP_CFLAGS)
+OT_INTERNAL_SOUP_LIBS = $(OT_DEP_SOUP_LIBS)
 endif
 
 include Makefile-daemon.am
@@ -108,8 +118,11 @@ endif
 release-tag:
 	git tag -m "Release $(VERSION)" v$(VERSION)
 
+embed_dependency=tar --append --exclude='.git/*' --transform='s,^embedded-dependencies/,ostree-embeddeps-$(VERSION)/embedded-dependencies/,' --file=ostree-embeddeps-$(VERSION).tar.tmp
+
 release-tarball-embedded:
 	git archive --format=tar --prefix=ostree-embeddeps-$(VERSION)/ HEAD > ostree-embeddeps-$(VERSION).tar.tmp
-	tar --append --exclude='.git/*' --transform='s,^embedded-dependencies/,ostree-embeddeps-$(VERSION)/embedded-dependencies/,' --file=ostree-embeddeps-$(VERSION).tar.tmp embedded-dependencies/glib
+	$(embed_dependency) embedded-dependencies/glib
+	$(embed_dependency) embedded-dependencies/libsoup
 	mv ostree-embeddeps-$(VERSION).tar{.tmp,}
 	gzip -f ostree-embeddeps-$(VERSION).tar 
diff --git a/configure.ac b/configure.ac
index ad55256..a82e4c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,17 +26,38 @@ AC_CHECK_HEADER([attr/xattr.h],,[AC_MSG_ERROR([You must have attr/xattr.h from l
 
 PKG_PROG_PKG_CONFIG
 
-AC_ARG_ENABLE(embedded-glib,
-	    AS_HELP_STRING([--enable-embedded-glib], [Use embedded GLib copy]),,
-	    enable_embedded_glib=no)
-AM_CONDITIONAL(BUILD_EMBEDDED_GLIB, test x$enable_embedded_glib = xyes)
-if test x$enable_embedded_glib = xyes; then
-  echo "NOTICE: Embedded glib enabled"
+AC_ARG_ENABLE(embedded-dependencies,
+	    AS_HELP_STRING([--enable-embedded-dependencies], [Use embedded GLib and libsoup copies]),,
+	    enable_embedded_dependencies=no)
+AM_CONDITIONAL(BUILD_EMBEDDED_DEPENDENCIES, test x$enable_embedded_dependencies = xyes)
+if test x$enable_embedded_dependencies = xyes; then
+  echo "NOTICE: Embedded dependencies (GLib and libsoup) enabled"
+  with_soup=yes
 else
   GIO_DEPENDENCY="gio-unix-2.0 >= 2.28"
   PKG_CHECK_MODULES(OT_DEP_GIO_UNIX, $GIO_DEPENDENCY)
+
+  SOUP_DEPENDENCY="libsoup-2.4 >= 2.39.1"
+  AC_ARG_WITH(soup-gnome,
+	    AS_HELP_STRING([--without-soup-gnome], [Do not use libsoup-gnome (implies no pull support)]),
+	    :, with_soup=maybe)
+  if test x$with_soup != xno; then
+    AC_MSG_CHECKING([for $SOUP_DEPENDENCY])
+    PKG_CHECK_EXISTS($SOUP_DEPENDENCY, have_soup_gnome=yes, have_soup_gnome=no)
+    AC_MSG_RESULT([$have_soup_gnome])
+    if test x$have_soup_gnome = xno && test x$with_soup != xmaybe; then
+       AC_MSG_ERROR([libsoup-gnome is enabled but could not be found])
+    fi
+    if test x$have_soup_gnome = xyes; then
+	PKG_CHECK_MODULES(OT_DEP_SOUP, $SOUP_DEPENDENCY)
+	with_soup=yes
+    else
+	with_soup=no
+    fi		
+  fi
 fi
-SOUP_DEPENDENCY="libsoup-2.4 >= 2.39.1"
+AM_CONDITIONAL(USE_LIBSOUP_GNOME, test x$enable_embedded_dependencies = xyes || x$with_soup != xno)
+
 LIBARCHIVE_DEPENDENCY="libarchive >= 2.8.0"
 
 AC_ARG_ENABLE(documentation,
@@ -51,25 +72,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)
-if test x$with_soup_gnome != xno; then
-    AC_MSG_CHECKING([for $SOUP_DEPENDENCY])
-    PKG_CHECK_EXISTS($SOUP_DEPENDENCY, have_soup_gnome=yes, have_soup_gnome=no)
-    AC_MSG_RESULT([$have_soup_gnome])
-    if test x$have_soup_gnome = xno && test x$with_soup_gnome != xmaybe; then
-       AC_MSG_ERROR([libsoup-gnome is enabled but could not be found])
-    fi
-    if test x$have_soup_gnome = xyes; then
-	PKG_CHECK_MODULES(OT_DEP_SOUP, $SOUP_DEPENDENCY)
-	with_soup_gnome=yes
-    else
-	with_soup_gnome=no
-    fi		
-fi
-AM_CONDITIONAL(USE_LIBSOUP_GNOME, test $with_soup_gnome != no)
-
 AC_ARG_WITH(libarchive,
 	    AS_HELP_STRING([--without-libarchive], [Do not use libarchive]),
 	    :, with_libarchive=maybe)
@@ -101,7 +103,7 @@ echo "
     ===============
 
 
-    embedded GLib: $enable_embedded_glib
-    libsoup (retrieve remote HTTP repositories): $with_soup_gnome
+    embedded dependencies: $enable_embedded_dependencies
+    libsoup (retrieve remote HTTP repositories): $with_soup
     libarchive (parse tar files directly): $with_libarchive
 "
diff --git a/embedded-dependencies/Makefile.am b/embedded-dependencies/Makefile.am
index 3860f4c..9c33760 100644
--- a/embedded-dependencies/Makefile.am
+++ b/embedded-dependencies/Makefile.am
@@ -20,21 +20,40 @@
 build-glib/gio/libgio-2.0.la:
 	mkdir -p build-glib
 	(srcdir=$$(cd $(srcdir) && pwd); \
+	 builddir=$$(pwd); \
 	 cd build-glib; \
-         $${srcdir}/glib/autogen.sh --prefix=/EMBEDGLIB --disable-introspection --disable-man --disable-gtk-doc && \
+         $${srcdir}/glib/autogen.sh --prefix=$${builddir}/EMBEDDEPS --disable-introspection \
+	    --disable-man --disable-gtk-doc && \
 	 $(MAKE))
 
-install-glib/EMBEDGLIB/include/glib-2.0/glib.h: build-glib/gio/libgio-2.0.la
+EMBEDDEPS/include/glib-2.0/glib.h: build-glib/gio/libgio-2.0.la
 	(top_srcdir=$$(cd $(top_srcdir) && pwd); \
 	 builddir=$$(pwd); \
 	 cd build-glib && \
-         rm -rf install-glib && \
-	 $(MAKE) install DESTDIR=$${builddir}/install-glib)
+	 $(MAKE) install)
+
+build-libsoup/libsoup/libsoup-2.4.la: EMBEDDEPS/include/glib-2.0/glib.h
+	mkdir -p build-libsoup
+	(srcdir=$$(cd $(srcdir) && pwd); \
+	 builddir=$$(pwd); \
+	 cd build-libsoup; \
+	 env PATH=$${builddir}/EMBEDDEPS/bin:$$PATH \
+	     PKG_CONFIG_PATH=$${builddir}/EMBEDDEPS/lib/pkg-config \
+         $${srcdir}/libsoup/autogen.sh --prefix=$${builddir}/EMBEDDEPS --disable-introspection \
+	    --disable-soup-gnome --disable-gtk-doc --disable-tls-check --without-apache-httpd \
+	    --without-ntlm-auth && \
+	 $(MAKE))
+
+EMBEDDEPS/include/libsoup-2.4/libsoup/soup.h: build-libsoup/libsoup/libsoup-2.4.la
+	(top_srcdir=$$(cd $(top_srcdir) && pwd); \
+	 builddir=$$(pwd); \
+	 cd build-libsoup && \
+	 $(MAKE) install)
 
-all-local: install-glib/EMBEDGLIB/include/glib-2.0/glib.h
+all-local: EMBEDDEPS/include/libsoup-2.4/libsoup/soup.h
 
 install-exec-local: 
 	echo `pwd`
 	$(MKDIR_P) $(DESTDIR)/$(pkglibdir)
-	install install-glib/EMBEDGLIB/lib/*.so.* $(DESTDIR)/$(pkglibdir)
+	install EMBEDDEPS/lib/*.so.* $(DESTDIR)/$(pkglibdir)
 
diff --git a/embedded-dependencies/Makefile.bootstrap b/embedded-dependencies/Makefile.bootstrap
index 95ca2a9..4a90edd 100644
--- a/embedded-dependencies/Makefile.bootstrap
+++ b/embedded-dependencies/Makefile.bootstrap
@@ -1,2 +1,3 @@
-embedded-glib-download:
-	test -d glib || git clone --depth=1 git://git.gnome.org/glib -b glib-2-32 glib
+embedded-deps-download:
+	test -d glib || git clone --depth=1 git://git.gnome.org/glib -b master glib
+	test -d libsoup || git clone --depth=1 git://git.gnome.org/libsoup -b master libsoup



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