Use standard introspection configure/Makefile bits

This changes the introspection configure flag from
--with/--without-introspection to --enable/--disable-introspection,
and changes it so that trying to enable introspection when g-i is not
installed results in an error, rather than being silently ignored.

https://bugzilla.gnome.org/show_bug.cgi?id=643959
This commit is contained in:
Dan Winship 2011-03-05 15:01:33 -05:00
parent 7841e80496
commit a66ae4ad55
2 changed files with 24 additions and 50 deletions

View File

@ -96,11 +96,6 @@ AC_ARG_ENABLE(startup-notification,
[disable mutter's startup notification support, for embedded/size-sensitive custom non-GNOME builds]),,
enable_startup_notification=auto)
AC_ARG_WITH(introspection,
AC_HELP_STRING([--without-introspection],
[disable the use of GObject introspection]),,
with_introspection=auto)
AC_ARG_WITH(libcanberra,
AC_HELP_STRING([--without-libcanberra],
[disable the use of libcanberra for playing sounds]),,
@ -214,24 +209,15 @@ else
AC_MSG_ERROR([no. Mutter requires Clutter version $CLUTTER_VERSION.])
fi
if test x$with_introspection != xno; then
PKG_CHECK_MODULES(INTROSPECTION, gobject-introspection-1.0 >= 0.9.5, have_introspection=yes, have_introspection=no)
if test x$have_introspection=xyes; then
MUTTER_PC_MODULES="$MUTTER_PC_MODULES gobject-introspection-1.0"
INTROSPECTION_VERSION=0.9.5
GOBJECT_INTROSPECTION_CHECK([$INTROSPECTION_VERSION])
if test x$found_introspection != xno; then
AC_DEFINE(HAVE_INTROSPECTION, 1, [Define if GObject introspection is available])
G_IR_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
AC_SUBST(G_IR_SCANNER)
G_IR_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
AC_SUBST(G_IR_COMPILER)
G_IR_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
AC_SUBST(G_IR_GENERATE)
GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
AC_SUBST(GIRDIR)
TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
AC_SUBST(TYPELIBDIR)
MUTTER_PC_MODULES="$MUTTER_PC_MODULES gobject-introspection-1.0"
META_GIR=[Meta_]mutter_major_version[_]mutter_minor_version[_gir]
AC_SUBST(META_GIR)
fi
fi
AM_CONDITIONAL(WITH_INTROSPECTION, test "$have_introspection" = "yes")
AC_MSG_CHECKING([Xcursor])
if $PKG_CONFIG xcursor; then
@ -561,7 +547,7 @@ mutter-$VERSION
Solaris Xinerama: ${use_solaris_xinerama}
Startup notification: ${have_startup_notification}
libcanberra: ${have_libcanberra}
Introspection: ${have_introspection}
Introspection: ${found_introspection}
Session management: ${found_sm}
Shape extension: ${found_shape}
Xsync: ${found_xsync}

View File

@ -196,9 +196,11 @@ mutter_theme_viewer_SOURCES= \
bin_PROGRAMS=mutter mutter-theme-viewer
if HAVE_INTROSPECTION
include $(INTROSPECTION_MAKEFILE)
api_version = $(MUTTER_MAJOR_VERSION).$(MUTTER_MINOR_VERSION)
if WITH_INTROSPECTION
# These files are in package-private directories, even though they may be used
# by plugins. If you're writing a plugin, use g-ir-compiler --add-include-path
# and g-ir-compiler --includedir.
@ -208,33 +210,19 @@ gir_DATA = Meta-$(api_version).gir
typelibdir = $(pkglibdir)
typelib_DATA = Meta-$(api_version).typelib
# We need to strip out the attribute that would point back to libmutter-introspect
# so that libgirepository looks for symbols in the executable instead
Meta-$(api_version).gir: $(G_IR_SCANNER) mutter $(libmutterinclude_HEADERS) $(mutter_SOURCES) Makefile
$(AM_V_GEN) pwd=`pwd` ; \
cd $(srcdir) && \
$(G_IR_SCANNER) \
--namespace=Meta \
--nsversion=$(api_version) \
--warn-all \
--warn-error \
--include=GObject-2.0 \
--include=Gdk-3.0 \
--include=Gtk-3.0 \
--include=Clutter-1.0 \
--pkg=clutter-1.0 \
--pkg=gtk+-3.0 \
--include=xlib-2.0 \
--include=xfixes-4.0 \
--program=$$pwd/mutter \
mutter-enum-types.h \
$(filter %.c,$(mutter_SOURCES)) \
$(libmutterinclude_base_headers) \
$(INCLUDES) \
-o $$pwd/$@
INTROSPECTION_GIRS = Meta-$(api_version).gir
Meta-$(api_version).gir: mutter
@META_GIR@_INCLUDES = GObject-2.0 Gdk-3.0 Gtk-3.0 Clutter-1.0 xlib-2.0 xfixes-4.0
@META_GIR@_PACKAGES = clutter-1.0 gtk+-3.0
@META_GIR@_CFLAGS = $(INCLUDES)
@META_GIR@_PROGRAM = $(builddir)/mutter
@META_GIR@_FILES = \
mutter-enum-types.h \
$(libmutterinclude_base_headers) \
$(filter %.c,$(mutter_SOURCES))
@META_GIR@_SCANNERFLAGS = --warn-all --warn-error
Meta-$(api_version).typelib: $(G_IR_COMPILER) Meta-$(api_version).gir
$(AM_V_GEN) LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) Meta-$(api_version).gir -o $@
endif
EFENCE=