Add libgsystem as git external

Don't replace ot_lfree and stuff yet though...to much code churn.
This commit is contained in:
Colin Walters 2012-07-15 11:51:57 -04:00
parent 95921bcbf0
commit 464f4a81c9
10 changed files with 21 additions and 91 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "src/libgsystem"]
path = src/libgsystem
url = git://git.gnome.org/libgsystem

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_INTERNAL_GIO_UNIX_CFLAGS)
ostreed_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -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,7 +46,7 @@ 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_INTERNAL_GIO_UNIX_CFLAGS)
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
libostree_la_LIBADD = libotutil.la $(OT_INTERNAL_GIO_UNIX_LIBS)

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_INTERNAL_GIO_UNIX_CFLAGS)
ostadmin_LDADD = libotutil.la libostree.la $(OT_INTERNAL_GIO_UNIX_LIBS)
ostadmin_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostadmin -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
ostadmin_LDADD = libgsystem.la libotutil.la libostree.la $(OT_INTERNAL_GIO_UNIX_LIBS)

View File

@ -43,7 +43,7 @@ ostree_SOURCES = src/ostree/main.c \
src/ostree/ot-main.c \
$(NULL)
ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostree -DLOCALEDIR=\"$(datadir)/locale\"
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_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS)

View File

@ -22,7 +22,6 @@ noinst_LTLIBRARIES += libotutil.la
libotutil_la_SOURCES = \
src/libotutil/ot-checksum-utils.c \
src/libotutil/ot-checksum-utils.h \
src/libotutil/ot-local-alloc.c \
src/libotutil/ot-local-alloc.h \
src/libotutil/ot-opt-utils.c \
src/libotutil/ot-opt-utils.h \
@ -39,5 +38,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_INTERNAL_GIO_UNIX_CFLAGS)
libotutil_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS)
libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
libotutil_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS) libgsystem.la

View File

@ -68,6 +68,10 @@ OT_INTERNAL_SOUP_CFLAGS = $(OT_DEP_SOUP_CFLAGS)
OT_INTERNAL_SOUP_LIBS = $(OT_DEP_SOUP_LIBS)
endif
libgsystem_srcpath := src/libgsystem
libgsystem_cflags = $(OT_INTERNAL_GIO_UNIX_CFLAGS)
libgsystem_libs = $(OT_INTERNAL_GIO_UNIX_LIBS)
include src/libgsystem/Makefile-libgsystem.am
include Makefile-daemon.am
include Makefile-otutil.am
include Makefile-libostree.am

1
src/libgsystem Submodule

@ -0,0 +1 @@
Subproject commit ba5d74802c0ffe51bd18d2ba64db87e1e7456349

View File

@ -1,72 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* 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.
*
* Author: Colin Walters <walters@verbum.org>
*/
#include "config.h"
#include "otutil.h"
void
ot_local_free (void *loc)
{
void **location = loc;
if (location)
g_free (*location);
}
#define _ot_local_free(type, function) do { \
void **location = loc; \
if (location) \
{ \
type *value = *location; \
if (value) \
function (value); \
} \
} while (0)
void
ot_local_obj_unref (void *loc)
{
GObject **location = (GObject**)loc;
if (location && *location)
g_object_unref (*location);
}
void
ot_local_variant_unref (GVariant **loc)
{
if (loc && *loc)
g_variant_unref (*loc);
}
void
ot_local_ptrarray_unref (GPtrArray **loc)
{
if (loc && *loc)
g_ptr_array_unref (*loc);
}
void
ot_local_hashtable_unref (GHashTable **loc)
{
if (loc && *loc)
g_hash_table_unref (*loc);
}

View File

@ -24,20 +24,15 @@
#define __OSTREE_LOCAL_ALLOC_H__
#include <gio/gio.h>
#include "libgsystem.h"
G_BEGIN_DECLS
void ot_local_free (void *loc);
void ot_local_obj_unref (void *loc);
void ot_local_variant_unref (GVariant **loc);
void ot_local_ptrarray_unref (GPtrArray **loc);
void ot_local_hashtable_unref (GHashTable **loc);
#define ot_lfree __attribute__ ((cleanup(ot_local_free)))
#define ot_lobj __attribute__ ((cleanup(ot_local_obj_unref)))
#define ot_lvariant __attribute__ ((cleanup(ot_local_variant_unref)))
#define ot_lptrarray __attribute__ ((cleanup(ot_local_ptrarray_unref)))
#define ot_lhash __attribute__ ((cleanup(ot_local_hashtable_unref)))
#define ot_lfree __attribute__ ((cleanup(gs_local_free)))
#define ot_lobj __attribute__ ((cleanup(gs_local_obj_unref)))
#define ot_lvariant __attribute__ ((cleanup(gs_local_variant_unref)))
#define ot_lptrarray __attribute__ ((cleanup(gs_local_ptrarray_unref)))
#define ot_lhash __attribute__ ((cleanup(gs_local_hashtable_unref)))
G_END_DECLS