diff --git a/.gitignore b/.gitignore index b885bac..f8be3db 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ Makefile.in *# .#* *.stamp +*.typelib +*.gir telepathy-farstream/telepathy-farstream.pc telepathy-farstream/telepathy-farstream-uninstalled.pc diff --git a/Makefile.am b/Makefile.am index 34daccf..2096980 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ SUBDIRS = m4 \ $(PYTHON_SUBDIR) \ examples -DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection EXTRA_DIST = \ autogen.sh \ diff --git a/configure.ac b/configure.ac index 64900a1..ad5b656 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,9 @@ AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_30, [Prevent post 2.30 APIs]) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) +dnl check for gobject-introspection +GOBJECT_INTROSPECTION_CHECK([0.10.1]) + dnl Check for DBus PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60]) @@ -130,6 +133,14 @@ AM_CONDITIONAL(WANT_PYTHON, test "x$WANT_PYTHON" = "xyes") GTK_DOC_CHECK([1.17], [--flavour no-tmpl]) +dnl our libraries and install dirs use major.minor as a version +TF_MAJOR=tp_farstream_major_version +TF_MINOR=tp_farstream_minor_version +TF_MAJORMINOR=$TF_MAJOR.$TF_MINOR +TF_MAJOR_MINOR=$TF_MAJOR\_$TF_MINOR +AC_SUBST(TF_MAJORMINOR) +AC_SUBST(TF_MAJOR_MINOR) + LT_CURRENT=tp_farstream_lt_current LT_REVISION=tp_farstream_lt_revision LT_AGE=tp_farstream_lt_age diff --git a/m4/introspection.m4 b/m4/introspection.m4 new file mode 100644 index 0000000..589721c --- /dev/null +++ b/m4/introspection.m4 @@ -0,0 +1,94 @@ +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)" + 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") +]) + + +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/telepathy-farstream/Makefile.am b/telepathy-farstream/Makefile.am index 784fe9e..843718f 100644 --- a/telepathy-farstream/Makefile.am +++ b/telepathy-farstream/Makefile.am @@ -34,17 +34,20 @@ lib_LTLIBRARIES = libtelepathy-farstream.la pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = telepathy-farstream.pc -AM_CFLAGS = \ +TF_INTERNAL_CFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ -DG_LOG_DOMAIN=\"tp-fs\" \ - $(ERROR_CFLAGS) \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(GST_CFLAGS) \ $(FARSTREAM_CFLAGS) \ $(TELEPATHY_CFLAGS) +AM_CFLAGS = \ + $(TF_INTERNAL_CFLAGS) \ + $(ERROR_CFLAGS) + libtelepathy_farstream_la_LIBADD = \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ @@ -55,3 +58,31 @@ libtelepathy_farstream_la_LIBADD = \ libtelepathy_farstream_la_LDFLAGS = -no-undefined \ -export-symbols-regex "^tf_(init|content_|channel_).*" \ -version-info "$(LT_CURRENT)":"$(LT_REVISION)":"$(LT_AGE)" + +if HAVE_INTROSPECTION +include $(INTROSPECTION_MAKEFILE) +introspection_sources = \ + $(tfinclude_HEADERS) \ + channel.c \ + content.c + +INTROSPECTION_GIRS = TelepathyFarstream-@TF_MAJORMINOR@.gir +INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) +INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) +TelepathyFarstream_@TF_MAJOR_MINOR@.gir: libtelepathy-farstream.la +TelepathyFarstream_@TF_MAJOR_MINOR@_gir_NAMESPACE = TelepathyFarstream +TelepathyFarstream_@TF_MAJOR_MINOR@_gir_VERSION = @TF_MAJORMINOR@ +TelepathyFarstream_@TF_MAJOR_MINOR@_gir_LIBS = libtelepathy-farstream.la +TelepathyFarstream_@TF_MAJOR_MINOR@_gir_FILES = $(introspection_sources) +TelepathyFarstream_@TF_MAJOR_MINOR@_gir_INCLUDES = \ + GObject-2.0 Gio-2.0 TelepathyGLib-0.12 Farstream-0.1 +TelepathyFarstream_@TF_MAJOR_MINOR@_gir_CFLAGS = $(TF_INTERNAL_CFLAGS) +TelepathyFarstream_@TF_MAJOR_MINOR@_gir_SCANNERFLAGS = \ + --identifier-prefix=Tf \ + --c-include="telepathy-farstream/telepathy-farstream.h" + +girdir = $(datadir)/gir-1.0 +dist_gir_DATA = TelepathyFarstream-@TF_MAJORMINOR@.gir +typelibdir = $(libdir)/girepository-1.0 +typelib_DATA = TelepathyFarstream-@TF_MAJORMINOR@.typelib +endif diff --git a/telepathy-farstream/channel.c b/telepathy-farstream/channel.c index 175e863..d792c8c 100644 --- a/telepathy-farstream/channel.c +++ b/telepathy-farstream/channel.c @@ -504,7 +504,7 @@ tf_channel_class_init (TfChannelClass *klass) G_TYPE_NONE, 0); /** - * TfChannel::fs-conference-added + * TfChannel::fs-conference-added: * @tfchannel: the #TfChannel * @conf: a #FsConference * @@ -519,7 +519,7 @@ tf_channel_class_init (TfChannelClass *klass) G_TYPE_NONE, 1, FS_TYPE_CONFERENCE); /** - * TfChannel::fs-conference-removed + * TfChannel::fs-conference-removed: * @tfchannel: the #TfChannel * @conf: a #FsConference * @@ -535,7 +535,7 @@ tf_channel_class_init (TfChannelClass *klass) /** - * TfChannel::content-added + * TfChannel::content-added: * @tfchannel: the #TfChannel * @content: a #TfContent * @@ -553,7 +553,7 @@ tf_channel_class_init (TfChannelClass *klass) G_TYPE_NONE, 1, TF_TYPE_CONTENT); /** - * TfChannel::content-removed + * TfChannel::content-removed: * @tfchannel: the #TfChannel * @content: a #TfContent * diff --git a/telepathy-farstream/content.c b/telepathy-farstream/content.c index 3ec15f4..a088c18 100644 --- a/telepathy-farstream/content.c +++ b/telepathy-farstream/content.c @@ -117,7 +117,7 @@ tf_content_class_init (TfContentClass *klass) /** - * TfContent::start-sending + * TfContent::start-sending: * @content: the #TfContent * * This signal is emitted when the connection manager ask to send media. @@ -138,7 +138,7 @@ tf_content_class_init (TfContentClass *klass) G_TYPE_BOOLEAN, 0); /** - * TfContent::stop-sending + * TfContent::stop-sending: * @content: the #TfContent * * This signal is emitted when the connection manager ask to stop @@ -153,7 +153,7 @@ tf_content_class_init (TfContentClass *klass) G_TYPE_NONE, 0); /** - * TfContent::src-pad-added + * TfContent::src-pad-added: * @content: the #TfContent * @handle: the handle of the remote party producing the content on this pad * or 0 if unknown @@ -176,7 +176,7 @@ tf_content_class_init (TfContentClass *klass) G_TYPE_UINT, FS_TYPE_STREAM, GST_TYPE_PAD, FS_TYPE_CODEC); /** - * TfContent::start-receiving + * TfContent::start-receiving: * @content: the #TfContent * @handles: a 0-terminated array of #guint containing the handles * @handle_count: The number of handles in the @handles array @@ -202,7 +202,7 @@ tf_content_class_init (TfContentClass *klass) G_TYPE_BOOLEAN, 2, G_TYPE_POINTER, G_TYPE_UINT); /** - * TfContent::stop-receiving + * TfContent::stop-receiving: * @content: the #TfContent * @handles: a 0-terminated array of #guint containing the handles * @handle_count: The number of handles in the @handles array