[libchamplain] Use the new way for introspection makefile creation
- From: Jiří Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Use the new way for introspection makefile creation
- Date: Fri, 14 May 2010 00:21:28 +0000 (UTC)
commit aaa0496f924d9dfab26e78224dac70d8f87b1017
Author: JiÅ?Ã Techet <techet gmail com>
Date: Fri May 14 01:37:21 2010 +0200
Use the new way for introspection makefile creation
Signed-off-by: JiÅ?Ã Techet <techet gmail com>
champlain-gtk/Makefile.am | 61 +++++++++++++++++++------------------------
champlain/Makefile.am | 64 ++++++++++++++++++++------------------------
configure.ac | 4 ++-
m4/introspection.m4 | 10 +++++-
4 files changed, 67 insertions(+), 72 deletions(-)
---
diff --git a/champlain-gtk/Makefile.am b/champlain-gtk/Makefile.am
index a388d1d..01e6b88 100644
--- a/champlain-gtk/Makefile.am
+++ b/champlain-gtk/Makefile.am
@@ -38,42 +38,35 @@ AM_LDFLAGS = $(GTK_LIBS) -export-symbols-regex ^gtk_champlain_.*
EXTRA_DIST = champlain-gtk-marshal.list
if HAVE_INTROSPECTION
-BUILT_GIRSOURCES =
-
-GtkChamplain- CHAMPLAIN_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libchamplain-gtk- CHAMPLAIN_API_VERSION@.la
- $(AM_V_GEN)$(INTROSPECTION_SCANNER) -v \
- --namespace GtkChamplain --nsversion= CHAMPLAIN_API_VERSION@ \
- --strip-prefix=GtkChamplain \
- $(GTK_CFLAGS) \
- $(SOUP_CFLAGS) \
- -I$(top_srcdir) \
- -DCHAMPLAIN_COMPILATION \
- -DCHAMPLAIN_GTK_COMPILATION \
- --add-include-path=$(top_builddir)/champlain \
- --c-include="$(libchamplain_include_HEADERS)" \
- --include=Champlain-0.5 \
- --include=Clutter-1.0 \
- --include=Gtk-2.0 \
- --library=champlain-gtk- CHAMPLAIN_API_VERSION@ \
- --libtool="$(LIBTOOL)" \
- --output $@ \
- --pkg gobject-2.0 \
- --pkg gtk+-2.0 \
- $(addprefix $(srcdir)/,$(libchamplain_gtk_ CHAMPLAIN_API_VERSION@_la_SOURCES)) \
- $(addprefix $(srcdir)/,$(libchamplain_include_HEADERS))
-
-BUILT_GIRSOURCES += GtkChamplain- CHAMPLAIN_API_VERSION@.gir
-
-# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
-# install anything - we need to install inside our prefix.
+
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(top_builddir)/champlain
+INTROSPECTION_COMPILER_ARGS =
+
+GtkChamplain- CHAMPLAIN_API_VERSION@.gir: libchamplain-gtk- CHAMPLAIN_API_VERSION@.la
+GtkChamplain_ CHAMPLAIN_API_VERSION_NORM@_gir_NAMESPACE = GtkChamplain
+GtkChamplain_ CHAMPLAIN_API_VERSION_NORM@_gir_VERSION = @CHAMPLAIN_API_VERSION@
+GtkChamplain_ CHAMPLAIN_API_VERSION_NORM@_gir_LIBS = libchamplain-gtk- CHAMPLAIN_API_VERSION@.la
+GtkChamplain_ CHAMPLAIN_API_VERSION_NORM@_gir_PACKAGES = gobject-2.0 gtk+-2.0
+GtkChamplain_ CHAMPLAIN_API_VERSION_NORM@_gir_FILES = \
+ $(libchamplain_gtk_ CHAMPLAIN_API_VERSION@_la_SOURCES) \
+ $(libchamplain_include_HEADERS)
+GtkChamplain_ CHAMPLAIN_API_VERSION_NORM@_gir_SCANNERFLAGS = --strip-prefix=GtkChamplain
+GtkChamplain_ CHAMPLAIN_API_VERSION_NORM@_gir_INCLUDES = Clutter-1.0 Gtk-2.0 Champlain- CHAMPLAIN_API_VERSION@
+GtkChamplain_ CHAMPLAIN_API_VERSION_NORM@_gir_CFLAGS = \
+ $(DEPS_CFLAGS) $(SOUP_CFLAGS) $(GTK_CFLAGS) \
+ -I$(top_srcdir) \
+ -DCHAMPLAIN_COMPILATION -DCHAMPLAIN_GTK_COMPILATION
+
+INTROSPECTION_GIRS += GtkChamplain- CHAMPLAIN_API_VERSION@.gir
+
girdir = $(datadir)/gir-1.0
-gir_DATA = $(BUILT_GIRSOURCES)
+dist_gir_DATA = $(INTROSPECTION_GIRS)
-typelibsdir = $(libdir)/girepository-1.0/
-typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
-GtkChamplain- CHAMPLAIN_API_VERSION@.typelib: GtkChamplain- CHAMPLAIN_API_VERSION@.gir $(INTROSPECTION_COMPILER)
- $(AM_V_GEN)$(DEBUG) $(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=. --includedir=$(top_builddir)/champlain $(INTROSPECTION_COMPILER_OPTS) $< -o $(builddir)/$(@F)
+CLEANFILES += $(dist_gir_DATA) $(typelib_DATA)
-CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
endif
diff --git a/champlain/Makefile.am b/champlain/Makefile.am
index 5a7b693..5673d47 100644
--- a/champlain/Makefile.am
+++ b/champlain/Makefile.am
@@ -155,50 +155,44 @@ champlain-enum-types.c: $(libchamplain_headers) champlain-enum-types.h
&& mv champlain-enum-types.c.tmp champlain-enum-types.c \
|| rm -f champlain-enum-type.c.tmp
+
+
if HAVE_INTROSPECTION
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS =
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+
if ENABLE_MEMPHIS
-memphis_gir_include = --include=Memphis-0.2
+memphis_gir_include = Memphis-0.2
endif
-BUILT_GIRSOURCES =
+Champlain- CHAMPLAIN_API_VERSION@.gir: libchamplain- CHAMPLAIN_API_VERSION@.la
+Champlain_ CHAMPLAIN_API_VERSION_NORM@_gir_NAMESPACE = Champlain
+Champlain_ CHAMPLAIN_API_VERSION_NORM@_gir_SCANNERFLAGS = --strip-prefix=Champlain
+Champlain_ CHAMPLAIN_API_VERSION_NORM@_gir_VERSION = @CHAMPLAIN_API_VERSION@
+Champlain_ CHAMPLAIN_API_VERSION_NORM@_gir_LIBS = libchamplain- CHAMPLAIN_API_VERSION@.la
+Champlain_ CHAMPLAIN_API_VERSION_NORM@_gir_PACKAGES = gobject-2.0 gtk+-2.0
+Champlain_ CHAMPLAIN_API_VERSION_NORM@_gir_FILES = \
+ $(libchamplain_ CHAMPLAIN_API_VERSION@_la_SOURCES) \
+ $(libchamplain_include_HEADERS)
+Champlain_ CHAMPLAIN_API_VERSION_NORM@_gir_INCLUDES = Clutter-1.0 Gtk-2.0 $(memphis_gir_include)
+Champlain_ CHAMPLAIN_API_VERSION_NORM@_gir_CFLAGS = \
+ $(DEPS_CFLAGS) $(SOUP_CFLAGS) $(MEMPHIS_CFLAGS) \
+ -I$(top_srcdir)/tidy -I$(top_srcdir) \
+ -DCHAMPLAIN_COMPILATION
+
+INTROSPECTION_GIRS += Champlain- CHAMPLAIN_API_VERSION@.gir
-Champlain- CHAMPLAIN_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libchamplain- CHAMPLAIN_API_VERSION@.la
- $(AM_V_GEN)$(INTROSPECTION_SCANNER) -v \
- --namespace Champlain --nsversion= CHAMPLAIN_API_VERSION@ \
- --strip-prefix=Champlain \
- $(DEPS_CFLAGS) \
- $(SOUP_CFLAGS) \
- $(MEMPHIS_CFLAGS) \
- -I$(top_srcdir)/tidy \
- -I$(top_srcdir) \
- -DCHAMPLAIN_COMPILATION \
- --add-include-path=$(builddir) \
- --c-include="$(libchamplain_include_HEADERS)" \
- --include=Clutter-1.0 \
- --include=Gtk-2.0 \
- $(memphis_gir_include) \
- --library=champlain- CHAMPLAIN_API_VERSION@ \
- --libtool="$(LIBTOOL)" \
- --output $@ \
- --pkg gobject-2.0 \
- --pkg gtk+-2.0 \
- $(addprefix $(srcdir)/,$(libchamplain_ CHAMPLAIN_API_VERSION@_la_SOURCES)) \
- $(addprefix $(srcdir)/,$(libchamplain_include_HEADERS))
-
-BUILT_GIRSOURCES += Champlain- CHAMPLAIN_API_VERSION@.gir
-
-# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
-# install anything - we need to install inside our prefix.
girdir = $(datadir)/gir-1.0
-gir_DATA = $(BUILT_GIRSOURCES)
+dist_gir_DATA = $(INTROSPECTION_GIRS)
-typelibsdir = $(libdir)/girepository-1.0/
-typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
-Champlain- CHAMPLAIN_API_VERSION@.typelib: Champlain- CHAMPLAIN_API_VERSION@.gir $(INTROSPECTION_COMPILER)
- $(QUIET_GEN)$(DEBUG) $(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=. $(INTROSPECTION_COMPILER_OPTS) $< -o $(builddir)/$(@F)
+CLEANFILES += $(dist_gir_DATA) $(typelib_DATA)
-CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
endif
+
diff --git a/configure.ac b/configure.ac
index 37903bb..6928e4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ AC_CONFIG_SRCDIR([champlain/champlain.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([-Wno-portability])
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
@@ -29,12 +29,14 @@ AM_PROG_CC_C_O
# Checks for libraries.
LIBRARY_VERSION=0:0:0
CHAMPLAIN_API_VERSION=champlain_api_version
+CHAMPLAIN_API_VERSION_NORM=champlain_major_version[_]champlain_minor_version
CHAMPLAIN_MAJOR_VERSION=champlain_major_version
CHAMPLAIN_MINOR_VERSION=champlain_minor_version
CHAMPLAIN_MICRO_VERSION=champlain_micro_version
CHAMPLAIN_VERSION=champlain_version
CHAMPLAIN_MAJORMINOR=champlain_api_version
AC_SUBST(CHAMPLAIN_API_VERSION)
+AC_SUBST(CHAMPLAIN_API_VERSION_NORM)
AC_SUBST(CHAMPLAIN_MAJOR_VERSION)
AC_SUBST(CHAMPLAIN_MINOR_VERSION)
AC_SUBST(CHAMPLAIN_MICRO_VERSION)
diff --git a/m4/introspection.m4 b/m4/introspection.m4
index bb3a0da..589721c 100644
--- a/m4/introspection.m4
+++ b/m4/introspection.m4
@@ -21,7 +21,7 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
],[dnl
AC_ARG_ENABLE(introspection,
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
- [Enable introspection for this build]),,
+ [Enable introspection for this build]),,
[enable_introspection=auto])
])dnl
@@ -42,7 +42,7 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
[auto],[dnl
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
],dnl
- [dnl
+ [dnl
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
])dnl
@@ -59,12 +59,18 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+ INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+ INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+ INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
fi
AC_SUBST(INTROSPECTION_SCANNER)
AC_SUBST(INTROSPECTION_COMPILER)
AC_SUBST(INTROSPECTION_GENERATE)
AC_SUBST(INTROSPECTION_GIRDIR)
AC_SUBST(INTROSPECTION_TYPELIBDIR)
+ AC_SUBST(INTROSPECTION_CFLAGS)
+ AC_SUBST(INTROSPECTION_LIBS)
+ AC_SUBST(INTROSPECTION_MAKEFILE)
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]