[gnome-boxes] build-sys: use a libcommon.a library to fix tons of build warnings
- From: Marc-Andre Lureau <malureau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] build-sys: use a libcommon.a library to fix tons of build warnings
- Date: Mon, 13 Aug 2012 12:21:33 +0000 (UTC)
commit cb2d5af700612fe5b15f16f02daf0975e82defa2
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date: Sun Aug 5 19:07:43 2012 +0200
build-sys: use a libcommon.a library to fix tons of build warnings
The same Vala file can't be used several times, as automake will
generate the same target to compile the Vala file.
Instead, compile those shared file once in a common library.
Also update the Vala files to remote the warnings (make classes and
interface public)
https://bugzilla.gnome.org/show_bug.cgi?id=681246
configure.ac | 3 +-
src/Makefile.am | 54 +++++++++++++++++++++++++++-------
src/collection-source.vala | 4 +-
src/display-config.vala | 2 +-
src/display-properties.vala | 2 +-
src/gnome-boxes-search-provider.vala | 2 +-
src/util.vala | 4 +-
7 files changed, 52 insertions(+), 19 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d1bab6e..19f8e2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,11 +74,12 @@ PKG_CHECK_MODULES(BOXES, [
VALA_ADD_CHECKFILE([src/gnome_boxes_vala.stamp])
-PKG_CHECK_MODULES(BOXES_SEARCH, [
+PKG_CHECK_MODULES(BOXES_COMMON, [
glib-2.0 >= $GLIB_MIN_VERSION
gio-2.0 >= $GLIB_MIN_VERSION
])
+VALA_ADD_CHECKFILE([src/libcommon_a_vala.stamp])
VALA_ADD_CHECKFILE([src/gnome_boxes_search_provider_vala.stamp])
VALA_ADD_CHECKFILE([libgd/gd-1.0.vapi])
diff --git a/src/Makefile.am b/src/Makefile.am
index 2320c46..c0f13a5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,5 @@
NULL =
+BUILT_SOURCES =
MAINTAINERCLEANFILES = *.stamp
AM_CPPFLAGS = \
@@ -18,6 +19,7 @@ AM_VALAFLAGS = \
--pkg clutter-gtk-1.0 \
--pkg cogl-1.0 \
--pkg config \
+ --pkg common \
--pkg gd-1.0 \
--pkg gdk-pixbuf-2.0 \
--pkg glib-2.0 \
@@ -33,16 +35,46 @@ AM_VALAFLAGS = \
$(VALA_DEBUG_FLAGS) \
$(NULL)
+noinst_LIBRARIES = libcommon.a
+libcommon_a_VALASOURCES = \
+ collection-source.vala \
+ display-config.vala \
+ display-properties.vala \
+ util.vala \
+ $(NULL)
+
+libcommon_a_DEPENDENCIES = \
+ common.vapi \
+ libcommon.h \
+ libcommon_vala.stamp \
+ $(NULL)
+
+libcommon_a_SOURCES = \
+ $(libcommon_a_VALASOURCES:.vala=.c) \
+ $(NULL)
+
+libcommon_a_CFLAGS = $(BOXES_COMMON_CFLAGS)
+
+libcommon_vala.stamp common.vapi: $(libcommon_a_VALASOURCES)
+ $(AM_V_VALAC)$(VALAC) $(VALAFLAGS) $(VALA_DEBUG_FLAGS) \
+ --enable-experimental \
+ --vapidir=$(srcdir)/ \
+ --pkg config \
+ --pkg glib-2.0 \
+ --pkg gio-2.0 \
+ -C -H libcommon.h --library common $^
+ @touch $(libcommon_a_DEPENDENCIES)
+
+BUILT_SOURCES += $(libcommon_a_DEPENDENCIES)
+MAINTAINERCLEANFILES += $(libcommon_a_SOURCES) $(libcommon_a_DEPENDENCIES)
+
bin_PROGRAMS = gnome-boxes
gnome_boxes_SOURCES = \
app.vala \
- collection-source.vala \
collection-view.vala \
collection.vala \
- display-config.vala \
display-page.vala \
- display-properties.vala \
display.vala \
editable-entry.vala \
fedora-installer.vala \
@@ -65,7 +97,6 @@ gnome_boxes_SOURCES = \
topbar.vala \
ui.vala \
unattended-installer.vala \
- util.vala \
util-app.vala \
vm-configurator.vala \
vm-creator.vala \
@@ -77,7 +108,12 @@ gnome_boxes_SOURCES = \
wizard.vala \
$(NULL)
-gnome_boxes_LDADD = $(BOXES_LIBS) $(top_builddir)/libgd/libgdprivate-1.0.la
+gnome_boxes_LDADD = \
+ $(BOXES_LIBS) \
+ $(top_builddir)/libgd/libgdprivate-1.0.la \
+ libcommon.a \
+ $(NULL)
+
gnome_boxes_CFLAGS = $(BOXES_CFLAGS)
MAINTAINERCLEANFILES += $(gnome_boxes_SOURCES:.vala=.c)
@@ -85,15 +121,11 @@ MAINTAINERCLEANFILES += $(gnome_boxes_SOURCES:.vala=.c)
libexec_PROGRAMS = gnome-boxes-search-provider
gnome_boxes_search_provider_SOURCES = \
- collection-source.vala \
- display-config.vala \
- display-properties.vala \
gnome-boxes-search-provider.vala \
- util.vala \
$(NULL)
-gnome_boxes_search_provider_LDADD = $(BOXES_SEARCH_LIBS)
-gnome_boxes_search_provider_CFLAGS = $(BOXES_SEARCH_CFLAGS)
+gnome_boxes_search_provider_LDADD = $(BOXES_COMMON_LIBS) libcommon.a
+gnome_boxes_search_provider_CFLAGS = $(BOXES_COMMON_CFLAGS)
MAINTAINERCLEANFILES += $(gnome_boxes_search_provider_SOURCES:.vala=.c)
diff --git a/src/collection-source.vala b/src/collection-source.vala
index 9017945..5a79738 100644
--- a/src/collection-source.vala
+++ b/src/collection-source.vala
@@ -1,6 +1,6 @@
// This file is part of GNOME Boxes. License: LGPLv2+
-private interface Boxes.IConfig {
+public interface Boxes.IConfig {
protected abstract KeyFile keyfile { get; }
public abstract string? filename { get; set; }
@@ -63,7 +63,7 @@ private interface Boxes.IConfig {
}
}
-private class Boxes.CollectionSource: GLib.Object, Boxes.IConfig {
+public class Boxes.CollectionSource: GLib.Object, Boxes.IConfig {
private KeyFile _keyfile;
private KeyFile keyfile { get { return _keyfile; } }
diff --git a/src/display-config.vala b/src/display-config.vala
index 1a72f17..f785274 100644
--- a/src/display-config.vala
+++ b/src/display-config.vala
@@ -1,6 +1,6 @@
// This file is part of GNOME Boxes. License: LGPLv2+
-private class Boxes.DisplayConfig: GLib.Object, Boxes.IConfig {
+public class Boxes.DisplayConfig: GLib.Object, Boxes.IConfig {
private CollectionSource source;
private bool has_file {
diff --git a/src/display-properties.vala b/src/display-properties.vala
index 9af4bdd..534347c 100644
--- a/src/display-properties.vala
+++ b/src/display-properties.vala
@@ -1,7 +1,7 @@
// This file is part of GNOME Boxes. License: LGPLv2+
// too bad we can't make it just a mixin
-private class Boxes.DisplayProperties: GLib.Object {
+public class Boxes.DisplayProperties: GLib.Object {
protected struct SavedProperty {
string name;
Value default_value;
diff --git a/src/gnome-boxes-search-provider.vala b/src/gnome-boxes-search-provider.vala
index c7d67b8..7aa4fc8 100644
--- a/src/gnome-boxes-search-provider.vala
+++ b/src/gnome-boxes-search-provider.vala
@@ -1,7 +1,7 @@
// This file is part of GNOME Boxes. License: LGPLv2+
[DBus (name = "org.gnome.Shell.SearchProvider")]
-private class Boxes.SearchProvider: Object {
+public class Boxes.SearchProvider: Object {
private SearchProviderApp app;
private bool loading;
public bool loaded { get; set; }
diff --git a/src/util.vala b/src/util.vala
index 2871e54..19f5dd6 100644
--- a/src/util.vala
+++ b/src/util.vala
@@ -326,12 +326,12 @@ namespace Boxes {
}
[DBus (name = "org.freedesktop.Accounts")]
- interface Fdo.Accounts : Object {
+ public interface Fdo.Accounts : Object {
public abstract async string FindUserByName(string name) throws IOError;
}
[DBus (name = "org.freedesktop.Accounts.User")]
- interface Fdo.AccountsUser : Object {
+ public interface Fdo.AccountsUser : Object {
public abstract bool AutomaticLogin { get; }
public abstract bool Locked { get; }
public abstract bool SystemAccount { get; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]