From 6e3c15e2abb7a938615bfd1fb7465d6cdec32b74 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sat, 26 Feb 2011 18:29:53 +0100 Subject: [PATCH] Use standard GObject Introspection make rules Instead of defining rules manually, use the included make support, which means Makefiles are less prone to API changes, support verbosity correctly (instead of inconsistently hardcoding --quiet), are cleaner to read, and emit GISCAN/GICOMP instead of GEN (which is nicer). https://bugzilla.gnome.org/show_bug.cgi?id=643371 --- configure.ac | 2 + src/Makefile-gvc.am | 32 +++------- src/Makefile.am | 112 ++++++++++------------------------ src/gvc/gvc-pulseaudio-fake.h | 6 +- 4 files changed, 45 insertions(+), 107 deletions(-) diff --git a/configure.ac b/configure.ac index 5c792b813..6031a53af 100644 --- a/configure.ac +++ b/configure.ac @@ -93,6 +93,8 @@ GJS_VERSION=`$PKG_CONFIG --modversion gjs-internals-1.0` AC_DEFINE_UNQUOTED([GJS_VERSION], ["$GJS_VERSION"], [The version of GJS we're linking to]) AC_SUBST([GJS_VERSION], ["$GJS_VERSION"]) +GOBJECT_INTROSPECTION_CHECK([$GOBJECT_INTROSPECTION_MIN_VERSION]) + saved_CFLAGS=$CFLAGS saved_LIBS=$LIBS CFLAGS=$MUTTER_PLUGIN_CFLAGS diff --git a/src/Makefile-gvc.am b/src/Makefile-gvc.am index 20dd4d835..5bedcc326 100644 --- a/src/Makefile-gvc.am +++ b/src/Makefile-gvc.am @@ -30,8 +30,7 @@ libgvc_la_gir_sources = \ gvc/gvc-mixer-event-role.h \ gvc/gvc-mixer-event-role.c \ gvc/gvc-mixer-control.h \ - gvc/gvc-mixer-control.c \ - gvc/gvc-pulseaudio-fake.h + gvc/gvc-mixer-control.c libgvc_la_private_sources = \ gvc/gvc-mixer-stream-private.h \ @@ -44,26 +43,9 @@ libgvc_la_SOURCES = \ $(libgvc_la_gir_sources) \ $(libgvc_la_private_sources) -Gvc-1.0.gir: $(G_IR_SCANNER) libgvc.la Makefile - $(AM_V_GEN) $(G_IR_SCANNER) \ - --namespace=Gvc \ - --nsversion=1.0 \ - --warn-all \ - --quiet \ - --libtool="$(LIBTOOL)" \ - --add-include-path=$(builddir) \ - --include=GObject-2.0 \ - --library=libgvc.la \ - --identifier-prefix=Gvc \ - --symbol-prefix=gvc_ \ - $(addprefix $(srcdir)/,$(libgvc_la_gir_sources)) \ - $(INCLUDES) \ - -I $(srcdir) \ - -I $(srcdir)/gvc \ - -DWITH_INTROSPECTION \ - -o $@ -CLEANFILES += Gvc-1.0.gir - -Gvc-1.0.typelib: Gvc-1.0.gir - $(AM_V_GEN) $(G_IR_COMPILER) $< -o $@ -CLEANFILES += Gvc-1.0.typelib +Gvc-1.0.gir: libgvc.la +Gvc_1_0_gir_INCLUDES = GObject-2.0 +Gvc_1_0_gir_CFLAGS = $(INCLUDES) -I$(srcdir)/gvc -DWITH_INTROSPECTION +Gvc_1_0_gir_LIBS = libgvc.la +Gvc_1_0_gir_FILES = $(addprefix $(srcdir)/,$(libgvc_la_gir_sources)) +INTROSPECTION_GIRS += Gvc-1.0.gir \ No newline at end of file diff --git a/src/Makefile.am b/src/Makefile.am index c5fd0aa04..f15bf95cd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,7 +7,15 @@ libexec_PROGRAMS = noinst_LTLIBRARIES = noinst_PROGRAMS = -.AUTOPARALLEL: +-include $(INTROSPECTION_MAKEFILE) +INTROSPECTION_GIRS = +INTROSPECTION_SCANNER_ARGS = --warn-all --warn-error --add-include-path=$(srcdir) +INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=$(MUTTER_LIB_DIR)/mutter/ + +typelibdir = $(pkglibdir) +typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) + +CLEANFILES += $(gir_DATA) $(typelib_DATA) generated_bin_scripts = gnome-shell-installed gnome-shell-jhbuild gnome-shell-extension-tool bin_SCRIPTS += gnome-shell $(generated_bin_scripts) @@ -238,83 +246,29 @@ libgnome_shell_la_LIBADD = \ libgnome_shell_la_CPPFLAGS = $(gnome_shell_cflags) $(LIBECAL_CFLAGS) -typelibdir = $(pkglibdir) -typelib_DATA = Shell-0.1.typelib St-1.0.typelib Gdm-1.0.typelib Gvc-1.0.typelib +Shell-0.1.gir: libgnome-shell.la St-1.0.gir +Shell_0_1_gir_INCLUDES = Clutter-1.0 ClutterX11-1.0 Meta-2.91 TelepathyGLib-0.12 +Shell_0_1_gir_CFLAGS = $(libgnome_shell_la_CPPFLAGS) -I $(srcdir) +Shell_0_1_gir_LIBS = libgnome-shell.la +Shell_0_1_gir_FILES = $(addprefix $(srcdir)/,$(libgnome_shell_la_gir_sources)) +Shell_0_1_gir_SCANNERFLAGS = --include-uninstalled=$(builddir)/St-1.0.gir \ + --add-include-path=$(MUTTER_LIB_DIR)/mutter/ \ + --program=mutter \ + --program-arg=--mutter-plugins=`pwd`/libgnome-shell.la +INTROSPECTION_GIRS += Shell-0.1.gir -Shell-0.1.gir: $(mutter) $(G_IR_SCANNER) St-1.0.gir libgnome-shell.la Makefile - $(AM_V_GEN) $(G_IR_SCANNER) \ - --namespace=Shell \ - --nsversion=0.1 \ - --warn-all \ - --warn-error \ - --add-include-path=$(MUTTER_LIB_DIR)/mutter/ \ - --include=Clutter-1.0 \ - --include=ClutterX11-1.0 \ - --include=Meta-2.91 \ - --include=TelepathyGLib-0.12 \ - --libtool="$(LIBTOOL)" \ - --add-include-path=$(builddir) \ - --include=St-1.0 \ - --program=mutter \ - --program-arg=--mutter-plugins=$$(pwd)/libgnome-shell.la \ - $(addprefix $(srcdir)/,$(libgnome_shell_la_gir_sources)) \ - $(libgnome_shell_la_CPPFLAGS) \ - -I $(srcdir) \ - -o $@ -CLEANFILES += Shell-0.1.gir - -# The dependency on libgnome-shell.la here is because g-ir-compiler opens it -# (not the fake library, since we've already done the rewriting) -Shell-0.1.typelib: libgnome-shell.la Shell-0.1.gir - $(AM_V_GEN) \ - $(G_IR_COMPILER) \ - --includedir=. \ - --includedir=$(MUTTER_LIB_DIR)/mutter/ \ - Shell-0.1.gir -o $@ -CLEANFILES += Shell-0.1.typelib - -St-1.0.gir: $(mutter) $(G_IR_SCANNER) libst-1.0.la Makefile - $(AM_V_GEN) $(G_IR_SCANNER) \ - --namespace=St \ - --nsversion=1.0 \ - --warn-all \ - --warn-error \ - --include=Clutter-1.0 \ - --include=Gtk-3.0 \ - --add-include-path=$(builddir) \ - --libtool="$(LIBTOOL)" \ - --library=libst-1.0.la \ - -DST_COMPILATION \ - $(filter-out %-private.h $(st_non_gir_sources), $(addprefix $(srcdir)/,$(st_source_h))) \ - $(addprefix $(srcdir)/,$(st_source_c)) \ - $(srcdir)/st-enum-types.h \ - $(st_cflags) \ - -o $@ -CLEANFILES += St-1.0.gir - -St-1.0.typelib: St-1.0.gir - $(AM_V_GEN) $(G_IR_COMPILER) \ - $< -o $@ - -CLEANFILES += St-1.0.typelib - -Gdm-1.0.gir: $(mutter) $(G_IR_SCANNER) libgdmuser-1.0.la Makefile - $(AM_V_GEN) $(G_IR_SCANNER) \ - --namespace=Gdm \ - --nsversion=1.0 \ - --warn-all \ - --warn-error \ - --include=GObject-2.0 \ - --include=GdkPixbuf-2.0 \ - --libtool="$(LIBTOOL)" \ - --library=libgdmuser-1.0.la \ - $(filter-out %-private.h, $(addprefix $(srcdir)/,$(gdmuser_source_h))) \ - $(addprefix $(srcdir)/,$(gdmuser_source_c)) \ - $(gdmuser_cflags) \ - -o $@ -CLEANFILES += Gdm-1.0.gir - -Gdm-1.0.typelib: Gdm-1.0.gir - $(AM_V_GEN) $(G_IR_COMPILER) Gdm-1.0.gir -o $@ -CLEANFILES += Gdm-1.0.typelib +St-1.0.gir: libst-1.0.la +St_1_0_gir_INCLUDES = Clutter-1.0 Gtk-3.0 +St_1_0_gir_CFLAGS = $(st_cflags) -DST_COMPILATION +St_1_0_gir_LIBS = libst-1.0.la +St_1_0_gir_FILES = $(filter-out %-private.h $(st_non_gir_sources), $(addprefix $(srcdir)/,$(st_source_h))) \ + $(addprefix $(srcdir)/,$(st_source_c)) +INTROSPECTION_GIRS += St-1.0.gir +Gdm-1.0.gir: libgdmuser-1.0.la +Gdm_1_0_gir_INCLUDES = GObject-2.0 GdkPixbuf-2.0 +Gdm_1_0_gir_CFLAGS = $(gdmuser_cflags) +Gdm_1_0_gir_LIBS = libgdmuser-1.0.la +Gdm_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(gdmuser_source_h))) \ + $(addprefix $(srcdir)/,$(gdmuser_source_c)) +INTROSPECTION_GIRS += Gdm-1.0.gir diff --git a/src/gvc/gvc-pulseaudio-fake.h b/src/gvc/gvc-pulseaudio-fake.h index 65293cdef..ab8f6b415 100644 --- a/src/gvc/gvc-pulseaudio-fake.h +++ b/src/gvc/gvc-pulseaudio-fake.h @@ -24,9 +24,9 @@ #ifdef WITH_INTROSPECTION #ifndef PA_API_VERSION -typedef int pa_channel_position_t; -typedef guint32 pa_volume_t; -typedef gpointer pa_context; +#define pa_channel_position_t int +#define pa_volume_t guint32 +#define pa_context gpointer #endif /* PA_API_VERSION */ #endif /* WITH_INTROSPECTION */