Install a shared library

This required a fair bit of surgery because previously ostree.h
included otutil.h, but that's supposed to be a private library.
This commit is contained in:
Colin Walters 2013-07-26 19:25:07 -04:00
parent 74b2c7aab3
commit a5d43bb959
57 changed files with 162 additions and 47 deletions

View File

@ -17,59 +17,78 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
privlib_LTLIBRARIES += libostree.la
lib_LTLIBRARIES += libostree-1.la
libostree_la_SOURCES = src/libostree/ostree.h \
src/libostree/ostree-core.c \
libostreeheadersdir = $(includedir)/ostree-1
libostreeheaders_DATA = \
src/libostree/ostree.h \
src/libostree/ostree-core.h \
src/libostree/ostree-mutable-tree.h \
src/libostree/ostree-repo.h \
src/libostree/ostree-types.h \
src/libostree/ostree-repo-file.h \
src/libostree/ostree-diff.h \
$(NULL)
libostree_1_la_SOURCES = \
src/libostree/ostree-core.c \
src/libostree/ostree-checksum-input-stream.c \
src/libostree/ostree-checksum-input-stream.h \
src/libostree/ostree-chain-input-stream.c \
src/libostree/ostree-chain-input-stream.h \
src/libostree/ostree-diff.c \
src/libostree/ostree-diff.h \
src/libostree/ostree-mutable-tree.c \
src/libostree/ostree-mutable-tree.h \
src/libostree/ostree-repo.c \
src/libostree/ostree-repo-checkout.c \
src/libostree/ostree-repo-libarchive.c \
src/libostree/ostree-repo-prune.c \
src/libostree/ostree-repo-refs.c \
src/libostree/ostree-repo-traverse.c \
src/libostree/ostree-repo.h \
src/libostree/ostree-repo-private.h \
src/libostree/ostree-repo-file.c \
src/libostree/ostree-repo-file.h \
src/libostree/ostree-repo-file-enumerator.c \
src/libostree/ostree-repo-file-enumerator.h \
src/libostree/ostree-types.h \
$(NULL)
if USE_LIBARCHIVE
libostree_la_SOURCES += src/libostree/ostree-libarchive-input-stream.h \
libostree_1_la_SOURCES += src/libostree/ostree-libarchive-input-stream.h \
src/libostree/ostree-libarchive-input-stream.c \
$(NULL)
endif
libostree_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
libostree_la_LDFLAGS = -avoid-version -Bsymbolic-functions -export-symbols-regex '^ostree_'
libostree_la_LIBADD = libotutil.la $(OT_INTERNAL_GIO_UNIX_LIBS)
libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
libostree_1_la_LDFLAGS = -version-number 1:0:0 -Bsymbolic-functions -export-symbols-regex '^ostree_'
libostree_1_la_LIBADD = libotutil.la $(OT_INTERNAL_GIO_UNIX_LIBS)
if USE_LIBARCHIVE
libostree_la_CFLAGS += $(OT_DEP_LIBARCHIVE_CFLAGS)
libostree_la_LIBADD += $(OT_DEP_LIBARCHIVE_LIBS)
libostree_1_la_CFLAGS += $(OT_DEP_LIBARCHIVE_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_LIBARCHIVE_LIBS)
endif
if USE_LIBSOUP
libostree_la_SOURCES += \
libostree_1_la_SOURCES += \
src/libostree/ostree-fetcher.h \
src/libostree/ostree-fetcher.c \
src/libostree/ostree-repo-pull.c \
$(NULL)
libostree_la_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
libostree_la_LIBADD += $(OT_INTERNAL_SOUP_LIBS)
libostree_1_la_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
libostree_1_la_LIBADD += $(OT_INTERNAL_SOUP_LIBS)
endif
if BUILDOPT_INTROSPECTION
OSTree-1.0.gir: libostree-1.la Makefile
OSTree_1_0_gir_EXPORT_PACKAGES = ostree-1
OSTree_1_0_gir_INCLUDES = Gio-2.0
OSTree_1_0_gir_CFLAGS = $(libostree_1_la_CFLAGS)
OSTree_1_0_gir_LIBS = libostree-1.la
OSTree_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=Ostree --symbol-prefix=ostree
OSTree_1_0_gir_FILES = $(libostreeheaders_DATA) $(filter-out %-private.h,$(libostree_1_la_SOURCES))
INTROSPECTION_GIRS += OSTree-1.0.gir
gir_DATA += OSTree-1.0.gir
typelib_DATA += OSTree-1.0.typelib
endif
pkgconfig_DATA += src/libostree/ostree-1.pc
INSTALL_DATA_HOOKS += install-libostree-data-hook
install-libostree-data-hook:
rm -f $(DESTDIR)$(privlibdir)/libostree.la
rm -f $(DESTDIR)$(libdir)/libostree-1.la

