summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-05-11 18:04:36 +0100
committerEmmanuele Bassi <ebassi@linux.intel.com>2009-05-11 18:04:36 +0100
commit89bf3ebf4a5bd8a666ff94d81061f1209c5d53d9 (patch)
treed76178475f768fe9d8319c64b02f8610af9fd660 /build
parent7209f24a26e26bf674ffaf391b7ca223816fd143 (diff)
downloadclutter-gtk-89bf3ebf4a5bd8a666ff94d81061f1209c5d53d9.tar.gz
Build GObject introspection data for clutter-gtk
Generate the GIR and the typelib for Clutter-GTK using the GObject-Introspection scanner and compiler, respectively. Original patch by: Colin Walters <walters@verbum.org> Patch updated by: Brian Cameron <brian.cameron@sun.com> Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Diffstat (limited to 'build')
-rw-r--r--build/autotools/Makefile.am2
-rw-r--r--build/autotools/introspection.m488
-rw-r--r--build/autotools/shave-libtool.in8
3 files changed, 95 insertions, 3 deletions
diff --git a/build/autotools/Makefile.am b/build/autotools/Makefile.am
index a17717f..8b1268d 100644
--- a/build/autotools/Makefile.am
+++ b/build/autotools/Makefile.am
@@ -1,3 +1,3 @@
-EXTRA_DIST = shave-libtool.in shave.in shave.m4
+EXTRA_DIST = shave-libtool.in shave.in shave.m4 introspection.m4
DISTCLEANFILES = shave-libtool shave
diff --git a/build/autotools/introspection.m4 b/build/autotools/introspection.m4
new file mode 100644
index 0000000..bb3a0da
--- /dev/null
+++ b/build/autotools/introspection.m4
@@ -0,0 +1,88 @@
+dnl -*- mode: autoconf -*-
+dnl Copyright 2009 Johan Dahlin
+dnl
+dnl This file is free software; the author(s) gives unlimited
+dnl permission to copy and/or distribute it, with or without
+dnl modifications, as long as this notice is preserved.
+dnl
+
+# serial 1
+
+m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
+[
+ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+ AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+ AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
+
+ dnl enable/disable introspection
+ m4_if([$2], [require],
+ [dnl
+ enable_introspection=yes
+ ],[dnl
+ AC_ARG_ENABLE(introspection,
+ AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
+ [Enable introspection for this build]),,
+ [enable_introspection=auto])
+ ])dnl
+
+ AC_MSG_CHECKING([for gobject-introspection])
+
+ dnl presence/version checking
+ AS_CASE([$enable_introspection],
+ [no], [dnl
+ found_introspection="no (disabled, use --enable-introspection to enable)"
+ ],dnl
+ [yes],[dnl
+ PKG_CHECK_EXISTS([gobject-introspection-1.0],,
+ AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
+ found_introspection=yes,
+ AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
+ ],dnl
+ [auto],[dnl
+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
+ ],dnl
+ [dnl
+ AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
+ ])dnl
+
+ AC_MSG_RESULT([$found_introspection])
+
+ INTROSPECTION_SCANNER=
+ INTROSPECTION_COMPILER=
+ INTROSPECTION_GENERATE=
+ INTROSPECTION_GIRDIR=
+ INTROSPECTION_TYPELIBDIR=
+ if test "x$found_introspection" = "xyes"; then
+ INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+ INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+ 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)"
+ fi
+ AC_SUBST(INTROSPECTION_SCANNER)
+ AC_SUBST(INTROSPECTION_COMPILER)
+ AC_SUBST(INTROSPECTION_GENERATE)
+ AC_SUBST(INTROSPECTION_GIRDIR)
+ AC_SUBST(INTROSPECTION_TYPELIBDIR)
+
+ AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
+])
+
+
+dnl Usage:
+dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
+
+AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
+[
+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
+])
+
+dnl Usage:
+dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
+
+
+AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
+[
+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
+])
diff --git a/build/autotools/shave-libtool.in b/build/autotools/shave-libtool.in
index 1f3a720..7b3d63f 100644
--- a/build/autotools/shave-libtool.in
+++ b/build/autotools/shave-libtool.in
@@ -11,8 +11,12 @@ lt_unmangle ()
last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
}
-# the real libtool to use
-LIBTOOL="$1"
+tempval=`echo $1 | sed s/\'//g`
+if test "x$tempval" = "x$SHELL"; then
+ shift
+fi
+tempval=`echo $1 | sed s/\'//g`
+LIBTOOL="$tempval"
shift
# if 1, don't print anything, the underlaying wrapper will do it