Support building with embedded glib

This commit is contained in:
Colin Walters 2012-06-07 17:21:55 -04:00
parent f3c15a9ba7
commit 78b0d99238
11 changed files with 115 additions and 16 deletions

View File

@ -24,5 +24,5 @@ ostreed_SOURCES = src/daemon/ostreed.c \
src/daemon/ot-daemon.c \
$(NULL)
ostreed_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/daemon -DLOCALEDIR=\"$(datadir)/locale\" $(OT_DEP_GIO_UNIX_CFLAGS)
ostreed_LDADD = libotutil.la libostree.la $(OT_DEP_GIO_UNIX_LIBS)
ostreed_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/daemon -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
ostreed_LDADD = libotutil.la libostree.la $(OT_INTERNAL_GIO_UNIX_LIBS)

View File

@ -46,9 +46,9 @@ libostree_la_SOURCES += src/libostree/ostree-libarchive-input-stream.h \
$(NULL)
endif
libostree_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -DLOCALEDIR=\"$(datadir)/locale\" $(OT_DEP_GIO_UNIX_CFLAGS)
libostree_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
libostree_la_LDFLAGS = -avoid-version -Bsymbolic-functions
libostree_la_LIBADD = libotutil.la $(OT_DEP_GIO_UNIX_LIBS)
libostree_la_LIBADD = libotutil.la $(OT_INTERNAL_GIO_UNIX_LIBS)
if USE_LIBARCHIVE
libostree_la_CFLAGS += $(OT_DEP_LIBARCHIVE_CFLAGS)

View File

@ -25,5 +25,5 @@ ostadmin_SOURCES = src/ostadmin/main.c \
src/ostadmin/ot-admin-main.c \
$(NULL)
ostadmin_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostadmin -DLOCALEDIR=\"$(datadir)/locale\" $(OT_DEP_GIO_UNIX_CFLAGS)
ostadmin_LDADD = libotutil.la libostree.la $(OT_DEP_GIO_UNIX_LIBS)
ostadmin_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostadmin -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
ostadmin_LDADD = libotutil.la libostree.la $(OT_INTERNAL_GIO_UNIX_LIBS)

View File

@ -46,8 +46,8 @@ ostree_SOURCES = src/ostree/main.c \
ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostree -DLOCALEDIR=\"$(datadir)/locale\"
ostree_bin_shared_ldadd = libotutil.la libostree.la
ostree_CFLAGS = $(ostree_bin_shared_cflags) $(OT_DEP_GIO_UNIX_CFLAGS)
ostree_LDADD = $(ostree_bin_shared_ldadd) $(OT_DEP_GIO_UNIX_LIBS)
ostree_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS)
ostree_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS)
if USE_LIBSOUP_GNOME
bin_PROGRAMS += ostree-pull

View File

@ -39,5 +39,5 @@ libotutil_la_SOURCES = \
src/libotutil/otutil.c \
src/libotutil/otutil.h \
$(NULL)
libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(OT_DEP_GIO_UNIX_CFLAGS)
libotutil_la_LIBADD = $(OT_DEP_GIO_UNIX_LIBS)
libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
libotutil_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS)

View File

@ -36,5 +36,5 @@ EXTRA_DIST += $(triggers_SCRIPTS)
bin_PROGRAMS += ostree-run-triggers
ostree_run_triggers_SOURCES = src/triggers/ostree-run-triggers.c
ostree_run_triggers_CFLAGS = $(OT_DEP_GIO_UNIX_CFLAGS)
ostree_run_triggers_LDFLAGS = $(OT_DEP_GIO_UNIX_LIBS)
ostree_run_triggers_CFLAGS = $(OT_INTERNAL_GIO_UNIX_CFLAGS)
ostree_run_triggers_LDFLAGS = $(OT_INTERNAL_GIO_UNIX_LIBS)

View File

@ -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 =
@ -34,6 +40,24 @@ noinst_PROGRAMS =
privlibdir = $(pkglibdir)
privlib_LTLIBRARIES =
if BUILD_EMBEDDED_GLIB
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 \
$(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 \
$(NULL)
else
OT_INTERNAL_GIO_UNIX_CFLAGS = $(OT_DEP_GIO_UNIX_CFLAGS)
OT_INTERNAL_GIO_UNIX_LIBS = $(OT_DEP_GIO_UNIX_LIBS)
endif
include Makefile-daemon.am
include Makefile-otutil.am
include Makefile-libostree.am
@ -83,3 +107,9 @@ endif
release-tag:
git tag -m "Release $(VERSION)" v$(VERSION)
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
mv ostree-embeddeps-$(VERSION).tar{.tmp,}
gzip -f ostree-embeddeps-$(VERSION).tar

View File

@ -26,12 +26,19 @@ 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]),,
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"
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.39.1"
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 +51,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)
@ -86,6 +92,7 @@ AM_CONDITIONAL(USE_LIBARCHIVE, test $with_libarchive != no)
AC_CONFIG_FILES([
Makefile
embedded-dependencies/Makefile
])
AC_OUTPUT
@ -94,6 +101,7 @@ echo "
===============
embedded GLib: $enable_embedded_glib
libsoup (retrieve remote HTTP repositories): $with_soup_gnome
libarchive (parse tar files directly): $with_libarchive
"

View File

@ -0,0 +1,40 @@
# 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.
build-glib/gio/libgio-2.0.la:
mkdir -p build-glib
(srcdir=$$(cd $(srcdir) && pwd); \
cd build-glib; \
$${srcdir}/glib/autogen.sh --prefix=/EMBEDGLIB --disable-introspection --disable-man --disable-gtk-doc && \
$(MAKE))
install-glib/EMBEDGLIB/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)
all-local: install-glib/EMBEDGLIB/include/glib-2.0/glib.h
install-exec-local:
echo `pwd`
$(MKDIR_P) $(DESTDIR)/$(pkglibdir)
install install-glib/EMBEDGLIB/lib/*.so.* $(DESTDIR)/$(pkglibdir)

View File

@ -0,0 +1,2 @@
embedded-glib-download:
test -d glib || git clone --depth=1 git://git.gnome.org/glib -b glib-2-32 glib

View File

@ -0,0 +1,19 @@
To support building on older systems, this infrastructure allows
bundling libraries. At the moment, this is just GLib.
The intent of this system is that a "ostree-embeddeps.tar.gz" is
created, which can be used as input to an RPM or Debian package, which
can then be installed on older operating systems.
To create one, use:
$ cd embedded-dependencies
$ make -f Makefile.bootstrap embedded-glib-download
$ cd ..
$ make release-tarball-embedded
To build it:
$ ./configure --enable-embedded-glib ...
as usual.