View File

@ -72,7 +72,7 @@ ostree_SOURCES += \
$(NULL)
ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostree -DLOCALEDIR=\"$(datadir)/locale\"
ostree_bin_shared_ldadd = libotutil.la libostree.la
ostree_bin_shared_ldadd = libotutil.la libostree-1.la
ostree_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS)
ostree_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS)

View File

@ -37,11 +37,19 @@ EXTRA_DIST =
bin_PROGRAMS =
sbin_PROGRAMS =
bin_SCRIPTS =
lib_LTLIBRARIES =
libexec_PROGRAMS =
noinst_LTLIBRARIES =
noinst_PROGRAMS =
privlibdir = $(pkglibdir)
privlib_LTLIBRARIES =
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
INTROSPECTION_GIRS =
girdir = $(datadir)/gir-1.0
gir_DATA =
typelibdir = $(libdir)/girepository-1.0
typelib_DATA =
EXTRA_DIST += autogen.sh COPYING.GPL COPYING.LGPL README.md
@ -78,6 +86,14 @@ libgsystem_cflags = $(OT_INTERNAL_GIO_UNIX_CFLAGS) -I$(srcdir)/src/libgsystem
libgsystem_libs = $(OT_INTERNAL_GIO_UNIX_LIBS)
include src/libgsystem/Makefile-libgsystem.am
noinst_LTLIBRARIES += libgsystem.la
if BUILDOPT_INTROSPECTION
include $(INTROSPECTION_MAKEFILE)
GIRS =
TYPELIBS = $(GIRS:.gir=.typelib)
endif
include Makefile-otutil.am
include Makefile-libostree.am
include Makefile-ostree.am

View File

@ -76,6 +76,11 @@ AS_IF([test x$enable_embedded_dependencies = xyes], [
if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libsoup"; fi
AM_CONDITIONAL(USE_LIBSOUP, test x$with_soup != xno)
m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
GOBJECT_INTROSPECTION_CHECK([1.34.0])
])
AM_CONDITIONAL(BUILDOPT_INTROSPECTION, test x$found_introspection = xyes)
LIBARCHIVE_DEPENDENCY="libarchive >= 2.8.0"
AC_ARG_ENABLE(documentation,
@ -121,6 +126,7 @@ AM_CONDITIONAL(BUILDOPT_DRACUT, test x$with_dracut = xyes)
AC_CONFIG_FILES([
Makefile
embedded-dependencies/Makefile
src/libostree/ostree-1.pc
])
AC_OUTPUT
@ -130,6 +136,7 @@ echo "
embedded dependencies: $enable_embedded_dependencies
introspection: $found_introspection
libsoup (retrieve remote HTTP repositories): $with_soup
libarchive (parse tar files directly): $with_libarchive
documentation: $enable_documentation

View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: OSTree
Description: Git for operating system binaries
Version: @VERSION@
Requires: gio-unix-2.0
Libs: -L${libdir} -lostree-1
Cflags: -I${includedir}/ostree-1

View File

@ -20,9 +20,8 @@
#include "config.h"
#include <gio/gio.h>
#include "ostree-chain-input-stream.h"
#include "libgsystem.h"
enum {
PROP_0,

View File

@ -20,9 +20,8 @@
#include "config.h"
#include <gio/gio.h>
#include "ostree-checksum-input-stream.h"
#include "libgsystem.h"
enum {
PROP_0,

View File

@ -22,15 +22,15 @@
#include "config.h"
#include "ostree.h"
#include "otutil.h"
#include <gio/gfiledescriptorbased.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <gio/gfiledescriptorbased.h>
#include <attr/xattr.h>
#include "ostree.h"
#include "ostree-chain-input-stream.h"
#include "otutil.h"
#include "libgsystem.h"
#define ALIGN_VALUE(this, boundary) \
(( ((unsigned long)(this)) + (((unsigned long)(boundary)) -1)) & (~(((unsigned long)(boundary))-1)))

View File

@ -22,7 +22,7 @@
#pragma once
#include <otutil.h>
#include <gio/gio.h>
G_BEGIN_DECLS

View File

@ -24,6 +24,7 @@
#include "ostree.h"
#include "otutil.h"
#include "libgsystem.h"
static gboolean
get_file_checksum (GFile *f,

View File

@ -24,6 +24,8 @@
#include "ostree-fetcher.h"
#include "ostree.h"
#include "otutil.h"
#include "libgsystem.h"
typedef enum {
OSTREE_FETCHER_STATE_PENDING,

View File

@ -24,6 +24,7 @@
#include <archive.h>
#include <gio/gio.h>
#include "ostree-libarchive-input-stream.h"
#include "libgsystem.h"
enum {
PROP_0,

View File

@ -25,6 +25,7 @@
#include "ostree-mutable-tree.h"
#include "otutil.h"
#include "ostree-core.h"
#include "libgsystem.h"
struct OstreeMutableTree
{

View File

@ -22,6 +22,9 @@
#include "config.h"
#include <glib-unix.h>
#include "otutil.h"
#include "ostree-repo-file.h"
#include "ostree-repo-private.h"

View File

@ -22,6 +22,7 @@
#include "config.h"
#include "libgsystem.h"
#include "ostree-repo-file-enumerator.h"
#include <string.h>

View File

@ -22,6 +22,7 @@
#include "config.h"
#include "otutil.h"
#include "ostree-repo-file-enumerator.h"
#include "ostree-repo.h"

View File

@ -31,6 +31,8 @@
#include "ostree-libarchive-input-stream.h"
#endif
#include "otutil.h"
#ifdef HAVE_LIBARCHIVE
static GFileInfo *

View File

@ -22,7 +22,8 @@
#include "config.h"
#include "ostree-repo.h"
#include "ostree.h"
#include "otutil.h"
typedef struct {
OstreeRepo *repo;

View File

@ -69,6 +69,7 @@
#include "ostree.h"
#include "ostree-fetcher.h"
#include "otutil.h"
typedef struct {
enum {

View File

@ -23,6 +23,7 @@
#include "config.h"
#include "ostree-repo-private.h"
#include "otutil.h"
static gboolean
add_ref_to_set (const char *remote,
@ -350,6 +351,17 @@ resolve_refspec (OstreeRepo *self,
return ret;
}
/**
* ostree_repo_resolve_rev:
* @self:
* @refspec: A refspec
* @allow_noent: Do not throw an error if refspec does not exist
* @out_rev: (out) (transfer full): A checksum,or %NULL if @allow_noent is true and it does not exist
* @error:
*
* Look up the given refspec, returning the checksum it references in
* the parameter @out_rev.
*/
gboolean
ostree_repo_resolve_rev (OstreeRepo *self,
const char *refspec,

View File

@ -24,6 +24,7 @@
#include "ostree.h"
#include "otutil.h"
#include "libgsystem.h"
GHashTable *
ostree_repo_traverse_new_reachable (void)

View File

@ -22,12 +22,6 @@
#include "config.h"
#include "ostree-repo-private.h"
#include "ostree-mutable-tree.h"
#include "ostree-checksum-input-stream.h"
#include "otutil.h"
#include "ostree-repo-file-enumerator.h"
#include <gio/gunixoutputstream.h>
#include <gio/gunixinputstream.h>
#include <glib/gstdio.h>
@ -35,6 +29,13 @@
#include <stdio.h>
#include <stdlib.h>
#include "ostree-repo-private.h"
#include "ostree-mutable-tree.h"
#include "ostree-checksum-input-stream.h"
#include "otutil.h"
#include "libgsystem.h"
#include "ostree-repo-file-enumerator.h"
typedef struct {
GObjectClass parent_class;
} OstreeRepoClass;
@ -2292,6 +2293,11 @@ ostree_repo_load_variant_if_exists (OstreeRepo *self,
/**
* ostree_repo_load_variant:
* @self:
* @objtype: Expected object type
* @sha256: Checksum string
* @out_variant: (out): (transfer full): Metadata object
* @error:
*
* Load the metadata object @sha256 of type @objtype, storing the
* result in @out_variant.

View File

@ -164,7 +164,7 @@ gboolean ostree_repo_stage_content_finish (OstreeRepo *self,
gboolean ostree_repo_resolve_rev (OstreeRepo *self,
const char *refspec,
gboolean allow_noent,
char **out_resolved,
char **out_rev,
GError **error);
gboolean ostree_repo_write_ref (OstreeRepo *self,

View File

@ -22,8 +22,6 @@
#pragma once
#include <ostree-checksum-input-stream.h>
#include <ostree-chain-input-stream.h>
#include <ostree-core.h>
#include <ostree-repo.h>
#include <ostree-mutable-tree.h>

View File

@ -24,6 +24,7 @@
#include <gio/gio.h>
#include <libgsystem.h>
#include <string.h> /* Yeah...let's just do that here. */
#include <gsystem-local-alloc.h>
#define ot_gobject_refz(o) (o ? g_object_ref (o) : o)

View File

@ -25,6 +25,7 @@
#include "ot-admin-builtins.h"
#include "ot-admin-functions.h"
#include "ostree.h"
#include "libgsystem.h"
#include <glib/gi18n.h>

View File

@ -27,6 +27,7 @@
#include "ot-admin-deploy.h"
#include "ot-ordered-hash.h"
#include "ostree.h"
#include "otutil.h"
#include <glib/gi18n.h>

View File

@ -25,6 +25,7 @@
#include "ot-admin-builtins.h"
#include "ot-admin-functions.h"
#include "ostree.h"
#include "libgsystem.h"
#include <glib/gi18n.h>

View File

@ -25,6 +25,7 @@
#include "ot-admin-builtins.h"
#include "ot-admin-functions.h"
#include "otutil.h"
#include "libgsystem.h"
#include <glib/gi18n.h>

View File

@ -25,6 +25,7 @@
#include "ot-admin-builtins.h"
#include "ot-admin-functions.h"
#include "otutil.h"
#include "libgsystem.h"
#include <glib/gi18n.h>

View File

@ -25,6 +25,7 @@
#include "ot-admin-builtins.h"
#include "ot-admin-functions.h"
#include "ostree.h"
#include "libgsystem.h"
#include <glib/gi18n.h>

View File

@ -20,13 +20,14 @@
#include "config.h"
#include <stdlib.h>
#include "ot-admin-builtins.h"
#include "ot-admin-functions.h"
#include "ot-admin-deploy.h"
#include "ot-ordered-hash.h"
#include "ostree.h"
#include <stdlib.h>
#include "otutil.h"
static GOptionEntry options[] = {
{ NULL }

View File

@ -27,6 +27,7 @@
#include "ot-admin-deploy.h"
#include "ostree.h"
#include "otutil.h"
#include "libgsystem.h"
#include <unistd.h>
#include <stdlib.h>

View File

@ -21,9 +21,9 @@
#include "config.h"
#include "ot-bootloader-syslinux.h"
#include "libgsystem.h"
#include "otutil.h"
#include "ot-admin-functions.h"
#include "libgsystem.h"
#include <string.h>

View File

@ -20,6 +20,7 @@
#include "config.h"
#include "ot-bootloader.h"
#include "libgsystem.h"
G_DEFINE_INTERFACE (OtBootloader, ot_bootloader, G_TYPE_OBJECT)

View File

@ -28,6 +28,7 @@
#include "ot-main.h"
#include "ostree.h"
#include "ostree-repo-file.h"
#include "libgsystem.h"
#include <glib/gi18n.h>

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
#include <gio/gunixoutputstream.h>

View File

@ -22,10 +22,12 @@
#include "config.h"
#include <string.h>
#include <gio/gunixinputstream.h>
#include "ot-builtins.h"
#include "ostree.h"
#include <gio/gunixinputstream.h>
#include "otutil.h"
static gboolean opt_user_mode;
static gboolean opt_allow_noent;

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "libgsystem.h"
static GOptionEntry options[] = {
{ NULL }

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
static char *opt_subject;
static char *opt_body;

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
static GOptionEntry options[] = {
{ NULL }

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
static gboolean opt_stats;
static gboolean opt_fs_diff;

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
static gboolean opt_quiet;
static gboolean opt_delete;

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "libgsystem.h"
static gboolean opt_archive;
static char *opt_mode = NULL;

View File

@ -25,6 +25,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "ostree-repo-file.h"
#include "otutil.h"
static gboolean opt_dironly;
static gboolean opt_recursive;

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "libgsystem.h"
static gboolean opt_no_prune;
static gint opt_depth = -1;

View File

@ -27,6 +27,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
static char *opt_remote;

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
gboolean opt_related;

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "libgsystem.h"
static gboolean opt_delete;

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
static GOptionEntry options[] = {
{ NULL }

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
static GOptionEntry options[] = {
{ NULL }

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
static gboolean opt_print_related;
static char* opt_print_variant_type;

View File

@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
static char *opt_port_file = NULL;
static gboolean opt_daemonize;

View File

@ -22,12 +22,13 @@
#include "config.h"
#include "ot-builtins.h"
#include "ostree.h"
#include <gio/gunixoutputstream.h>
#include <gio/gunixinputstream.h>
#include "ot-builtins.h"
#include "ostree.h"
#include "otutil.h"
static GOptionEntry options[] = {
{ NULL }
};

View File

@ -21,6 +21,7 @@
#include "config.h"
#include "ot-deployment.h"
#include "libgsystem.h"
struct _OtDeployment
{

View File

@ -28,6 +28,7 @@
#include "ot-main.h"
#include "otutil.h"
#include "libgsystem.h"
int
ostree_usage (char **argv,

View File

@ -21,6 +21,7 @@
#include "config.h"
#include "ot-ordered-hash.h"
#include "libgsystem.h"
OtOrderedHash *
ot_ordered_hash_new (void)